3 ms·
That contradicts my experience and what I just described. In my experience, sites do feel instant even if they load dozens of scripts.
by TekMol 5y ago
That contradicts my experience and what I just described. In my experience, sites do feel instant even if they load dozens of scripts.
- dmitriid 5y agoThere will definitely be an inflection point, and it's very dependent on many factors: number and size of scripts, how much of the initial content is SSRed, network bandwidth and latency etc.
- _old_dude_ 5y agoBrowsers are good at caching JavaScript files, so it depends if the scripts are already cached or not.
- setr 5y agoIf your dozens of scripts are top-level (on the html itself) then you can fetch all of them in parallel — so you wait your connection speed roughly twice (roundtripped). If they’re nested dependencies (where you don’t identify the next necessary js until you have the first one in hand), the dependency won’t start getting fetched until the predecessor is retrieved. So you wait your connection speed multiplied by depth (x2; roundtripped) The goal of the bundler is to take the second scenario and turn it into the first scenario.
- eknkc 5y agoIf they are not waterfalling then yeah. But when a depends on b and b depends on c you will be fetching those serially. The bundler will have those preprocessed and bundled together.