Re:Conditional JavaScript: Only download when it is appropriate
by madeofpalk on Friday December 18, 2020 @07:49AM
(#25466549)
This isnt being fancy, this is just being.... not smart (to put it charitably).
Re:Conditional JavaScript: Only download when it is appropriate
by ASalazarMX on Friday December 18, 2020 @02:29PM
(#25470904)
I'd say being messy. People just want to get things done, and when they're done in a messy way, they don't want to start over. It depends on their deadlines and how much are they being compensated for doing it the right way(TM).
After inspecting I saw over 100 .js files were being requested by require.js, but because each module required yet another set of .js files and those files required another set, and so on. The server was serving them up plenty fast (<50ms) but because they were being loaded in waves the load time ended up being between 5 and 7 seconds.
Many of these issues arise from being fancy and people tend to want to fix it with fancy stuff. But sometimes you need to stop being fancy and just fix the damn problem in an old fashioned way (concatenate, minify, allow local caching).