Code splitting
Code splitting divides application code into separately loadable bundles or chunks, allowing portions to be delivered independently.
Fast by Default
A software delivery technique that divides program code into separately loadable chunks so that only necessary code is initially delivered.
- How it is used
- Reduces initial JavaScript delivery by loading feature and route code only when users need it.
- How deep it goes
- Explains bundle allocation through startup and feature examples, then ties decisions to compressed-byte and request-count budgets.
- Examples
- Uses on-demand routes and translations, article comments, social-media features, and a compose-only emoji picker.
- What you can do after
- Apply it through bundle budgets and conditional loading decisions for routes, libraries, and feature-specific code.
Acing the Frontend Interview
Code splitting divides an application’s deployable code into separately loadable bundles or chunks.
- How it is used
- Optimizes large React applications by deferring route and feature code until users need it.
- How deep it goes
- Connects dynamic imports to React.lazy, Suspense, route segmentation, and scalable team ownership without detailing bundler internals.
- Examples
- Demonstrates checkout, profile, and product routes loaded through React.lazy and a shared Suspense fallback.
- What you can do after
- Apply it via dynamic import(), React.lazy, Suspense, and route-level feature boundaries.
Read how Acing the Frontend Interview explains code splitting →
React Hooks in Action: With Suspense and Concurrent Mode
Code splitting is a technique that divides an application's code into separately loadable bundles.
- How it is used
- Reduces initial browser loading by deferring infrequently used routes and components until user interaction requires them.
- How deep it goes
- Explains dynamic imports, lazy components, Suspense fallbacks, and route splitting; defers detailed error fallback handling.
- Examples
- Uses a bookings app with split page routes and nested Bookables view, edit, and new-form components.
- What you can do after
- Apply it via React.lazy, dynamic import, Suspense, and route boundaries to load UI progressively with fallback content.
Read how React Hooks in Action: With Suspense and Concurrent Mode explains code splitting →
Secrets of the JavaScript Ninja, Third Edition
A build technique that divides application code into separate output chunks, often so they can be loaded independently.
- How it is used
- Balances initial JavaScript downloads, page navigation, and cache reuse when building web applications.
- How deep it goes
- Explains chunking tradeoffs and preload options, but defers bundler-specific configuration.
- Examples
- Compares one bundle, per-page bundles, and shared-plus-page chunks across a ten-page site.
- What you can do after
- Apply code splitting through bundler configuration and combine manual chunking with prefetching to tune the site experience.
Read how Secrets of the JavaScript Ninja, Third Edition explains code splitting →
Also covered in
- React in Depth
- Web Component Development with Modern Libraries and ToolingIn early access (MEAP)
What to know first
- bundlingBundling is the process of combining related modules, dependencies, or assets into one or more packaged units for delivery, loading, or execution.
- cachingCaching is the temporary storage of data or computed results for reuse, reducing the work or delay of retrieving or computing them again.
Related concepts
- data chunkproduces · A data chunk is a discrete segment of data treated as a unit during processing, retrieval, or transmission.
- dynamic importproduced by · Dynamic import is a language feature that asynchronously loads a module at runtime and returns a promise for its module namespace.
- lazyuses · React.lazy is a React API for defining a component whose code is loaded asynchronously when needed.
- bundle sizeaddresses · Bundle size is the amount of compiled code and associated assets packaged for delivery to a client or runtime.
- lazy initializationuses · Lazy initialization is a technique that postpones creating, retrieving, computing, or loading a value or resource until it is needed.
- Viteused by · Vite is a frontend development tool that provides a development server and production build pipeline for modern web applications.
Questions about code splitting
What is code splitting?
Code splitting divides application code into separately loadable bundles or chunks, allowing portions to be delivered independently.
Which Manning books explain code splitting?
Fast by Default, Acing the Frontend Interview, React Hooks in Action: With Suspense and Concurrent Mode and Secrets of the JavaScript Ninja, Third Edition.
What should I know before learning code splitting?
Manning books that teach code splitting usually introduce bundling and caching first.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.



