liveBook · Manning

Loading waterfall

As explained in Secrets of the JavaScript Ninja, Third Edition

A sequence of resource downloads in which each newly discovered dependency must be fetched before further dependencies can be requested.

A loading waterfall occurs when a browser must fetch a newly discovered dependency before it can discover and request that dependency’s own dependencies. Dependencies already known to the browser can be fetched in parallel; undiscovered ones require serial round trips. section 13.3.1

Bundling can reduce these delays. For a multi-page React single-page app, code splitting can keep shared code in one chunk and page-specific code in separate chunks, limiting initial downloads and later navigation downloads. section 13.3.1

How Secrets of the JavaScript Ninja, Third Edition covers it

How deep it goes
Traces serial fetching of undiscovered dependencies and contrasts it with parallel fetching of known dependencies.
Examples
Uses nested module dependencies and a ten-page React single-page app to illustrate fetching and bundling tradeoffs.
What you can do after
Evaluate bundling and code-splitting tradeoffs for initial downloads and page navigation.
How it connects
Connects loading waterfalls with JavaScript modules, ECMAScript modules, bundlers, and code splitting.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Secrets of the JavaScript Ninja, Third Edition. The section links point to the parts of the book it draws on.