Commit ec7bc62
authored
remove legacy-bridge (#190)
### What changes are you making?
Removes the legacy `CheckoutBridge` JS interface (registered under the `"android"` name) and replaces it entirely with `EmbeddedCheckoutProtocol` as the sole JavaScript interface attached to `CheckoutWebView`. As part of this:
- `CheckoutBridge.kt` and its associated `WebToSdkEvent` model are deleted.
- The `errorevents` subpackage (`CheckoutErrorDecoder`, `CheckoutErrorGroup`, `CheckoutErrorPayload`) is removed, along with the error-group-based exception mapping it performed.
- The `lifecycleevents` subpackage models (`Address`, `CartInfo`, `CartLine`, `CartLineImage`, `CheckoutCompletedEvent`, `CheckoutCompletedEventDecoder`, `CompletedEvent`, `DeliveryDetails`, `DeliveryInfo`, `Discount`, `MoneyV2`, `OrderDetails`, `PaymentMethod`, `Price`) are removed from the public API surface, as they are now generated from the protocol definition.
- `ConfigurationException` and `ClientException` are removed from the documented exception hierarchy and error table. `CheckoutExpiredException` error codes `cart_completed` and `invalid_cart` are also removed.
- `CheckoutWebViewListener` no longer holds a `toggleHeader` callback, and `CheckoutDialog` no longer wires up header visibility toggling in response to modal events.
- `CheckoutWebView` now holds the listener directly rather than delegating through `CheckoutBridge`.
- All tests covering `CheckoutBridge`, `CheckoutCompletedEventDecoder`, `CheckoutErrorDecoder`, and the corresponding Java interop cases are removed.
- `AGENTS.md` is updated to reflect the new architecture, replacing references to `CheckoutBridge` and its `SCHEMA_VERSION` contract with `EmbeddedCheckoutProtocol`.
### How to test
1. Build the library and confirm it compiles cleanly with no references to `CheckoutBridge` or the removed `errorevents`/`lifecycleevents` classes.
2. Run the existing test suite (`./gradlew :lib:test`) and confirm all remaining tests pass.
3. Run `CheckoutWebViewTest` and verify the JavaScript interface assertions now reference `EmbeddedCheckoutProtocol.INTERFACE_NAME`.
4. Open a checkout flow in the `MobileBuyIntegration` sample app and verify that checkout loads, completes, and surfaces errors correctly through `EmbeddedCheckoutProtocol`.
5. Verify the Java interop test (`InteropTest.java`) compiles and passes without the removed decoder tests.
---
### Before you merge
> [!IMPORTANT]
>
> - [ ] I've added tests to support my implementation
> - [ ] I have read and agree with the [Contribution Guidelines](./CONTRIBUTING.md)
> - [ ] I have read and agree with the [Code of Conduct](./CODE_OF_CONDUCT.md)
> - [ ] I've updated the relevant platform README (`platforms/swift/README.md` and/or `platforms/android/README.md`)
---
<details>
<summary>Releasing a new Swift version?</summary>
- [ ] I have bumped the version in `ShopifyCheckoutKit.podspec`
- [ ] I have bumped the version in `platforms/swift/Sources/ShopifyCheckoutKit/ShopifyCheckoutKit.swift`
- [ ] I have updated `platforms/swift/CHANGELOG.md`
- [ ] I have updated the SwiftPM/CocoaPods version snippets in `platforms/swift/README.md` (major version only)
</details>
<details>
<summary>Releasing a new Android version?</summary>
- [ ] I have bumped the `versionName` in `platforms/android/lib/build.gradle`
- [ ] I have updated `platforms/android/CHANGELOG.md`
- [ ] I have updated the Gradle/Maven version snippets in `platforms/android/README.md`
</details>
> [!TIP]
> See the [Contributing documentation](./CONTRIBUTING.md) for the full release process per platform.1 parent a1dac09 commit ec7bc62
18 files changed
Lines changed: 17 additions & 1683 deletions
File tree
- platforms/android
- lib
- api
- src
- main/java/com/shopify/checkoutkit
- errorevents
- lifecycleevents
- test/java/com/shopify/checkoutkit
- errors
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | | - | |
28 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
97 | 96 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
346 | 346 | | |
347 | 347 | | |
348 | 348 | | |
349 | | - | |
350 | | - | |
351 | 349 | | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
| 350 | + | |
358 | 351 | | |
359 | | - | |
360 | | - | |
361 | 352 | | |
362 | 353 | | |
363 | 354 | | |
| |||
366 | 357 | | |
367 | 358 | | |
368 | 359 | | |
369 | | - | |
370 | 360 | | |
371 | 361 | | |
372 | 362 | | |
373 | 363 | | |
374 | | - | |
375 | 364 | | |
376 | 365 | | |
377 | 366 | | |
378 | 367 | | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | 368 | | |
383 | | - | |
| 369 | + | |
384 | 370 | | |
385 | 371 | | |
386 | | - | |
| 372 | + | |
387 | 373 | | |
388 | 374 | | |
389 | 375 | | |
390 | 376 | | |
391 | 377 | | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | 378 | | |
396 | 379 | | |
397 | 380 | | |
| |||
0 commit comments