Skip to content

Protocol: decode checkout snapshots without protocol metadata - #919

Open
markmur wants to merge 2 commits into
mainfrom
rn-checkout-snapshot-decoding
Open

markmur wants to merge 2 commits into
mainfrom
rn-checkout-snapshot-decoding

Conversation

@markmur

@markmur markmur commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Native Kit checkout snapshots omit protocol metadata. Add a schema-aware decoder that accepts these snapshots, converts known fields to camelCase, validates required checkout data, and preserves extension and dictionary keys.

The shared codec writes own data properties so __proto__ remains data, and rejects extension keys that collide with schema aliases instead of allowing them to overwrite typed fields.

Stack

@markmur
markmur requested a review from a team as a code owner October 6, 2026 13:33
@github-actions github-actions Bot added the #gsd:50662 Rebase Checkout Kit on UCP label Oct 6, 2026
@markmur
markmur added this pull request to stack #922 October 6, 2026 13:33
@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Protocol — Coverage Report

Lines Statements Branches Functions
Coverage: 94%
94.05% (174/185) 89.06% (114/128) 91.66% (33/36)

@markmur markmur changed the title rn checkout snapshot decoding Protocol: decode checkout snapshots without protocol metadata Oct 6, 2026
@github-actions

github-actions Bot commented Oct 6, 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 Oct 6, 2026 •

Copy link
Copy Markdown

Web — Coverage Report

Lines Statements Branches Functions
Coverage: 98%
95.52% (427/447) 86.64% (227/262) 97.19% (104/107)

@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Bundle Size Budgets

Budget Size Limits Result
Web JavaScript (uncompressed) 35.21 KiB (+225 B) 35 KiB soft / 50 KiB hard ⚠️ Acceptance required
React Native npm package (gzip) 120.05 KiB (+441 B) 130 KiB soft / 150 KiB hard ✅ Within budget

Repository writers, including the PR author, can accept current soft-budget breaches with a reason:

/accept-size web Explain why this increase is necessary.

Use one command per platform; several lines can share a comment. Post after this report is ready for the current head. Commands in edited comments are not accepted.

Acceptance applies to each currently exceeded metric up to its recorded size. Further growth or a newly exceeded metric needs fresh acceptance. Hard-budget increases require a reviewed change to .ci/bundle-size-budgets.json.

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
Web JavaScript bundle Uncompressed 35.0 KiB 35.2 KiB +225 B
Web JavaScript bundle gzip 10.8 KiB 10.9 KiB +78 B
Web npm package (.tgz) gzip 93.1 KiB 93.7 KiB +596 B
React Native npm package (.tgz) gzip 119.6 KiB 120.1 KiB +441 B
Web package files (uncompressed)

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

File Base Head Delta
dist/index.js.map 255.4 KiB 257.3 KiB +1.8 KiB
dist/custom-elements.json 51.9 KiB 51.9 KiB 0 B
dist/index.d.ts 48.5 KiB 48.5 KiB 0 B
dist/index.js 35.0 KiB 35.2 KiB +225 B
README.md 21.7 KiB 21.7 KiB 0 B
package.json 3.6 KiB 3.6 KiB 0 B
LICENSE 1.1 KiB 1.1 KiB 0 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.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
node_modules/@shopify/checkout-kit-protocol/src/protocol_codec_runtime.ts 6.4 KiB 7.9 KiB +1.5 KiB
lib/commonjs/index.js.map 7.9 KiB 7.9 KiB 0 B
node_modules/@shopify/checkout-kit-protocol/src/generated/ProtocolRenameMap.ts 7.8 KiB 7.8 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.

@markmur markmur self-assigned this Oct 6, 2026
@markmur
markmur force-pushed the rn-checkout-snapshot-decoding branch from ac31ea8 to 4afb62c Compare October 6, 2026 13:38
@bitrise

bitrise Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Bitrise builds

E2E · iOS CI

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

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

Comment thread protocol/languages/typescript/src/protocol_codec_runtime.ts
Comment thread protocol/languages/typescript/src/protocol_codec_runtime.ts
@markmur
markmur force-pushed the rn-checkout-snapshot-decoding branch from 1ae76bc to e5a1c72 Compare October 7, 2026 09:43
@markmur
markmur force-pushed the rn-checkout-snapshot-decoding branch from e5a1c72 to a8d7089 Compare October 8, 2026 10:38
@markmur
markmur removed this pull request from stack #922 October 8, 2026 11:06
@markmur
markmur force-pushed the rn-checkout-snapshot-decoding branch from a8d7089 to 714b513 Compare October 8, 2026 11:06
@markmur
markmur changed the base branch from main to swift-checkout-presentation-guard October 8, 2026 11:06
@markmur
markmur added this pull request to stack #943 October 8, 2026 11:06
@markmur
markmur removed this pull request from stack #943 October 8, 2026 11:35
@markmur
markmur force-pushed the rn-checkout-snapshot-decoding branch from 714b513 to fdbb0a0 Compare October 8, 2026 11:36
@markmur
markmur changed the base branch from swift-checkout-presentation-guard to swift-alpha-8-release October 8, 2026 11:36
@markmur
markmur added this pull request to stack #947 October 8, 2026 11:36
Base automatically changed from swift-alpha-8-release to main October 8, 2026 11:55
@markmur
markmur force-pushed the rn-checkout-snapshot-decoding branch from fdbb0a0 to 6677d5f Compare October 8, 2026 11:55
@markmur
markmur force-pushed the rn-checkout-snapshot-decoding branch 2 times, most recently from 6677d5f to 01bedfa Compare October 8, 2026 12:19

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.

3 participants