Report extension compressed bundle size using Brotli - #8400
Open
igor10k wants to merge 1 commit into
Open
Conversation
igor10k
force-pushed
the
i10k/brotli-bundle-size
branch
from
August 25, 2026 20:36
437ee8c to
30c4e00
Compare
igor10k
marked this pull request as ready for review
August 25, 2026 20:45
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the CLI’s extension bundle-size reporting to align with the platform’s enforced compressed-size limit by switching the compression estimate from deflate to Brotli (quality 11), ensuring developers see a size number that matches the real gate.
Changes:
- Replace deflate-based compression sizing with Brotli compression at quality 11 when computing the reported “~X KB compressed” size.
- Update tests to validate Brotli-based sizing and keep formatting behavior consistent.
- Add a changeset documenting the user-visible change in reported compressed bundle size.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/app/src/cli/services/build/bundle-size.ts | Switch compressed size computation from deflate to brotliCompress with quality 11. |
| packages/app/src/cli/services/build/bundle-size.test.ts | Update tests/helpers to assert Brotli-compressed byte sizes and preserve output formatting expectations. |
| .changeset/brotli-bundle-size-report.md | Record the user-facing change as a patch release note for @shopify/app. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
vividviolet
approved these changes
Aug 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why?
The build output prints a compressed size estimate (
... built in 123ms (215.4 KB original, ~48.1 KB compressed)) so developers can stay under the platform's compressed-size limit for remote-DOM extensions (64 KB for checkout). The platform now measures that limit with Brotli instead of deflate, so the CLI's deflate-based estimate overestimates and no longer matches what's enforced.What?
Compress with Brotli using the same settings as the platform: quality 11.
Trade-off: brotli-11 costs ~1ms/KB per rebuild (incl.
app devwatch loop) — ≤ ~0.3s for realistic bundles, acceptable for a number that matches the enforced limit exactly.Testing
app build(orapp dev) on an app with a checkout UI extension.~Y KB compressedsuffix matcheszlib.brotliCompressSyncat quality 11 on the built JS.