feat(react-native): use local android/swift project references#115
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
06f977e to
9863b61
Compare
5ac9a6d to
cacf47e
Compare
9863b61 to
f84aa0f
Compare
8f6af8c to
9d68bbe
Compare
|
|
||
| def useLocalSdk = (System.getenv("USE_LOCAL_SDK") ?: "0") == "1" | ||
| def shopifySdkArtifact = useLocalSdk | ||
| ? "com.shopify:checkout-kit:1.0.0" |
There was a problem hiding this comment.
this version doesn't matter as its just using local so it accepts anything
9d68bbe to
193682d
Compare
tiagocandido
left a comment
There was a problem hiding this comment.
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). |
There was a problem hiding this comment.
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:
| 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() |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
🐛 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:
| 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 |
ca7804f to
27e1a45
Compare
Merge activity
|

What changes are you making?
Adds a
--localflag to the react native ios and android commandslocal 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 --localdev rn ios --localThis will configure the native code to point to the local
platforms/ios/ andplatforms/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
platforms/swift/README.mdand/orplatforms/android/README.md)Releasing a new Swift version?
ShopifyCheckoutKit.podspecplatforms/swift/Sources/ShopifyCheckoutKit/ShopifyCheckoutKit.swiftplatforms/swift/CHANGELOG.mdplatforms/swift/README.md(major version only)Releasing a new Android version?
versionNameinplatforms/android/lib/build.gradleplatforms/android/CHANGELOG.mdplatforms/android/README.mdTip
See the Contributing documentation for the full release process per platform.