5 ms·
Yes good luck shipping that main.rs to a web browser. The problem that Webpack solves is performance optimization in addition to what Rust offers: - writing i
by anuila 6y ago
Yes good luck shipping that main.rs to a web browser.
The problem that Webpack solves is performance optimization in addition to what Rust offers:
- writing in a higher-level language: "write modern code and ship to IE 5" is the same as "write in Rust and ship to x64"
- take a bunch of files and make 1 or 2 out of it.
Nobody stops you from loading jQuery and 3 plugins in a script tag and call it a day. Webpack exists because jQuery and 3 plugins can't deliver the same results nowadays.
Also, do you want to improve your code with types and linting? Do that without Webpack, it's not going to be much more efficient.
---
In short, Webpack and Babel basically match the Rust compiler in functionality. If you don't use them, your web app’s code will be harder to manage, not easier. That's all.
- andy_ppp 6y agoHave you ever seen a 3000 line webpack config file. I think the analogy between webpack and rust is nonsense to be honest. They are doing different things, I just bit on the previous question. Maybe you can justify the complexity in JS projects but I find it excessive.
- kvz 6y agoIf you replace Webpack with Parcel, the argument holds up. Webpack just offers more bells and whistles, which in our case we need to wrestle legacy projects into modern build pipelines. For a new project, maybe you don’t need all that, and you also don’t need Webpack with 3000 config lines. And fwiw, with every major, Webpack has moved to more sensible defaults for modern web bundling, meaning if you stick with it for a new project, likely you only need 5 config lines