[WIP] Add bundle size exception request flow - #8344
Draft
igor10k wants to merge 3 commits into
Draft
Conversation
igor10k
force-pushed
the
extension-cap-exception-cli-prototype
branch
from
August 17, 2026 19:16
4504257 to
be4ecba
Compare
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?
Remote-DOM UI extension bundles (API version
2025-10or later) are limited to 64 KB (compressed), enforced at deploy time. Some apps can't reduce their bundles below the limit even after optimization, and Shopify can grant a per-app bundle size exception.Today there's no way to request one from the CLI, and the deploy error doesn't tell developers what to do next. This PR adds that flow.
What?
Three commits, reviewable independently:
1. Keep esbuild metafiles in the app deploy archive
*.metafile.jsonnext to each extension bundle; stop excluding them from the deploy archive so bundle composition can be analyzed when an exception request is reviewed. Sourcemaps remain excluded.2. Add hidden
shopify app bundle-size-exception requestcommand--reasonmakes it non-interactive.appBundleSizeExceptionRequestApp Management mutation. The CLI sends measurements and a justification, and Shopify reviews every request. Server-sideuserErrorsare surfaced directly.DeveloperPlatformClientgainsbundleSizeException/bundleSizeExceptionRequest(App Management client only).3. Point at the request flow from bundle-size deploy errors
{type: bundle_size_limit}entry in the error'sonpayload, the validation-error output gains a "Bundle size exception" section telling the developer to run the request command. Structured detection only — no message parsing.Testing
Requires an App Management API that exposes the new
appBundleSizeExceptionRequestmutation andapp.bundleSizeExceptionfield (rolling out server-side), and an app with a UI extension onapi_version = "2025-10".pnpm shopify app bundle-size-exception request --path <app>(--pathis optional)--reason "text"→ runs with no prompts.pnpm shopify app deploy→ the bundle-size validation error shows the "Bundle size exception" section.bundle.test.ts(*.metafile.jsonkept,*.js.mapexcluded).