Commit d0cd665
authored
feat!: bump to v4.0.0 (New Architecture Release) (#467)
## v4.0.0 — React Native New Architecture
v4 is a breaking release. The library now requires the React Native
**New Architecture** (TurboModules + Fabric) and no longer supports the
legacy bridge. Apps that are still on the old architecture should stay
on the `3.x` line.
## Changelog
### Breaking changes
**New Architecture is now required.**
- Consumers must have `newArchEnabled=true` on Android and
`:new_arch_enabled => true` in the iOS `Podfile`.
- See the React Native upgrade guide for migration help:
https://reactnative.dev/docs/the-new-architecture/use-the-new-architecture
**Several promise-returning APIs are now synchronous.** Drop `await`
from call sites:
| API | Before | After |
|-----|--------|-------|
| `getConfig()` | `Promise<Configuration>` | `Configuration` |
| `setConfig(config)` | `Promise<void>` | `void` |
| `configureAcceleratedCheckouts(config)` | `Promise<boolean>` | `boolean` |
| `isAcceleratedCheckoutAvailable()` | `Promise<boolean>` | `boolean` |
| `isApplePayAvailable()` | `Promise<boolean>` | `boolean` |
```diff
- const config = await shopify.getConfig();
+ const config = shopify.getConfig();
- await shopify.setConfig({preloading: true});
+ shopify.setConfig({preloading: true});
- const available = await shopify.isAcceleratedCheckoutAvailable();
+ const available = shopify.isAcceleratedCheckoutAvailable();
```
### Under the hood
- Native modules migrated from legacy bridge (`RCT_EXTERN_MODULE` / `ReactPackage`) to TurboModules (`NativeShopifyCheckoutSheetKitSpecBase` on iOS, `TurboReactPackage` on Android).
- Old-architecture conditional code paths removed from `RNShopifyCheckoutSheetKit.podspec` and Android `build.gradle`.
- `AcceleratedCheckoutButtons` now registered via `codegenNativeComponent`.
- Added runtime coercion for `colorScheme` / `logLevel` values returned by `getConfig()` — unknown values from native now fall back to safe defaults (`automatic` / `error`) rather than silently passing through as untyped strings.
### Migration checklist
- [ ] Enable New Architecture in your app (see React Native docs)
- [ ] Remove `await` from the five APIs listed above
- [ ] Reinstall pods: `cd ios && bundle exec pod install`1 parent 01be71e commit d0cd665
4 files changed
Lines changed: 20 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
67 | | - | |
| 68 | + | |
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
71 | 86 | | |
72 | 87 | | |
73 | 88 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2578 | 2578 | | |
2579 | 2579 | | |
2580 | 2580 | | |
2581 | | - | |
| 2581 | + | |
2582 | 2582 | | |
2583 | 2583 | | |
2584 | 2584 | | |
| |||
2996 | 2996 | | |
2997 | 2997 | | |
2998 | 2998 | | |
2999 | | - | |
| 2999 | + | |
3000 | 3000 | | |
3001 | 3001 | | |
3002 | 3002 | | |
| |||
0 commit comments