Skip to content

feat(RN): Add wiring for protocol events - add ec.start #170

Open
kieran-osgood-shopify wants to merge 1 commit into
mainfrom
kieran-osgood/05-15-feataddfirstprotocolevent
Open

feat(RN): Add wiring for protocol events - add ec.start #170
kieran-osgood-shopify wants to merge 1 commit into
mainfrom
kieran-osgood/05-15-feataddfirstprotocolevent

Conversation

@kieran-osgood-shopify
Copy link
Copy Markdown
Contributor

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

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 automatically camel case at their encode decode boundary, which means the raw json is read as snake case and the Swift and Kotlin properties are then turned into camel case when they are turned back into raw json, they're back in snake_case.

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 camelCase which means we need some layer to convert that over to camelCase.

I consider doing this on the TypeScript level

  • This would require greater degrees of unsafe mapping due to the types at play
  • I also didn't want to be blocking the main thread with lots of IO intensive work.

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 20, 2026

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 20, 2026

React Native — Coverage Report

Lines Statements Branches Functions
Coverage: 96%
95.07% (270/284) 90.64% (155/171) 100% (75/75)

@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/05-14-featremoveaddeventlistenerapi branch from 0967be1 to ef1aa23 Compare May 20, 2026 11:46
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/05-15-feataddfirstprotocolevent branch 2 times, most recently from bce2e51 to 69d73a1 Compare May 20, 2026 11:49
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/05-14-featremoveaddeventlistenerapi branch from ef1aa23 to 4cf6e67 Compare May 20, 2026 12:04
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/05-15-feataddfirstprotocolevent branch 2 times, most recently from 2fe0f4c to d66e597 Compare May 20, 2026 12:56
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/05-14-featremoveaddeventlistenerapi branch from 4cf6e67 to bb2ece5 Compare May 20, 2026 14:16
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/05-15-feataddfirstprotocolevent branch from d66e597 to ec45844 Compare May 20, 2026 14:17
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/05-14-featremoveaddeventlistenerapi branch from bb2ece5 to f782d21 Compare May 21, 2026 09:28
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/05-15-feataddfirstprotocolevent branch 3 times, most recently from 41dcbf3 to 9dbe6eb Compare May 21, 2026 10:23
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/05-15-feataddfirstprotocolevent branch from 9dbe6eb to 9c2bce2 Compare May 21, 2026 13:38
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/05-14-featremoveaddeventlistenerapi branch from f782d21 to 2a42f7e Compare May 21, 2026 13:38
@kieran-osgood-shopify kieran-osgood-shopify marked this pull request as ready for review May 21, 2026 14:13
@kieran-osgood-shopify kieran-osgood-shopify requested a review from a team as a code owner May 21, 2026 14:13
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/05-14-featremoveaddeventlistenerapi branch from 2a42f7e to d949cb6 Compare May 21, 2026 14:24
@kieran-osgood-shopify kieran-osgood-shopify changed the title feat: add first protocol event feat(RN): Add wiring for protocol events - add ec.start May 21, 2026
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/05-15-feataddfirstprotocolevent branch from 9c2bce2 to f77c5ca Compare May 21, 2026 14:27
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/05-14-featremoveaddeventlistenerapi branch from d949cb6 to 3921fb8 Compare May 21, 2026 14:56
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/05-15-feataddfirstprotocolevent branch 2 times, most recently from c75d0f4 to 57db8b8 Compare May 21, 2026 16:11
// 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 => {
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.

Need to improve the API here - seems like we might need a mapping layer, otherwise this unfortunately gives autocomplete of 'ec.start'

@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/05-15-feataddfirstprotocolevent branch from 57db8b8 to bb7c161 Compare May 22, 2026 08:26
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/05-14-featremoveaddeventlistenerapi branch 2 times, most recently from 16be541 to 5b6cd97 Compare May 22, 2026 09:54
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/05-15-feataddfirstprotocolevent branch from bb7c161 to 9ef43c6 Compare May 22, 2026 09:54
@kieran-osgood-shopify kieran-osgood-shopify changed the base branch from kieran-osgood/05-14-featremoveaddeventlistenerapi to graphite-base/170 May 22, 2026 10:17
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/05-15-feataddfirstprotocolevent branch from 9ef43c6 to 966160f Compare May 22, 2026 10:17
@graphite-app graphite-app Bot changed the base branch from graphite-base/170 to main May 22, 2026 10:18
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/05-15-feataddfirstprotocolevent branch 2 times, most recently from f697910 to 570d538 Compare May 22, 2026 10:31
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/05-15-feataddfirstprotocolevent branch from 570d538 to 6b2ea48 Compare May 22, 2026 10:45
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/05-15-feataddfirstprotocolevent branch 8 times, most recently from 01676a1 to 368bc23 Compare May 26, 2026 16:53
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/05-15-feataddfirstprotocolevent branch from 368bc23 to 49ffe7a Compare May 26, 2026 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants