Message from JavaScript discussions

October 2020

— Ecommerce

— 

So the good news is, your users are probably tech-savvier by using an online platform to buy stuff, so they are likely using ever-green browsers (edge, chrome, ff, ...) and you can use type=module for scripts.
The bad news is, that your boss is probably a greedy ass and wants every single user to be able to connect to the website to not let a penny slip through 👀

— Okay, sorry I was occupied with something else. I am now rewriting the stuff from the legacy system to dynamically add all the scripts up on some event. Problem is the order in which they are executed matters, so I am only loading the next script when the previous one is resolved with Promise and script.onload, but know I lose all the benefits of http2 and parallel fetching. Is there a quick and easy way to use Promise.all() for the scripts but execute them in order?

Message permanent page

— Prefetch

— Https://developer.mozilla.org/en-US/docs/Web/HTTP/Link_prefetching_FAQ

— Actually preload*

— Https://developer.mozilla.org/en-US/docs/Web/HTML/Preloading_content

— I have a lot of dynamically added js files, I dont know how prefetching should solve that, in addition to that it doesnt work in firefox

Message permanent page

— This is what you want

— Sure it does

— Well it'll work for the static ones

— Ah, preload doesnt work in firefox