What confuses me though is how much space these libraries take.
321kb for a router? 3.4mb for material ui? 1mb for jquery?
What confuses me though is how much space these libraries take.
321kb for a router? 3.4mb for material ui? 1mb for jquery?
How've you found the experience so far? IME, making good components that handle everything you'd expect (keyboard shortcuts, a11y, responsiveness, various CSS contexts) is more complicated than you'd expect, so the codebase gets filled with half-assed and duplicated components that don't work that well. Do headless components (never used them) help that significantly?
I was under the impression that production builds often include tree-shaking/dead-code-elimination as one of the steps?
This is a decent article that discusses the basic strategies:
https://www.smashingmagazine.com/2021/05/tree-shaking-refere...
But basically tree shaking and dead code elimination can only be effective as the code you write. If you make it hard to parse with ASTs, it's going to hard to tree shake.
the bundle size of my Nuxt 3 app + server is only 1.2mb and bundled node_modules for the server are 9.6mb, while my dev node_modules are about 100mb
probably because Vue tools handle tree-shaking incredibly well
Tree shaking is a big win for bundle size. One of my big takeaways from looking at these visualizations is that we badly need an equivalent for type declaration files.