4 ms·
A 10 million line javascript file must take a heck of a long time to load in the browser :).
by vvanders 9y ago
A 10 million line javascript file must take a heck of a long time to load in the browser :).
- yawaramin 9y agoModern JavaScript is developed in separate modules (i.e. files).
- mort96 9y agoDeveloped, yes, but in general, your build system bundles it all up into one javascript file which is sent to the browser. Even if you don't bundle the javascript, all the code has to be sent to the browser anyways, just over multiple HTTP requests instead of one.
- yawaramin 9y agoRight, but there can be many bundles for complex sites like Facebook. They can have a bundle for Messenger.com since it's a SPA, another for the FB home page, others for object pages, search pages, etc. etc....
- Can_Not 9y agoExcept for small or basic apps, your build system is not suppose to build to only one file. It's suppose to build to a main file and separated module files. The module loader will pull in modules only when needed.
- dmix 9y agoGoogle seems to be testing this theory with their adwords management web app :p