[WIP] Add TurboModule specs and codegen components to prepare RN new-arch migration#449
Open
kieran-osgood-shopify wants to merge 9 commits intomainfrom
Open
[WIP] Add TurboModule specs and codegen components to prepare RN new-arch migration#449kieran-osgood-shopify wants to merge 9 commits intomainfrom
kieran-osgood-shopify wants to merge 9 commits intomainfrom
Conversation
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
5eeb961 to
b0baa2d
Compare
Base automatically changed from
kieran-osgood/03-25-chorebumpdev.ymltoios26.2
to
main
March 26, 2026 10:41
…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).
b0baa2d to
5a8de84
Compare
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.
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>
…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>
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?
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.