Skip to content

feat(react-native): use local android/swift project references#115

Merged
kieran-osgood-shopify merged 2 commits into
mainfrom
kieran-osgood/05-14-featreact-nativeuselocalandroid/swiftprojectreferences
May 15, 2026
Merged

feat(react-native): use local android/swift project references#115
kieran-osgood-shopify merged 2 commits into
mainfrom
kieran-osgood/05-14-featreact-nativeuselocalandroid/swiftprojectreferences

Conversation

@kieran-osgood-shopify
Copy link
Copy Markdown
Contributor

@kieran-osgood-shopify kieran-osgood-shopify commented May 14, 2026

What changes are you making?

Adds a --local flag to the react native ios and android commands

local defaults to false, meaning you will point to the production builds, currently this will fail as we dont have production builds on the new checkout-kit namespace, so to run the app you'll typically want --local

Usage:
dev rn android --local
dev rn ios --local

This will configure the native code to point to the local platforms/ios/ and platforms/android` directory, instead of the published maven and cocoapods versions.

This enables a local development feedback loop without waiting for publishes for react native.

How to test


Before you merge

Important

  • I've added tests to support my implementation
  • I have read and agree with the Contribution Guidelines
  • I have read and agree with the Code of Conduct
  • I've updated the relevant platform README (platforms/swift/README.md and/or platforms/android/README.md)

Releasing a new Swift version?
  • 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)
Releasing a new Android version?
  • 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

Tip

See the Contributing documentation for the full release process per platform.

Copy link
Copy Markdown
Contributor Author

kieran-osgood-shopify commented May 14, 2026

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

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 14, 2026

React Native — Coverage Report

Lines Statements Branches Functions
Coverage: 95%
95.52% (192/201) 92.3% (108/117) 100% (60/60)

@kieran-osgood-shopify kieran-osgood-shopify added the #gsd:50662 Rebase Checkout Kit on UCP label May 14, 2026
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/05-14-featreact-nativeuselocalandroid/swiftprojectreferences branch from 06f977e to 9863b61 Compare May 14, 2026 18:04
@kieran-osgood-shopify kieran-osgood-shopify changed the base branch from kieran-osgood/05-14-featprotocoladdtypescriptinterfaces to graphite-base/115 May 14, 2026 18:26
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/05-14-featreact-nativeuselocalandroid/swiftprojectreferences branch from 9863b61 to f84aa0f Compare May 14, 2026 18:27
@graphite-app graphite-app Bot changed the base branch from graphite-base/115 to main May 14, 2026 18:27
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/05-14-featreact-nativeuselocalandroid/swiftprojectreferences branch 2 times, most recently from 8f6af8c to 9d68bbe Compare May 14, 2026 19:13

def useLocalSdk = (System.getenv("USE_LOCAL_SDK") ?: "0") == "1"
def shopifySdkArtifact = useLocalSdk
? "com.shopify:checkout-kit:1.0.0"
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 version doesn't matter as its just using local so it accepts anything

Copy link
Copy Markdown
Contributor

@tiagocandido tiagocandido left a comment

Choose a reason for hiding this comment

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


Review assisted by pair-review


### CI

CI uses the default (published) path naturally — no special flag handling. As defense-in-depth, the build wiring still ignores `USE_LOCAL_SDK=1` when the `CI` env var is set (GitHub Actions sets `CI=true` automatically).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The docs say CI naturally stays on the published path and ignores USE_LOCAL_SDK when CI=true, but the workflows added in this PR set USE_LOCAL_SDK=1 globally and the Podfile, podspec, Gradle files, and helper scripts do not check CI before honoring it. As written, this section gives reviewers and contributors the wrong model for how RN CI is currently working.

Suggestion:

Suggested change
CI uses the default (published) path naturally — no special flag handling. As defense-in-depth, the build wiring still ignores `USE_LOCAL_SDK=1` when the `CI` env var is set (GitHub Actions sets `CI=true` automatically).
CI currently sets `USE_LOCAL_SDK=1` so the sample and module build against the in-repo Swift and Android SDKs until the renamed `ShopifyCheckoutKit` artifacts are published to CocoaPods trunk and Maven Central.


allprojects {
repositories {
mavenLocal()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This PR describes local SDK resolution as opt-in, but mavenLocal() is now inserted ahead of remote repositories in the sample build and the RN module Gradle file. In the non-local path both consumers still request com.shopify:checkout-sheet-kit:3.5.3, so any matching artifact already in ~/.m2 will win before Gradle reaches Maven Central. That makes a plain non---local build depend on contributor machine state instead of reliably exercising the published path.

Suggestion: Consider gating mavenLocal() behind the same USE_LOCAL_SDK switch in both Android Gradle files, or at minimum restricting it with repository content filters so only explicit local-mode builds can resolve Shopify SDK artifacts from ~/.m2.

fi
done

if [ "$use_local" = "1" ]; then
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🐛 Bug: The new iOS flow only re-resolves CocoaPods when --local is present, but the rest of the wiring treats USE_LOCAL_SDK as the underlying switch. That means USE_LOCAL_SDK=1 dev rn ios can keep using whatever pods were previously resolved instead of switching to the local ShopifyCheckoutKit pod, which makes the documented env-driven path unreliable on iOS.

Suggestion:

Suggested change
if [ "$use_local" = "1" ]; then
if [ "$use_local" = "1" ] || [ "${USE_LOCAL_SDK:-0}" = "1" ]; then
export USE_LOCAL_SDK=1
(cd "$SCRIPT_DIR/../.." && pnpm run pod-install -- --local)
fi

@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/05-14-featreact-nativeuselocalandroid/swiftprojectreferences branch from ca7804f to 27e1a45 Compare May 15, 2026 17:57
@kieran-osgood-shopify kieran-osgood-shopify merged commit df3847b into main May 15, 2026
20 checks passed
Copy link
Copy Markdown
Contributor Author

Merge activity

@kieran-osgood-shopify kieran-osgood-shopify deleted the kieran-osgood/05-14-featreact-nativeuselocalandroid/swiftprojectreferences branch May 15, 2026 18:12
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.

2 participants