-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More bundler features #1410
base: master
Are you sure you want to change the base?
More bundler features #1410
Conversation
naugtur
commented
Dec 16, 2022
•
edited
Loading
edited
- json support
- reduce unnecessary output
- cycles
afbeafc
to
02d1c87
Compare
@@ -38,7 +38,8 @@ | |||
"lint:js": "eslint .", | |||
"lint:types": "tsc -p jsconfig.json", | |||
"prettier-fixtures": "prettier --write --with-node-modules './test/fixtures-*/**/*.*js'", | |||
"test": "ava" | |||
"test": "ava", | |||
"dev:livebundle": "mkdir -p dist && nodemon scripts/bundle-live-test.js --ignore dist/bu.js" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
example bundle is no longer being committed, but I kinda regret that. It'd show what changed in the PR really well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
snapshot tests!
const { | ||
imports = [], | ||
reexports = [], | ||
} = /** @type {PrecompiledStaticModuleInterface} */ (record); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prettier did this 🤷
const cells = makeCells( | ||
${JSON.stringify([...modules.map(m => m.bundlerKit.getCells())], null, 2)}, | ||
/* export * from */ | ||
${JSON.stringify(modules.flatMap(m => m.bundlerKit.reexportedCells || []))} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makeCells is much less verbose than what we used to have here. Estimated over 50% less text after minification.
first stringify is pretty for us, whitespace will get minified away, but debugging bundles should be easier.
02d1c87
to
66a70dc
Compare
]; | ||
|
||
// If you're looking at this test hoping to modify it to see bundling results, | ||
// run `yarn dev:livebundle` instead |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note to self 😅
Co-authored-by: naugtur <[email protected]> Co-authered-by: kumavis <[email protected]>
66a70dc
to
b054d66
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
neato
|
I saw you added turning off sourceUrl. For better privacy and opsec it'd be wise to provide sourceUrl relative to project root always. That would require a change to linker to propagate the path to starting location into all subsequent passes of the recursion and ultimately to the parser. I feel like we're gonna need to talk about it. But not having my homedir path in a bundle or an archive sounds nice. |
In Endo archives, we found |
Rebuilt e2e testing with snapshot of all results as a result of tests. Added bundling in there. endojs/endo-e2e-tests#7 At this point it shows a vast improvement in what bundler can bundle (locally. there's still some setup isses in CI with missing dependencies) Click to see details
|