Minify: Thought: Module Inlining?

Created on 26 Aug 2016  Â·  5Comments  Â·  Source: babel/minify

This preset already seems to do a ton of what other toolchains offer in terms of DCE, mangling, etc. What about taking that last step and having it support merging a whole graph of ES Modules dependencies into a single closure? (Prior art here being perhaps Rollup)

enhancement

Most helpful comment

@developit - A good friend of mine just announced Interlock.js in a talk at Cascadia.js which does just that actually.

It's really interesting actually - it's a pluggable build tool that uses babel for processing the AST just like you're suggesting. Some of the more interesting parts of it are it's bundling system which is based on Git's hashing algorithm to create reproducible module ids which lets you share code chunks across builds. Anyway, just thought I'd share.

Edit: I just noticed that the website is acting weird so I changed the link above to the actual github and wanted to add a link here to the documentation

All 5 comments

Yep, we definitely want to explore some sort of global module/file -aware minification.

Also related to #62

@kangax sweet, I was hoping you guys would see the potentially huge value there. The runtime performance benefits of scope flattening are pretty awesome.

We're actually planning to do an experiment at Facebook to try flattening scopes and hoist-rename everything to the top level in hopes of gaining on parsing performance. We'll see how it goes.

Sent from my iPhone

On 25 Aug 2016, at 20:47, Jason Miller [email protected] wrote:

@kangax sweet, I was hoping you guys would see the potentially huge value there. The runtime performance benefits of scope flattening are pretty awesome.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

@developit - A good friend of mine just announced Interlock.js in a talk at Cascadia.js which does just that actually.

It's really interesting actually - it's a pluggable build tool that uses babel for processing the AST just like you're suggesting. Some of the more interesting parts of it are it's bundling system which is based on Git's hashing algorithm to create reproducible module ids which lets you share code chunks across builds. Anyway, just thought I'd share.

Edit: I just noticed that the website is acting weird so I changed the link above to the actual github and wanted to add a link here to the documentation

@baer I really enjoyed that video, thanks! Interesting ideas on bundling and HTTP/2.

Was this page helpful?
0 / 5 - 0 ratings