Skip to content

[BLOCKED] [RN][Refactor]: Rename React Native dismissal callbacks to onDismiss - #749

Draft
kieran-osgood-shopify wants to merge 2 commits into
checkout-dismissal-lifecyclefrom
rn-ondismiss
Draft

kieran-osgood-shopify wants to merge 2 commits into
checkout-dismissal-lifecyclefrom
rn-ondismiss

Conversation

@kieran-osgood-shopify

@kieran-osgood-shopify kieran-osgood-shopify commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Blocked on #829. This PR describes the intended React Native dismissal behaviour on top of #932, but it does not build against the current native SDKs: the RN bridge still uses native APIs that main removed (ShopifyCheckoutKit.present(…, client:), AcceleratedCheckoutButtons.connect(_:), checkoutDidFail(error:), and Android's CheckoutProtocol.Client relay). #829 ports the bridge to the native lifecycle events and overlaps with this rename. Once #829 merges, rebase this PR, keep only what #829 lacks, and add React Native simulator evidence.

What changes are you making?

Closes https://github.com/shop/issues-checkout-kit/issues/1261

Rename the React Native checkout dismissal callbacks to use one public API name:

  • PresentCallbacks.onClose → onDismiss
  • AcceleratedCheckoutButtons.onCancel → onDismiss

This is an intentional breaking rename without compatibility aliases. The private native lifecycle event remains close.

Document and test that checkout completion and presentation dismissal are separate events: CheckoutProtocol.complete reports order completion, while onDismiss reports a later buyer dismissal. Programmatic dismiss() invokes neither onDismiss nor onFail.

Register accelerated checkout's onDismiss as a direct native event. React Native already reserves topDismiss as a direct event for modal dismissal; registering it as bubbling caused an event-type collision and an iOS RedBox during app startup.

Update the sample, API report, README, JavaScript tests, and iOS integration coverage.


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/react-native/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 the SwiftPM/CocoaPods version snippets in platforms/swift/README.md (major version only)
Releasing a new Embedded Checkout Protocol version?
  • I have bumped embeddedCheckoutProtocolAndroid in platforms/android/gradle/libs.versions.toml
  • I have updated protocol/languages/kotlin/embedded-checkout-protocol/api/embedded-checkout-protocol.api if the public API changed
Releasing a new Android version?
  • I have bumped checkoutKitAndroid in platforms/android/gradle/libs.versions.toml
  • 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.

@github-actions github-actions Bot added the #gsd:50662 Rebase Checkout Kit on UCP label Sep 8, 2026
@kieran-osgood-shopify
kieran-osgood-shopify changed the base branch from main to swift-accelerated-checkout-dismissals September 11, 2026 09:24
@kieran-osgood-shopify
kieran-osgood-shopify added this pull request to stack #763 September 11, 2026 09:24
@kieran-osgood-shopify kieran-osgood-shopify changed the title Rename React Native dismissal callbacks to onDismiss [RN][Refactor]: Rename React Native dismissal callbacks to onDismiss Sep 14, 2026
* Presents the checkout sheet for a given checkout URL.
*
* Exactly one of `callbacks.onClose` or `callbacks.onFail` fires per
* At most one of `callbacks.onDismiss` or `callbacks.onFail` fires per

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.

🟡 Before this PR is merged, update checkoutKit.nativeSdkVersions.ios and .android in package.json to 4.0.0-alpha.7 after those native artifacts are published. This lifecycle contract depends on the alpha.7 native dismissal behavior.

@kieran-osgood-shopify
kieran-osgood-shopify removed this pull request from stack #763 October 7, 2026 11:54
@kieran-osgood-shopify
kieran-osgood-shopify changed the base branch from swift-accelerated-checkout-dismissals to checkout-dismissal-lifecycle October 7, 2026 11:54
@kieran-osgood-shopify
kieran-osgood-shopify added this pull request to stack #933 October 7, 2026 11:54
@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Bundle Size Budgets

Budget Size Limits Result
React Native npm package (gzip) 119.98 KiB (+364 B) 130 KiB soft / 150 KiB hard ✅ Within budget

Bundle and package size

Web bundle sizes cover shipped runtime JavaScript. Package sizes cover the full published archive, including any source maps, declarations, and documentation it contains.

Platform Measurement Compression Base Head Delta
React Native npm package (.tgz) gzip 119.6 KiB 120.0 KiB +364 B
React Native package files (uncompressed)

These are uncompressed file sizes; they do not sum to the compressed package size above.

File Base Head Delta
node_modules/@shopify/checkout-kit-protocol/src/generated/Models.ts 108.7 KiB 108.7 KiB 0 B
node_modules/@shopify/checkout-kit-protocol/src/generated/Models.d.ts 73.1 KiB 73.1 KiB 0 B
android/src/main/java/com/shopify/reactnative/checkoutkit/ShopifyCheckoutKitModule.java 16.2 KiB 16.6 KiB +440 B
ios/ShopifyCheckoutKit.swift 16.1 KiB 15.3 KiB -761 B
ios/AcceleratedCheckoutButtons.swift 14.1 KiB 14.1 KiB 0 B
src/components/AcceleratedCheckoutButtons.tsx 13.0 KiB 13.2 KiB +163 B
src/index.ts 12.7 KiB 13.0 KiB +328 B
lib/commonjs/index.js 12.4 KiB 12.7 KiB +292 B
src/index.d.ts 11.3 KiB 11.7 KiB +394 B
lib/commonjs/components/AcceleratedCheckoutButtons.js 11.4 KiB 11.4 KiB +6 B
lib/module/index.js 10.4 KiB 10.7 KiB +292 B
lib/commonjs/components/AcceleratedCheckoutButtons.js.map 10.4 KiB 10.4 KiB +2 B
lib/module/components/AcceleratedCheckoutButtons.js 10.2 KiB 10.2 KiB +6 B
node_modules/@shopify/checkout-kit-protocol/src/generated/ProtocolNotifications.ts 9.5 KiB 9.5 KiB 0 B
lib/module/components/AcceleratedCheckoutButtons.js.map 9.1 KiB 9.1 KiB +2 B
lib/module/index.js.map 8.1 KiB 8.2 KiB +84 B
lib/commonjs/index.js.map 7.9 KiB 8.0 KiB +85 B
src/present-dispatcher.ts 8.0 KiB 8.0 KiB +4 B
node_modules/@shopify/checkout-kit-protocol/src/generated/ProtocolRenameMap.ts 7.8 KiB 7.8 KiB 0 B
node_modules/@shopify/checkout-kit-protocol/src/generated/ProtocolNotifications.d.ts 7.6 KiB 7.6 KiB 0 B
…and 117 smaller files
How sizes are measured

Measured from the PR base SHA and PR head SHA. Web bundle rows sum shipped .js, .mjs, and .cjs files under dist/, excluding source maps and declarations. The gzip bundle size sums files compressed individually with gzip -n -9. npm package sizes are gzip-compressed .tgz archives; Android AAR sizes are ZIP archives. Package sizes are not final app binary sizes.

@kieran-osgood-shopify kieran-osgood-shopify changed the title [RN][Refactor]: Rename React Native dismissal callbacks to onDismiss [BLOCKED] [RN][Refactor]: Rename React Native dismissal callbacks to onDismiss Oct 7, 2026
Assisted-By: devx/3f0e7f93-212d-45d8-b056-138b2da8389f
Assisted-By: devx/3f0e7f93-212d-45d8-b056-138b2da8389f

This branch has not been deployed

No deployments
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