3 ms·
"More JS" vs "Less JS" is oversimplified - what are we building here? - A web app that exists as a tool users log into? This kind of thing would have used to b
by headcanon 8y ago
"More JS" vs "Less JS" is oversimplified - what are we building here?
- A web app that exists as a tool users log into? This kind of thing would have used to be a desktop app. I'm perfectly fine with a 1-2MB JS bundle. The images and other data you're downloading will soon be much greater than that size. App too big? split it up into modules. Targeting users with 3G or worse connections? Ok, lets look at server-side rendering with a simplified experience. I don't think apps like this are really the problem here. If it is a powerful app I don't mind waiting 5-10 seconds for everything to load, so long as there is a good user experience around loading. These are the kind of apps I build in React and they load fast and feel fast, even on cell connections. Our speed issues and optimizations are generally elsewhere, usually on server-side data fetching. Granted I haven't worked anywhere that has users with flip phones in far-off countries. I would probably choose a different strategy in that case.
- A media-heavy web site that displays content for non-authenticated users? These have tons and tons of tracking JS and other things, not to mention the hated auto-play videos and intrusive ads - I think thats the "CO2" that the author is talking about, but the issue is mostly organizational and economical - these companies are made up of large numbers of people who all need "just one more script", or are getting paid to insert garbage into their page. This is a shame and we can complain about it all we want to but until the economics behind web content improve I don't see that underlying issue getting fixed. This is the problem that AMP is trying to solve. I agree that it shouldn't be proprietary, but you can't expect everyone at a media company to think like an engineer and prioritize site load time over the big bucks in analytics and internet chum, unless it gets too bad. Companies will do what they can get away with, whether its CO2 or JS.