feat(RN): Add wiring for protocol events - add ec.start #170
Open
kieran-osgood-shopify wants to merge 1 commit into
Open
feat(RN): Add wiring for protocol events - add ec.start #170kieran-osgood-shopify wants to merge 1 commit into
ec.start #170kieran-osgood-shopify wants to merge 1 commit into
Conversation
This was referenced May 20, 2026
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
11 tasks
0967be1 to
ef1aa23
Compare
bce2e51 to
69d73a1
Compare
ef1aa23 to
4cf6e67
Compare
2fe0f4c to
d66e597
Compare
4cf6e67 to
bb2ece5
Compare
d66e597 to
ec45844
Compare
bb2ece5 to
f782d21
Compare
41dcbf3 to
9dbe6eb
Compare
11 tasks
9dbe6eb to
9c2bce2
Compare
f782d21 to
2a42f7e
Compare
11 tasks
2a42f7e to
d949cb6
Compare
ec.start
9c2bce2 to
f77c5ca
Compare
d949cb6 to
3921fb8
Compare
c75d0f4 to
57db8b8
Compare
| // once we're satisfied the relay is wired correctly we'll route | ||
| // protocol events through `useShopifyEventHandlers` (or an | ||
| // equivalent) just like the SDK lifecycle ones above. | ||
| [CheckoutProtocol.start]: checkout => { |
Contributor
Author
There was a problem hiding this comment.
Need to improve the API here - seems like we might need a mapping layer, otherwise this unfortunately gives autocomplete of 'ec.start'
57db8b8 to
bb7c161
Compare
16be541 to
5b6cd97
Compare
bb7c161 to
9ef43c6
Compare
9ef43c6 to
966160f
Compare
5b6cd97 to
a0c67fb
Compare
f697910 to
570d538
Compare
kiftio
reviewed
May 22, 2026
570d538 to
6b2ea48
Compare
kiftio
reviewed
May 22, 2026
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
| */ | ||
|
|
||
| #if COCOAPODS |
Contributor
There was a problem hiding this comment.
AI feedback, so unsure of accuracy
The RN pod target does not define COCOAPODS in OTHER_SWIFT_FLAGS, so CocoaPods builds will take the #else branch and try to import ShopifyCheckoutProtocol, which is not a pod/module dependency. If we fix that by adding -DCOCOAPODS, CheckoutProtocolBridge.swift then appears to redeclare the conformance already provided by ShopifyCheckoutKit in platforms/swift/Sources/ShopifyCheckoutKit/CheckoutCommunicationProtocol.swift:33. I’d key this on SWIFT_PACKAGE instead and delete the retroactive conformance.
kiftio
reviewed
May 22, 2026
| } | ||
|
|
||
| static func transformKeys(_ value: Any, _ fn: (String) -> String) -> Any { | ||
| if let dict = value as? [String: Any] { |
Contributor
There was a problem hiding this comment.
AI also came up with one thing here..
transformKeys rewrites every dictionary key, including map keys that are data rather than field names. UCP registries like payment_handlers, services, and capabilities are keyed by reverse-domain names, and those keys can contain underscores. A key like com.example.loyalty_gold would become com.example.loyaltyGold before JS sees it. The casing pass should avoid transforming dynamic registry/map keys, or use a schema-aware/generated serializer.
The example it gave
{
"ucp": {
"payment_handlers": {
"com.example.loyalty_gold": []
}
}
}
The desired JS shape is:
{
"ucp": {
"paymentHandlers": {
"com.example.loyalty_gold": []
}
}
}
But the current recursive transform would produce:
{
"ucp": {
"paymentHandlers": {
"com.example.loyaltyGold": []
}
}
}
Do we need to be concerned with this?
Contributor
Author
There was a problem hiding this comment.
Honestly good question - I hadn't considered this, I'll look into it
6b2ea48 to
5afea2d
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?
Part of the scope of this PR is to add a translation layer between the the core native SDKs and the React native JavaScript runtime. The models that are generated for Swift and Kotlin in automatically camel case at their encode decode boundary, which means the raw Jason is read as snake case and the Swift and Kotlin properties are then turned into camel case when they are turned back into raw Jason, they're back in Snakecase.
This is problematic for React Native because we do not have a schema validation library. we are just using the CodeGen TypeScript interfaces, faces which again are in camel case which means we need some layer to convert that over to camelCase.
I consider doing this on the TypeScript level
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.