Skip to content

Migrate React Native sample to Expo prebuild#297

Draft
kieran-osgood-shopify wants to merge 7 commits into
graphite-base/297from
cx-expo-prebuild-migration
Draft

Migrate React Native sample to Expo prebuild#297
kieran-osgood-shopify wants to merge 7 commits into
graphite-base/297from
cx-expo-prebuild-migration

Conversation

@kieran-osgood-shopify

@kieran-osgood-shopify kieran-osgood-shopify commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Stack Context

This PR is stacked on top of #322, which moves the RN iOS bridge tests into a dedicated XcodeGen/CocoaPods integration app before this PR deletes the generated Expo sample native projects.

Summary

Lockfile maintenance doing some work on the git diff here:
image

  • migrate the React Native sample to Expo 56 prebuild/dev-client
  • replace sample-only native dependencies with Expo APIs/packages
  • delete committed generated sample native projects and add a unified dev rn prebuild command with --local support
  • make Expo prebuild always run clean so generated native projects are reproducible
  • align Expo dependency versions with expo install --check where the Shopify package proxy has the recommended version available
  • remove redundant direct React Native CLI/dev dependencies and legacy mocks

Validation

  • dev rn test ios
  • dev rn test android
  • dev rn test js
  • dev rn lint
  • git diff --check

Previous validation from this branch before restacking:

  • dev rn prebuild android --local
  • dev rn prebuild ios --local
  • pnpm exec expo install --check from platforms/react-native/sample
  • pnpm dlx expo-doctor from platforms/react-native/sample was attempted; remaining failures are from expo-doctor shelling out to npm explain, which is blocked by the workspace npm wrapper/minimum dependency age enforcement under shadowenv

Notes

  • This intentionally stops before CI/docs follow-up work.
  • Generated platforms/react-native/sample/ios and platforms/react-native/sample/android are ignored and regenerated via clean Expo prebuild.
  • expo, expo-build-properties, and expo-font are pinned to the newest SDK 56 versions currently available through the Shopify package proxy, and are excluded from Expo dependency validation until the proxy catches up to Expo's latest recommendations.

kieran-osgood-shopify commented Jun 18, 2026

Copy link
Copy Markdown
Contributor Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@kieran-osgood-shopify kieran-osgood-shopify force-pushed the cx-expo-prebuild-migration branch 4 times, most recently from fed581f to 525dc82 Compare June 19, 2026 13:23
@kieran-osgood-shopify kieran-osgood-shopify added the #gsd:50662 Rebase Checkout Kit on UCP label Jun 19, 2026
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the cx-expo-prebuild-migration branch 3 times, most recently from 4e0e1bc to e8d8056 Compare June 23, 2026 10:20
working-directory: platforms/react-native/sample

- name: Verify iOS lockfile uses published native SDK
run: scripts/check_published_podfile_lock sample/ios/Podfile.lock

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is now inlined into the platforms/react-native/sample/scripts/build_ios script

Assisted-By: devx/fb34cb30-8090-438b-b735-1d8f8eb128a6
Assisted-By: devx/741457bb-fda8-43d5-b35b-2e08c409a2fe
Assisted-By: devx/2d0344dc-43dd-4535-baf2-409ff9e93de5
Assisted-By: devx/c25009c8-5a1d-4cb8-aee9-2dcf64902080
Assisted-By: devx/058cd5b9-f1cc-431b-b520-15657ace50f1
@kieran-osgood-shopify kieran-osgood-shopify changed the base branch from main to graphite-base/297 June 23, 2026 17:21
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the cx-expo-prebuild-migration branch from 1293856 to ecf8970 Compare June 23, 2026 17:21
@kieran-osgood-shopify kieran-osgood-shopify changed the base branch from graphite-base/297 to kieran-osgood/cx-expo-prebuild/rct-integration-tests June 23, 2026 17:21
[],
);
useEffect(() => {
customerAccountManager.buildAuthorizationURL().then(setAuthorizationURL);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't have been refactored from useMemo

const updatedColors = getColors(
appConfig.colorScheme,
Appearance.getColorScheme(),
Appearance.getColorScheme() ?? 'light',

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should probably extract a helper for this we have called it with the null coalsescing operation a number of times

getRandomBytes,
} from 'expo-crypto';

function base64URLEncode(buffer: ArrayBufferLike): string {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO; test customer authentication

).boolValue
}

func testConfigureAcceleratedCheckoutsSetsSharedConfigsOnIOS16() throws {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i dont see why all these tests have changed

// MARK: - RenderState

func testRenderStateSerialization_includesErrorReason() throws {
func testRenderStateSerialization_includesErrorReason() {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again not sure why all these changes came in

window: {width: 390, height: 844, scale: 3, fontScale: 1},
screen: {width: 390, height: 844, scale: 3, fontScale: 1},
},
isIPhoneX_deprecated: false,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont see any reference to this being used - im not sure whether any of these mocks are actually necessary


```tsx
import {ApolloClient, gql, ApolloProvider} from '@apollo/client';
import {API_VERSION, STOREFRONT_DOMAIN, STOREFRONT_ACCESS_TOKEN} from '@env';

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this didn't need to change

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should re-run pnpm dedupe to check whether theres anything we can trim off here

"react-native-vector-icons": "^10.3.0",
"react-native-webview": "^13.16.0"
},
"peerDependencies": {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is removal of the peerDeps a regression in how we resolve react-native / react version now?

: []),
],
},
extra: {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i dont think we need this - we access all of the values from the expo .env rather than from Constants.expoConfig.extra

fs.copyFileSync(from, to);
}

function withIosLocalSdkPodfile(config) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not confident we actually need any of this? the only thing I believe we need to conditionally apply via podfile is the use local sdk pods

return mod;
});

return withEntitlementsPlist(config, mod => {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is confusing - we already setup the entitlements in the app.config.js - so this seems duplicated

}

function withGeneratedLinks(config) {
config = withInfoPlist(config, mod => {

@kieran-osgood-shopify kieran-osgood-shopify Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pretty sure this can be achieved with a ios.infoplist entry in the app.config.js

debugImplementation(shopifySdkArtifact)

testImplementation "junit:junit:4.13.2"
testImplementation "androidx.activity:activity:1.9.3"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

double check these were necessary to add

- name: Verify iOS lockfile uses published native SDK
run: scripts/check_published_podfile_lock sample/ios/Podfile.lock

- name: Cache cocoapods

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it'd be beneficial to bring back the caching

@kieran-osgood-shopify kieran-osgood-shopify changed the base branch from kieran-osgood/cx-expo-prebuild/rct-integration-tests to graphite-base/297 June 24, 2026 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

#gsd:50662 Rebase Checkout Kit on UCP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant