From the course: Developing for Web Performance

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

JavaScript bundling vs. modules

JavaScript bundling vs. modules

- At the very beginning of this course I talked about HTTP/2 and multiplexing, the ability of the browser to pull down many files at the same time rather than one file after the other. This new ability is challenging how we think about serving JavaScript to the browser. So bear with me here. As websites and applications started relying more and more on JavaScript and front-end frameworks like react. Developers ran into a significant performance issue with the old HTTP 1.1 protocol. Big JavaScript applications with a lot of different files and components, created major rendering roadblocks because the browser would stop rendering until all the files were downloaded and all those files came one after the other. To solve this problem, developers started bundling all of their JavaScript into one single file. With a single file, there was no issue with waiting for files to load or for files loading in the wrong order or…

Contents