Remove New Arch interop checks - New Arch only#456
Open
kieran-osgood-shopify wants to merge 15 commits intomainfrom
Open
Remove New Arch interop checks - New Arch only#456kieran-osgood-shopify wants to merge 15 commits intomainfrom
kieran-osgood-shopify wants to merge 15 commits intomainfrom
Conversation
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
This was referenced Mar 30, 2026
cc709d6 to
f89b585
Compare
14eb240 to
b78d8d1
Compare
3 tasks
b78d8d1 to
ead781e
Compare
07d29f6 to
ba34eac
Compare
995f1b1 to
068673a
Compare
9c8a074 to
4be033f
Compare
068673a to
32a2485
Compare
This was referenced Apr 17, 2026
markmur
reviewed
Apr 17, 2026
markmur
approved these changes
Apr 17, 2026
josemiguel-alvarez
approved these changes
Apr 17, 2026
tiagocandido
approved these changes
Apr 17, 2026
fdb9158 to
c99a638
Compare
83db6fb to
d45eb12
Compare
d45eb12 to
fa18e5f
Compare
c99a638 to
f60bb00
Compare
0d43f55 to
dc837d5
Compare
62d1bcf to
dee8e5c
Compare
dc837d5 to
bf8dba6
Compare
…igration Prepare codebase for React Native new-architecture (TurboModules/codegen) by adding JS specs, codegen native components, and test mocks. What changed and why: - Added a TurboModule spec (NativeShopifyCheckoutSheetKit) and a codegen native component spec (RCTAcceleratedCheckoutButtonsNativeComponent) to declare the native API surface and typed component props. This moves JS to consume the new-arch API surface via TurboModuleRegistry and codegenNativeComponent instead of using NativeModules/requireNativeComponent directly. - Updated AcceleratedCheckoutButtons to import codegenNativeComponent and use the generated native component type instead of requireNativeComponent. - Added codegenConfig to the package.json to configure codegen generation for this module. - Added Jest mocks for codegenNativeComponent and extended the react-native manual mock to provide TurboModuleRegistry.getEnforcing, getConstants, and event listener helpers so unit tests run against the new-arch surface. - Added a moduleNameMapper entry to jest.config.js so tests resolve the codegenNativeComponent import to the new mock. - Updated a linking test to assert TurboModuleRegistry behavior (throws when module not present) rather than the old NativeModules linking error. - Adjusted runtime usage to read version via getConstants() and cast getConfig() return types for better typing with the spec. Context and next steps: - These changes are groundwork only: they enable the JS-side migration to the RN new architecture and allow tests to run against the new-arch signatures. - Native implementations (iOS/Android) still need corresponding TurboModule and codegen native component implementations, and we must decide on compatibility strategy (clean break vs dual support). Dual support will add duplication (parallel native hooks, bridging shims) and phased rollout; a clean break requires coordinating release timelines for hosts consuming this module. - Suggested next phases: (1) implement native TurboModule & codegen components on each platform, (2) add migration shims to continue supporting old NativeModules if dual-mode required, (3) integration testing & performance validation, (4) cutover and remove old-arch shims when safe. This commit prepares the repository for the migration and makes future work (native bindings and compatibility strategy) easier to implement and test.
Reduce the surface area and simplify startup scripts to prepare for the React Native new-arch migration. - Narrow CompleteEvent.orderDetails to a readonly object containing only id, email and phone (remove nested cart/lines). This reduces the amount of complex data being passed through the bridge and simplifies the typings for the accelerated checkout UI component and its native/JS contract. Note: this is a breaking API/type change for any consumers that relied on the cart payload — update callers accordingly. - Simplify sample/package.json scripts by removing hard-coded simulator selection for ios/start. This makes the sample project scripts more portable across developer machines and CI and avoids simulator name mismatches during iteration. These changes are intended to lower duplication and complexity while we plan the phased migration to the new RN architecture (fewer/cleaner native<->JS contracts makes a cleaner transition).
Add TypeScript spec stubs and package snapshot entries to prepare for React Native’s new architecture. These changes introduce spec files for the native module/native component surface (with MIT license headers) and update the package snapshot so the generated commonjs/module/typescript artifacts and type declarations are tracked. This is a preparatory change to enable codegen/TurboModule and native component integration as part of the larger new-arch migration. No runtime behavior is changed here — this just lays the groundwork for the phased migration to the new RN architecture and packaging of the generated artifacts.
…ndency resolution The Gradle foojay-resolver-convention plugin needs gson from Maven Central, which intermittently returns 403. Adding explicit pluginManagement repositories (gradlePluginPortal, google, mavenCentral) provides fallback mirrors. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The macOS runner's pre-installed npm has a corrupted promise-retry module, causing `npm install -g npm@11` to fail. Since all CI jobs use yarn (not npm), this step is non-critical. Emit a warning annotation and continue instead of failing the job. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Update test references from NativeModules.ShopifyCheckoutSheetKit to TurboModuleRegistry.getEnforcing to match the production code path established by this PR. Remove stale event emitter cleanup that was specific to the old NativeModules mock shape. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
dee8e5c to
cd35500
Compare
Replaces the deprecated deep import `react-native/Libraries/Utilities/codegenNativeComponent` with the top-level named import now exported from `react-native`. The `react-native/Libraries/Types/CodegenTypes` import is preserved because codegen's AST parser matches those type names statically — it can't follow namespace or alias indirection. Suppressed the lint warning on that one line with a note explaining why. Also simplifies the jest setup: `codegenNativeComponent` is now mocked alongside the rest of `react-native` in `__mocks__/react-native.ts`, so the separate `__mocks__/codegenNativeComponent.ts` file and its `moduleNameMapper` entry in `jest.config.js` are no longer needed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
cd35500 to
5d96a31
Compare
Now that we're on TurboModules, the four promise-based methods (getConfig, configureAcceleratedCheckouts, isAcceleratedCheckoutAvailable, isApplePayAvailable) can use synchronous JSI dispatch. Their native implementations are pure in-memory reads or state writes, so the Promise wrapper was boilerplate that blocked readable call sites. BREAKING CHANGE: Consumers must drop `await` from these calls. - Spec: return ConfigurationResultSpec / boolean directly instead of Promise - iOS Swift: remove resolve/reject, return NSDictionary / NSNumber - Android: annotate with isBlockingSynchronousMethod = true, return directly - Consumer API in src/index.ts and src/context.tsx: drop async / await - Tests: replace mockResolvedValue with mockReturnValue, drop awaits - Sample app: drop awaits in Cart and SettingsScreen Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The codegen spec returns colorScheme and logLevel as `string`, but the consumer-facing Configuration type uses typed enums. Replace the previous `as Configuration` cast with a parser that: - Validates colorScheme/logLevel against known enum values, falling back to the safest default when the native side returns an unrecognised value - Re-shapes the flat iOS color fields into the nested `colors.ios` shape so a round trip through setConfig preserves user overrides - Omits undefined fields so consumers don't see spurious `title: undefined` Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Swift tests were still calling the four converted methods with resolve/reject callbacks. Update them to call the sync API directly and compare against the returned NSNumber/NSDictionary. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
bf8dba6 to
6ddb3e2
Compare
5d96a31 to
a3ed0f2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What changes are you making?
Following on from the introduction of turbo specs in #449 this PR removes the existing fabric conditionals leaving only the new architecture enabled going forwards
PR Checklist
Important
Releasing a new version of the kit?
package.jsonfile.Tip
See the Contributing documentation for instructions on how to publish a new version of the library.