5 ms·
- Transpilers: sometimes you need to support old browser versions but want to use newer features - Typescript: one but lesson we’ve learnt over the years is th
by e63f67dd-065b 4y ago
- Transpilers: sometimes you need to support old browser versions but want to use newer features
- Typescript: one but lesson we’ve learnt over the years is that vanilla JS sucks and when your codebase grows into the >10k loc range it becomes a nightmare without engineering and tools like the typescript compiler
- minification: minify your JS, HTML, and CSS
- state synchronisation: a big problem with the jquery days was desync, modern web frameworks make it very easy for state and ui to stay in sync
- one codebase for web, electron (desktop), mobile (react native). Whether this is a good or bad thing is left as an exercise to the reader
- lots more I’m forgetting. For better or for worse, that’s the modern JS toolchain, plain HTML with some JS sprinkled on top just doesn’t cut it for modern webapps anymore
- torstenvl 4y agoI don't follow. Which older browsers? If they're new enough to support WASM, but this development method is so brittle that they already need transpiling to support them, that's a red flag. On the other hand, if you're talking about pre-WASM browsers, I don't understand how Rust + WASM is going to help support them.
- e63f67dd-065b 4y agoSorry, I was just responding to your question on JS compilation and webpack. This post is obviously overengineering things, it’s literally submitting a html form and obviously we can do that with plain old html. The point, however, is that it’s a small scale demonstration of how to run rust on the web, not that you should make phishing websites out of rust and wasm. Are there actual use cases for wasm? Yes, particularly for performance critical applications. Games, ML, etc, there’s already a lot of wasm deployed today. Since wasm is here to stay, the natural follow-up question is can we compile to it so I can use <insert favourite language> on the web, and that’s the motivation behind stuff like rust/wasm. NodeJS made it possible to run JS on both front and backend, but nobody actually wants to write JS. So now people are trying to run <favourite nonJS language> on both instead. It’s still in its infancy, so really not recommended for anything other than prototyping and fun exploration, but there’s potential here.
- torstenvl 4y agoThanks! That's really helpful.