Message from JavaScript discussions

October 2020

— Is there no other way?


There is no way with html only to make sure, that the first script is done executing (especially if it involves async loading of new content) before other scripts load

— No no no, no need to guess

— Cant I block loading and executing of static scripts with dynamically added scripts?

— Maybe what you want is module bundling



— You just have to dynamically add all then

— Exactly

— Fuck

— It is not a big issue. once you are done with the dynamic part, you can just document.appendChild('<script src="other-script.js">') (roughly)

Message permanent page

— And if you use type="module" you get free dynamic module loading.

— Only reason to use multiple script tags is if they are not related or code-splitted.