Skip to content

Compact protocol metadata and streamline telemetry - #861

Draft
markmur wants to merge 3 commits into
mainfrom
ae-task-773-reduce-checkout-kit-s-web-javascript-bun
Draft

markmur wants to merge 3 commits into
mainfrom
ae-task-773-reduce-checkout-kit-s-web-javascript-bun

Conversation

@markmur

@markmur markmur commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Build on the Vite minification change to reduce the web bundle further through compact protocol metadata and simpler telemetry bookkeeping. JavaScript decreases from 34,073 to 27,953 bytes (18.0%), and deterministic gzip decreases from 10,458 to 9,998 bytes (4.4%).

  • Generate shared wire-field names, numeric model references, and compact traversal metadata. Escaped base-91 integers allow the encoding to grow with the schema.
  • Cache encode/decode lookups once per model, avoiding repeated name conversion and allocation during payload traversal.
  • Simplify telemetry export handling and navigation instrumentation while preserving events, retry behavior, validation errors, and extension payload handling.
  • Cover encoding boundaries, nested structures, lookup reuse, and telemetry retries; independently assert all 15 expected protocol methods and the set size.

Stack

@github-actions github-actions Bot added the #gsd:50662 Rebase Checkout Kit on UCP label Oct 1, 2026
@markmur markmur self-assigned this Oct 1, 2026
@markmur
markmur force-pushed the ae-task-773-reduce-checkout-kit-s-web-javascript-bun branch 3 times, most recently from 0f9877c to e4c50d6 Compare October 2, 2026 08:32
@markmur
markmur changed the base branch from main to web-full-output-minification October 2, 2026 08:32
@markmur
markmur added this pull request to stack #863 October 2, 2026 08:32
@markmur markmur changed the title Reduce web JavaScript bundle size Compact protocol metadata and streamline telemetry Oct 2, 2026
@markmur
markmur force-pushed the ae-task-773-reduce-checkout-kit-s-web-javascript-bun branch from e4c50d6 to bd2e8b4 Compare October 2, 2026 08:35
@markmur
markmur force-pushed the ae-task-773-reduce-checkout-kit-s-web-javascript-bun branch from bd2e8b4 to 8431a3f Compare October 2, 2026 08:56
@markmur
markmur removed this pull request from stack #863 October 2, 2026 08:57
@markmur
markmur changed the base branch from web-full-output-minification to bundle-size-budgets October 2, 2026 08:57
@markmur
markmur added this pull request to stack #865 October 2, 2026 08:57
@markmur
markmur force-pushed the ae-task-773-reduce-checkout-kit-s-web-javascript-bun branch 3 times, most recently from 3327c6d to eb3471e Compare October 2, 2026 09:49
@markmur
markmur force-pushed the ae-task-773-reduce-checkout-kit-s-web-javascript-bun branch 5 times, most recently from d88d13b to abbddcb Compare October 2, 2026 10:38
Base automatically changed from bundle-size-budgets to main October 2, 2026 12:16
@markmur
markmur force-pushed the ae-task-773-reduce-checkout-kit-s-web-javascript-bun branch from abbddcb to d5aa18b Compare October 2, 2026 12:16
@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Bundle Size Budgets

Budget Size Limits Result
Web JavaScript (uncompressed) 27.30 KiB (-5.98 KiB) 35 KiB soft / 50 KiB hard ✅ Within budget
  • Comment 5952199366: wait for the current size report, then post a new command.

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 33.3 KiB 27.3 KiB -6.0 KiB
Web JavaScript bundle gzip 10.2 KiB 9.8 KiB -461 B
Web npm package (.tgz) gzip 89.5 KiB 89.1 KiB -459 B
React Native npm package (.tgz) gzip 119.6 KiB 120.4 KiB +788 B
Android Library package (.aar) ZIP 407.6 KiB 407.6 KiB 0 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 249.0 KiB 241.5 KiB -7.5 KiB
dist/index.d.ts 47.9 KiB 47.9 KiB 0 B
dist/custom-elements.json 47.5 KiB 46.9 KiB -532 B
dist/index.js 33.3 KiB 27.3 KiB -6.0 KiB
README.md 20.2 KiB 20.2 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.2 KiB -267 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/ProtocolRenameMap.ts 7.8 KiB 5.3 KiB -2.5 KiB
node_modules/@shopify/checkout-kit-protocol/src/generated/ProtocolNotifications.d.ts 7.6 KiB 7.6 KiB 0 B
…and 119 smaller files
Android package files (uncompressed)

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

File Base Head Delta
classes.jar 434.3 KiB 434.3 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
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.

Compact generated protocol metadata and enable full Oxc library
minification while preserving protocol and telemetry behavior.
Cache model lookups and support schema growth in the compact encoding.

Orchestrated-by: ae <noreply@shopify.com>
@markmur
markmur force-pushed the ae-task-773-reduce-checkout-kit-s-web-javascript-bun branch from d5aa18b to 893fc2c Compare October 2, 2026 16:47

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