Skip to content

Namespace Swift protocol payloads - #777

Open
markmur wants to merge 4 commits into
mainfrom
namespace-swift-protocol-checkout
Open

markmur wants to merge 4 commits into
mainfrom
namespace-swift-protocol-checkout

Conversation

@markmur

@markmur markmur commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

All Swift event payloads, request results, protocol-only helper models, and checkout/error parameter wrappers now live under EmbeddedCheckoutProtocol. This prevents collisions with Kit’s public Checkout when CocoaPods compiles both source sets into one module. SwiftPM and CocoaPods use the same names, without top-level aliases for protocol payloads.

The generator derives payloads from the event catalog and includes their exclusive dependencies. Shared checkout and order domain types remain top-level, preserving Kit’s direct use of Buyer, LineItem, and CheckoutTotal. Model fields and wire-format strings are unchanged. Generated examples use the same namespace rules as the declarations.

Both API dump and check canonicalize declarations at module and nested-type levels, including members added by extensions. Stored-property and enum-case order, parameter types, and other metadata arrays retain their ordering. Committed baselines use that same representation. Regression tests cover stable dumps and detection of meaningful API changes.

Model round-trip tests use the generated JSON helpers consistently, with fixtures covering absent dates, checkout expiry, and nested delivery dates. The checkout event APIs and production event-decoding fix remain in the Swift PR above this prerequisite.

Stack

Top to bottom:

  1. Web: Add protocol-agnostic checkout events for web #766
  2. Android: Add protocol-agnostic checkout events for Android #767
  3. Swift events: Protocol-agnostic checkout events for Swift #748
  4. Swift protocol namespace (this PR): Namespace Swift protocol payloads #777

@markmur
markmur requested a review from a team as a code owner September 14, 2026 17:01
@github-actions github-actions Bot added the #gsd:50662 Rebase Checkout Kit on UCP label Sep 14, 2026
@github-actions

github-actions Bot commented Sep 14, 2026

Copy link
Copy Markdown

React Native — Coverage Report

Lines Statements Branches Functions
Coverage: 91%
90.97% (363/399) 87.29% (213/244) 100% (92/92)

@github-actions

github-actions Bot commented Sep 14, 2026

Copy link
Copy Markdown

Web — Coverage Report

Lines Statements Branches Functions
Coverage: 96%
94.46% (290/307) 81.11% (146/180) 98.73% (78/79)

@github-actions

github-actions Bot commented Sep 14, 2026

Copy link
Copy Markdown

Package Size

Platform Artifact Base Head Delta
Web npm tarball 80.1 KiB 80.1 KiB 0 B
React Native npm tarball 108.6 KiB 108.6 KiB 0 B
Android release AAR 366.6 KiB 366.6 KiB 0 B
Web file breakdown
File Base Head Delta
dist/index.js.map 217.7 KiB 217.7 KiB 0 B
dist/custom-elements.json 51.4 KiB 51.4 KiB 0 B
dist/index.d.ts 45.9 KiB 45.9 KiB 0 B
dist/index.js 39.5 KiB 39.5 KiB 0 B
README.md 20.0 KiB 20.0 KiB 0 B
package.json 2.9 KiB 2.9 KiB 0 B
LICENSE 1.1 KiB 1.1 KiB 0 B
React Native file breakdown
File Base Head Delta
node_modules/@shopify/checkout-kit-protocol/src/generated/Models.ts 85.4 KiB 85.4 KiB 0 B
node_modules/@shopify/checkout-kit-protocol/src/generated/Models.d.ts 53.0 KiB 53.0 KiB 0 B
android/src/main/java/com/shopify/reactnative/checkoutkit/ShopifyCheckoutKitModule.java 16.2 KiB 16.2 KiB 0 B
ios/ShopifyCheckoutKit.swift 16.1 KiB 16.1 KiB 0 B
ios/AcceleratedCheckoutButtons.swift 14.1 KiB 14.1 KiB 0 B
src/components/AcceleratedCheckoutButtons.tsx 13.0 KiB 13.0 KiB 0 B
src/index.ts 12.7 KiB 12.7 KiB 0 B
lib/commonjs/index.js 12.4 KiB 12.4 KiB 0 B
lib/commonjs/components/AcceleratedCheckoutButtons.js 11.4 KiB 11.4 KiB 0 B
src/index.d.ts 11.3 KiB 11.3 KiB 0 B
lib/commonjs/components/AcceleratedCheckoutButtons.js.map 10.4 KiB 10.4 KiB 0 B
lib/module/index.js 10.4 KiB 10.4 KiB 0 B
lib/module/components/AcceleratedCheckoutButtons.js 10.2 KiB 10.2 KiB 0 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 0 B
lib/module/index.js.map 8.1 KiB 8.1 KiB 0 B
src/present-dispatcher.ts 8.0 KiB 8.0 KiB 0 B
lib/commonjs/index.js.map 7.9 KiB 7.9 KiB 0 B
node_modules/@shopify/checkout-kit-protocol/src/generated/ProtocolNotifications.d.ts 7.6 KiB 7.6 KiB 0 B
node_modules/@shopify/checkout-kit-protocol/src/generated/ProtocolRenameMap.ts 7.2 KiB 7.2 KiB 0 B
…and 117 smaller files
Android file breakdown
File Base Head Delta
classes.jar 390.5 KiB 390.5 KiB 0 B
res/layout/checkout_view_content.xml 2.6 KiB 2.6 KiB 0 B
res/layout/checkout_sheet_content.xml 2.0 KiB 2.0 KiB 0 B
res/values/values.xml 1.3 KiB 1.3 KiB 0 B
R.txt 1.2 KiB 1.2 KiB 0 B
AndroidManifest.xml 922 B 922 B 0 B
proguard.txt 798 B 798 B 0 B
res/drawable/close.xml 431 B 431 B 0 B
res/menu/checkout_menu.xml 354 B 354 B 0 B
META-INF/com/android/build/gradle/aar-metadata.properties 157 B 157 B 0 B

