Conversation
… — saves ~5,904 KB\n\nResult: {"status":"keep","bundle_kb":125332,"js_kb":46412,"maps_kb":74152,"assets_kb":4768}
…784, maps: -2,328)\n\nResult: {"status":"keep","bundle_kb":111220,"js_kb":34628,"maps_kb":71824,"assets_kb":4768}
…ings)\n\nResult: {"status":"keep","bundle_kb":99508,"js_kb":30844,"maps_kb":63896,"assets_kb":4768}
…. Already lazy-loaded via dynamic import.\n\nResult: {"status":"keep","bundle_kb":76368,"js_kb":22848,"maps_kb":48752,"assets_kb":4768}
…ble at runtime as project dep.\n\nResult: {"status":"keep","bundle_kb":57192,"js_kb":16500,"maps_kb":35924,"assets_kb":4768}
…dable (identifiers not minified).\n\nResult: {"status":"keep","bundle_kb":21440,"js_kb":16500,"maps_kb":172,"assets_kb":4768}
…36)\n\nResult: {"status":"keep","bundle_kb":16776,"js_kb":11836,"maps_kb":172,"assets_kb":4768}
…,132 KB\n\nResult: {"status":"keep","bundle_kb":15644,"js_kb":10704,"maps_kb":172,"assets_kb":4768}
…s 524 KB\n\nResult: {"status":"keep","bundle_kb":15120,"js_kb":10180,"maps_kb":172,"assets_kb":4768}
… KB\n\nResult: {"status":"keep","bundle_kb":14128,"js_kb":9188,"maps_kb":172,"assets_kb":4768}
…conciler@0.29.2) — saves 424 KB\n\nResult: {"status":"keep","bundle_kb":13704,"js_kb":8764,"maps_kb":172,"assets_kb":4768}
…ed impact)\n\nResult: {"status":"keep","bundle_kb":13592,"js_kb":8652,"maps_kb":172,"assets_kb":4768}
…Result: {"status":"keep","bundle_kb":13176,"js_kb":8236,"maps_kb":172,"assets_kb":4768}
…-parser, @vscode/web-custom-data — saves 1,136 KB\n\nResult: {"status":"keep","bundle_kb":12040,"js_kb":7100,"maps_kb":172,"assets_kb":4768}
…mver, yaml, js-yaml, execa — saves 1,100 KB\n\nResult: {"status":"keep","bundle_kb":10940,"js_kb":6000,"maps_kb":172,"assets_kb":4768}
…eing bundled) — saves 348 KB\n\nResult: {"status":"keep","bundle_kb":10592,"js_kb":5652,"maps_kb":172,"assets_kb":4768}
… 20+ more runtime deps — saves 1,868 KB\n\nResult: {"status":"keep","bundle_kb":8724,"js_kb":3784,"maps_kb":172,"assets_kb":4768}
|
/snapit |
Coverage report
Test suite run success3806 tests passing in 1462 suites. Report generated by 🧪jest coverage report action from 195248b |
|
/snapit |
|
🫰✨ Thanks @gonzaloriestra! Your snapshot has been published to npm. Test the snapshot by installing your package globally: npm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20260313171105Caution After installing, validate the version by running |
d564ba3 to
9893f54
Compare
9893f54 to
696e5f7
Compare
|
/snapit |
|
🫰✨ Thanks @gonzaloriestra! Your snapshot has been published to npm. Test the snapshot by installing your package globally: npm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20260317160706Caution After installing, validate the version by running |
|
/snapit |
|
🫰✨ Thanks @gonzaloriestra! Your snapshot has been published to npm. Test the snapshot by installing your package globally: npm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20260318104923Caution After installing, validate the version by running |
a573c2d to
195248b
Compare
|
We detected some changes at Caution DO NOT create changesets for features which you do not wish to be included in the public changelog of the next CLI release. |
craigmichaelmartin
left a comment
There was a problem hiding this comment.
So cool! Thank you for leading these autoresearch improvements!!
dmerand
left a comment
There was a problem hiding this comment.
I love this approach overall! Review found a couple of concerns worth addressing prior to shipping.
| esBuild({ | ||
| bundle: true, | ||
| entryPoints: ['./src/**/*.ts'], | ||
| entryPoints: ['./src/index.ts'], |
There was a problem hiding this comment.
The change from globbing all .ts files to a single "./src/index.ts" entry point breaks the oclif hooks configuration.
The Problem
The oclif configuration in packages/cli/package.json expects these hook files:
"hooks": {
"prerun": "./dist/hooks/prerun.js",
"postrun": "./dist/hooks/postrun.js"
}These source files exist:
- packages/cli/src/hooks/prerun.ts
- packages/cli/src/hooks/postrun.ts
However, packages/cli/src/index.ts does NOT import or export these hooks. They are meant to be standalone files per oclif convention.
Impact
With the old config (entryPoints: ["./src/**/*.ts"]):
- esbuild finds all .ts files via glob
- Creates corresponding .js files maintaining directory structure
- Outputs
dist/hooks/prerun.jsanddist/hooks/postrun.js✅
With the new config (entryPoints: ["./src/index.ts"]):
- esbuild only bundles what's reachable from index.ts
- Since prerun/postrun aren't imported by index.ts, they're unreachable
- No
dist/hooks/prerun.jsordist/hooks/postrun.jsfiles are created ❌ - oclif will fail when trying to load these hooks at runtime
Fix Options
- Keep the glob pattern:
entryPoints: ["./src/**/*.ts"] - Add explicit entry points:
entryPoints: ["./src/index.ts", "./src/hooks/prerun.ts", "./src/hooks/postrun.ts"] - Import/export the hooks in index.ts (not recommended - they're meant to be separate files per oclif convention)
There was a problem hiding this comment.
(Ref Line 56) 🐛 Bug: The configuration uses sourcemap: true, which generates inline sourcemaps embedded directly in the .js files rather than separate .map files. This means the !/dist/**/*.map exclusion in package.json has no effect, and sourcemaps are shipped to npm users inside the bundles, directly contradicting the PR's goal of reducing bundle size by ~55%. An earlier commit noted that disabling sourcemaps saved 35,752 KB.
Suggestion:
| sourcemap: 'external', |
This will generate separate .map files that can be uploaded to Observe while being excluded from the npm package via the existing !/dist/**/*.map pattern.
WHY are these changes introduced?
The CLI bundle is larger than necessary.
WHAT is this pull request doing?
Reduces CLI bundle size by ~55% (62 MB → 28 MB)
minifyWhitespaceandminifyIdentifiersin esbuild (previously onlyminifySyntaxwas on)!/dist/**/*.mapinfiles(maps are still generated for Observe)brotliJS package with nativezlib.brotliCompressSync['./src/index.ts']instead of globbing all.tsfilesHow to test your changes?
pnpm bundle-for-releaseand checkdistfoldernpm i -g --@shopify:registry=https://registry.npmjs.org @0.0.0-snapshot-20260318104923shopify app deploy(exercises brotli compression)Measuring impact
How do we know this change was effective? Please choose one:
Checklist