Skip to content

Comment on Tiny Treeshaker: JavaScript tree shaking in 200 lines of codeparent

Comments

Your condescending responses are infuriating. Of course I have used terser, and before it uglifyJs, and am familiar with all the intricacies of mangling, compression, and other minifying techniques. I've also maintained many bundler configurations across different bundler solutions.

I'm not looking for a mentor to explain the basics of bundler technologies or asset compression. I'm asking if HTTP/2 reduces the advantages of these techniques to the inflection point where the complexity of using bundlers is no longer worth the squeeze.

"more bundle bytes means more optimal compression" - this alludes to a single bundled file taking better advantage of the compression dictionary than many small files, who can't share dictionaries when compressed.

"shaking out functions within a module" - this is another form of tree shaking as opposed to file-based tree shaking (import dependency analysis). Unbundling could compete with the file-based case, but not with a deeper analysis of unused functions _within_ files.

These were the remaining advantages I could think of, I'm sure there's more. It sounds like you think bundling is still the way to go, and I probably agree, but it doesn't make any less interesting a discussion about its remaining merits and if we can iterate to close the gap. Bundlers, minifiers, sourcemaps, are all complicated build tools that require a hand on the wheel to maintain in the long term. We should not settle for them as defacto js ecosystem techniques.

Your condescending responses are infuriating

Sorry for that, for my excuse it was not my intention.

Bundlers, minifiers, sourcemaps, are all complicated build tools that require a hand on the wheel to maintain in the long term.

It just shows how bad is design of JS and web. But there are tools that do it nearly all with just one command, check "rollup" or my recently favorite "esbuild" (if you didn't before)

We should not settle for them as defacto js ecosystem techniques.

I think it's done, it's settled, as JS itself, and if we like it or not, we have to live with it. :-)

Still hoping that one day will come real web 2.0 and HTML, CSS, HTTP, JS and even webassembly will be taken as "lessons learnt", thrown away and replaced with something way more logical, structured and extendable

;-)

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.