Measured from the PR base SHA and PR head SHA. The file breakdown shows uncompressed sizes within each package artifact, so individual files do not sum to the compressed artifact total. This comment reports package artifact sizes only; it is not a final app binary-size report.

@markmur markmur changed the title Namespace Swift protocol checkout model Namespace Swift protocol payloads Sep 14, 2026
@bitrise

bitrise Bot commented Sep 14, 2026

Copy link
Copy Markdown

Install this build

Open Tophat, select your target device, then click Install. Links open on the Mac running Tophat.

SDK Install
React Native Install with Tophat
Swift Install with Tophat
Kotlin Install with Tophat

Checkout Kit E2E results

Status Tags Target Platform OS version tag Device
launch, checkout-presentation, checkout-completion, buyer-identity react-native ios latest iPhone 15
iOS 27 Beta
launch, checkout-presentation, checkout-completion, buyer-identity react-native android latest Google Pixel 9
Android 17.0
launch, checkout-presentation, checkout-completion, buyer-identity, preload kotlin android latest Google Pixel 9
Android 17.0
launch, checkout-presentation, checkout-completion, buyer-identity, preload swift ios latest iPhone 15
iOS 27 Beta

Comment thread platforms/swift/Scripts/api Outdated
Comment thread platforms/swift/Scripts/api Outdated
Comment thread protocol/scripts/swift_namespacing.mjs Outdated
@github-actions

github-actions Bot commented Sep 15, 2026

Copy link
Copy Markdown

Protocol — Coverage Report

Lines Statements Branches Functions
Coverage: 94%
93.58% (146/156) 87.75% (86/98) 90% (27/30)

@github-actions

github-actions Bot commented Sep 15, 2026

Copy link
Copy Markdown

React Native — Coverage Report

Lines Statements Branches Functions
Coverage: 91%
90.97% (363/399) 87.29% (213/244) 100% (92/92)

@markmur
markmur force-pushed the namespace-swift-protocol-checkout branch from 52fc225 to 3537557 Compare September 16, 2026 12:11
@github-actions

github-actions Bot commented Sep 16, 2026

Copy link
Copy Markdown

Web — Coverage Report

Lines Statements Branches Functions
Coverage: 96%
94.47% (342/362) 81.77% (166/203) 96.84% (92/95)

@markmur
markmur force-pushed the namespace-swift-protocol-checkout branch from 3537557 to c68b132 Compare September 17, 2026 11:04
@markmur
markmur force-pushed the namespace-swift-protocol-checkout branch from c68b132 to 7f40b94 Compare September 18, 2026 10:09

Shared checkout and order domain types remain top-level. This preserves direct
use of `Buyer`, `LineItem`, and `CheckoutTotal` in Kit's public snapshot.
Kit's public `Checkout` snapshot is separate from the namespaced wire checkout.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: This mentions Kit’s public Checkout, but this PR does not add that type. The Swift events PR above this one adds it. Move this sentence there, or rewrite this section to only describe EmbeddedCheckoutProtocol.Checkout.

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.

3 participants