3 ms·
This seems like a very promising idea, especially since every site nowadays loads 12 scripts that were copy/pasted from eight different sources by six different
by outoftacos 9y ago
This seems like a very promising idea, especially since every site nowadays loads 12 scripts that were copy/pasted from eight different sources by six different developers all over the page, and each one just blocks everything no matter how fast your network or client is.
I mean, that's if you're lucky and the development team was relatively competent.
- ralmidani 9y agoBuild systems really help reduce the number of scripts (and stylesheets) loaded. I currently use Ember-CLI, and it's just a "vendor" script containing all your third-party scripts and another with your app-specific code. The old-fashioned way of embedding scripts directly is really wasteful, I agree.
- jerf 9y agoYou need to spend some time browsing the web with your debugger opened to the "net" tab. It is, alas, not the "old" way.
- ralmidani 9y agoEdited to say "old-fashioned" rather than "old".
- thephyber 9y agoI think you vastly underestimate how wasteful 3rd party JS API implementations work. Especially for advertising, analytics, and other injected widgets. Build systems exist, but that doesn't mean they are used everywhere or that all features can be integrated into them. The same goes for static analysis tools, dynamic analysis tools, perf optimization tools, security vulnerability testing tools, unit testing, automated integration testing, etc. -- they exist, but their coverage is far less than 100%.
- ralmidani 9y agoI understand build systems cannot solve every problem, and the mechanism described in the article is certainly useful. I was merely responding to the concern about third-party scripts with links copied-and-pasted mindlessly, and which would be better handled using a build system.
- outoftacos 9y agoSure, but adding GA to a page is what I meant by copy/paste, this still happens everywhere outside of the build process. Then of course marketing needs to add 10 other things and they can't figure out whatever hip new build tool someone set up and then suddenly things get really messy. Yes this happened even at whatever company you think is a paragon of engineering best practices and modern development.
- seanwilson 9y agoHTTP2 greatly reduces the cost of requests though so what you really want is tree shaking to get rid of code you don't use and minification to reduce its size.
- antigirl 9y agoIts not different developers but different services. Developers are competent. Its the product owners that are to blame. For example a hotel website, will have one minified concatenated script file, but then on top there might be other services, for example client side A/B testing. Which cant even be defer loaded and usually comes first! Sometimes analytics would come separate etc Other services show things like 'x number of people viewing the booking' etc etc (BTW i don't see how you can have separate files, using modules or require etc would prove difficult to have split files, rather than one)