Skip to content

feat: remove addEventListener API#119

Draft
kieran-osgood-shopify wants to merge 1 commit into
mainfrom
kieran-osgood/05-14-featremoveaddeventlistenerapi
Draft

feat: remove addEventListener API#119
kieran-osgood-shopify wants to merge 1 commit into
mainfrom
kieran-osgood/05-14-featremoveaddeventlistenerapi

Conversation

@kieran-osgood-shopify
Copy link
Copy Markdown
Contributor

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

What changes are you making?

The current React Native API exposes checkout.addEventListener(event, callback) for close, error, and geolocationRequest.

It operates on a "global" singleton pattern, and works well for responding to things like AppState or Keyboard, but not so much on the instances of AcceleratedCheckoutButtons or the ShopifyCheckout component.

Removing it in this PR leads us towards the future state API in upstack PR's

  <CheckoutSheet
        url={checkoutUrl}
        onCancel={() => setVisible(false)}
        onFail={() => {}}
        protocol={{
          start:    chk => analytics.track('checkout_start', { id: chk.id }),
          complete: chk => {
            reset();
            setVisible(false);
          },
          error:    err => toast(err.messages[0]?.content ?? 'Checkout error'),
        }}
      />


 ShopifyCheckoutKit.present(url, sdkHandlers, { [CheckoutProtocol.start]: c => {c.checkourUrl} })

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

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

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: 99%
99.46% (187/188) 95.45% (105/110) 100% (58/58)

@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/05-14-featremoveaddeventlistenerapi branch from fe4bbe0 to 866347c Compare May 14, 2026 22:05
* released.
*/
present(checkoutURL: string): void;
present(checkoutURL: string, callbacks?: PresentCallbacks): void;
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.

terminology to be aligned with native implementations - previously "CheckoutDelegate" or "CheckoutEventProcessor"

@tiagocandido tiagocandido added the #gsd:50662 Rebase Checkout Kit on UCP label May 15, 2026 — with Graphite App
@kieran-osgood-shopify kieran-osgood-shopify changed the base branch from kieran-osgood/05-14-featremovecheckoutlifecyclefromreact-native to graphite-base/119 May 15, 2026 16:58
@kieran-osgood-shopify kieran-osgood-shopify changed the base branch from graphite-base/119 to kieran-osgood/05-14-featreact-nativeuselocalandroid/swiftprojectreferences May 15, 2026 16:58
@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 force-pushed the kieran-osgood/05-14-featremoveaddeventlistenerapi branch from 866347c to 86cefb5 Compare May 15, 2026 17:57
@kieran-osgood-shopify kieran-osgood-shopify changed the base branch from kieran-osgood/05-14-featreact-nativeuselocalandroid/swiftprojectreferences to graphite-base/119 May 15, 2026 18:12
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/05-14-featremoveaddeventlistenerapi branch from 86cefb5 to fc3c557 Compare May 15, 2026 18:14
@graphite-app graphite-app Bot changed the base branch from graphite-base/119 to main May 15, 2026 18:14
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/05-14-featremoveaddeventlistenerapi branch from fc3c557 to 3fe052f Compare May 15, 2026 18:14
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