Repository navigation
Conversation
Bundle Size Budgets
Bundle and package sizeWeb bundle sizes cover shipped runtime JavaScript. Package sizes cover the full published archive, including any source maps, declarations, and documentation it contains.
Web package files (uncompressed)These are uncompressed file sizes; they do not sum to the compressed package size above.
How sizes are measuredMeasured from the PR base SHA and PR head SHA. Web bundle rows sum shipped |
3a429e4 to
26f4b7b
Compare
|
/accept-size web Adds a second distribution entrypoint (CDN loader web-components.js, 969 B) and an npm re-export shim (276 B); the shared component chunk grew 104 B for the registration guard and chunk |
3f10675 to
7933df8
Compare
7933df8 to
a4dcd0f
Compare
a4dcd0f to
49161fc
Compare
256faaa to
c845519
Compare
c845519 to
ca87750
Compare
ca87750 to
9840674
Compare
9840674 to
0e63e4a
Compare
The npm root no longer registers <shopify-checkout> (#940), so the distribution tests now check the two real combinations: - npm component entry and CDN loader, in both orders: the first registration is kept. - npm root alongside the CDN loader, in both orders: the root registers nothing and the loader's registration works. CDN-PUBLISHING.md no longer says the root import registers.
0e63e4a to
86273a5
Compare
What changes are you making?
Add on-demand CDN loading to Checkout Kit Web, using the component structure and npm subpath introduced in #940. One package and version produce separate outputs:
build:npmwritesdist/, andbuild:cdnwritesdist-cdn/. Packing builds only npm output; CDN assets stay out of the npm package.The loader imports only requested components. The URL is evergreen within a Checkout Kit major version, independent of the underlying protocol version; components share that library version. Hashed implementation chunks are deployment details. The loader also exports
versionandsupportedComponents, validates requests before importing, shares concurrent loads, and retries transient import failures.The npm registration entry remains:
Both distributions use the component's
register.ts, which registers throughShopifyCheckout.register()and leaves an existing<shopify-checkout>in place, so loading npm and CDN together does not throw. The npm root registers nothing (#940); the distribution tests cover the npm component entry and the npm root alongside the CDN loader, in both orders. No separatecdn-components/source directory is needed.Publishing: the release workflow builds and verifies both outputs, checks deploy permissions before npm publication, and uploads hashed CDN chunks before the loader. Stable non-prerelease releases published to npm
latestupdate the major URL; other releases use the maintainer-onlyv<major>/unstable/channel. Re-running the original release can redeploy or roll back its CDN assets. Deployment, caching, and rollback details are inplatforms/web/CDN-PUBLISHING.mdandplatforms/web/RELEASING.md.Known limitation: maintenance releases for older majors are not supported yet; this needs addressing before a new major ships.
Open question: the public filename remains
web-components.js. This is a callable loader, unlike the Storefront side-effect bundle; the filename should be settled before first publication.How to test
Validation passed in the public checkout: 355 unit tests, 16 Chromium tests, 11 built-package tests, lint/typechecks, publint, the sample build, the packed-file snapshot comparison, and actionlint. Built-package tests cover consumer bundling and TypeScript resolution, isolated stable/unstable CDN layouts, and both npm/CDN loading orders.
After merge, a dry run from
maincan exercise deploy permissions without publishing. The first real prerelease deployment uses the unstable channel; the stable URL becomes available with4.0.0.