7 ms·
It’s not much of a problem once you have code splitting. React supports code splitting, which lets you split large amounts JS into separate production JS files
by winter_blue 7y ago
It’s not much of a problem once you have code splitting.
React supports code splitting, which lets you split large amounts JS into separate production JS files; load only what’s necessary at first, and load the rest as-needed: https://reactjs.org/docs/code-splitting.html https://reactjs.org/docs/code-splitting.html
With a new programming language (like Zig), I would hope that they eventually try to have code splitting be automatic and transparent.
For JS targets, you create multiple smaller final JS files instead of one giant JS file. For native targets, you could break out extra code into dynamically loaded .so or .dll files. The real challenge is making this whole process as painless and transparent as possible for the developer.
- flohofwoe 7y agoCompiled languages usually have dead-code-elimination (only code that's actually "reachable" is included)... I think the JS world invented the word "tree-shaking" for that. Not loading everything that's eventually needed at startup can be handled with loading WASM modules on demand (which can be handled the same way as loading DLLs in a native application). IMHO it's better to fight code bloat at the root, by picking a language without runtime, minimizing dependencies, and picking the right dependencies.