11 ms·
People get really hung up on page weight. It's nice when an app loads fast with a cold cache, but if it's something that you load once and then keep open, or it
by onion2k 2y ago
People get really hung up on page weight. It's nice when an app loads fast with a cold cache, but if it's something that you load once and then keep open, or it's something that's easily cached for a long time after the first visit, page weight is much less of a worry for most users.
Code complexity is more of an issue in apps like this one. I'd guess that a WASM binary of a Go app is going to cause the JS engine to be busy a lot more than a typical JS app, which will increase CPU usage a lot, and eat into the user's battery life. That is a guess on my part though. Maybe WASM optimizes that?
- Muromec 2y agoThe problem with wasm is also not having a straightforward way to load the thing in chunks. I think the right way to do it for frontend is running small isolated apps that communicate with each other through channels or actor model or what not.
- pier25 2y agoI believe Blazor can load chunks of WASM. Open the network tab on this Blazor app (not mine). https://stalcrafthq.com/ https://stalcrafthq.com/ (you need to delete the app data in the Application tab of Chrome for the WASM files to reload)
- Muromec 2y agoYou certainly can have multiple wasm apps on the same page and you can also implement you own runtime linker. It's just not the wasm thing. I don't know which one blazer is doing because I won't sit there and reverse engineer it npw.
- pier25 2y agoI'm not arguing about page weight per se. The more code you have to download, parse, and run, the more CPU and memory and battery you'll be using. WASM enables certain use cases like using FFMPEG in the a browser or game engines running on canvas which are super cool. But for 99.99% of DOM related functionality, JS is really the way to go. Edit: Here's another example. Loads and executes like 10MB of WASM code for something that could be done in 100kB of JavaScript. https://stalcrafthq.com/ https://stalcrafthq.com/
- TehGM 2y agoAuthor of ScHQ here. I want to explain the Blazor use here. While I think it's a bit of a stretch to say it'd be 100kB JS (the app does a LOT of client-side lifting, so it'd definitely take more than that), otherwise you're right - WASM, specifically Blazor, is heavy. It's a bunch of download and non-ideal start time. The reason I use Blazor here is that I work on this website alone, as a hobby project. This means I prefer to use tech (C# and .NET) I like to use instead of going lenghts learning additional frameworks. It also enables server and client share same code in places, so it can be used both in client and on server without having to program it twice. The website wouldn't be even nearly as feature rich if I had made it in JS. The point I am making - I'd not advise Blazor use for every app, and if you already are familiar with JS frameworks, they're a good (or even better) choice. However WASM and Blazor has niches outside of "I do super fancy stuff" websites. It makes rich website development possible for backend devs and other people familiar with other technologies. It's good to think outside of the box sometimes.
- neonsunset 2y agoInterestingly enough, it loads just 1.15 MB compressed with the biggest assets being logos on Firefox. At the same time, I can see it downloading far more assets (as if, unpacked and uncompressed blazor bundle?) on Edge/Chromium. What's going on?
- TehGM 2y agoMake sure you open the page in incognito/private window.