Hacker News new | ask | show | jobs
by dns_snek 1153 days ago
> I have a feeling tons of projects blindly trust that tree-shaking their dependencies will "just work" even though for many libraries it won't!

Is there an easier way to verify this than, say, observing the final bundle size and looking inside the JS bundle? I'm not a frontend developer so this is outside my usual area of knowledge.

2 comments

I use source-map-explorer to see what's inside. Lighthouse Treemap provides a similar view.

[source-map-explorer]: https://github.com/danvk/source-map-explorer

[Lighthouse Treemap]: https://umaar.com/dev-tips/270-devtools-lighthouse-treemap/

i just write everything from scratch every time. (so don't take my advice)

I notice that if I lower the bar and allow half baked hackish solutions to slip in, beyond some point, upkeep consumes infinite time. There seems no way back from that besides starting from scratch.

There is no good reason for front end things to break. I can only think of document.writeln() but who in his right mind...