bundle
The files a build tool produces by combining an application's code and its libraries for the browser to download.
In more detail
Smaller bundles load faster. Design systems help by letting bundlers drop unused components (tree shaking) and by avoiding separate stylesheet builds for each theme.
Examples
In the browser: Bundling cuts the number of requests but can make users download code they do not need, so large apps split bundles by page or feature. Build tools create bundles and usually give them hashed file names.In Next.js only Client Components and their imports go into the client bundle; Server Components add nothing to it.Related terms
- bundler — A build tool, such as webpack, Rollup or Vite, that follows imports and combines modules into files a browser can load efficiently.
- tree shaking — Removing code that is exported but never imported from the final bundle, so less code is shipped.
- sideEffects — A package.json field that tells bundlers whether importing a file does anything besides defining exports.
- hashed file name — A file name that includes a hash of the file's contents, such as app.3f9a1c.js, so any change produces a new name.
- static asset — A file served exactly as stored, such as an image, stylesheet, font or script bundle, rather than generated for each request.
- Client Component — A component whose code is also sent to the browser so it can use state, effects and event handlers.
- hydration — The step where React in the browser attaches event handlers and state to HTML that was already rendered on the server.
- chunk — One piece of a larger piece of data delivered by a stream.
- code splitting — Dividing an app JavaScript into several files that load only when needed, instead of one big file up front.
- secret — Any value that grants access, such as a password, access token or private key, and must be kept out of code and version control.
- JavaScript — The programming language of web browsers, also widely used on servers through Node.js.
- type erasure — The removal of all TypeScript types when code is compiled, so none of them exist while the JavaScript runs.
Taught in
- CSS Custom Properties & Dynamic Theming Architecture — Design Systems & Component Engineering
- Component API Ergonomics: Composition vs Boolean Config Props — Design Systems & Component Engineering
- Component Packaging: Dual ESM/CJS Builds & Package Exports — Design Systems & Component Engineering
- Cache Storage API: Offline Strategies And Cache-First Patterns — Frontend Architecture & Web Platform
- CSRF Mitigations, SameSite Cookies And Subresource Integrity — Frontend Architecture & Web Platform
- App Router Architecture: Server-First Paradigms — Next.js 15 & Modern App Router Architecture
- Server Components: Async Execution & Constraints — Next.js 15 & Modern App Router Architecture
- Client Components: use client & Hydration Models — Next.js 15 & Modern App Router Architecture
- Component Tree Composition: Interleaving RSC & Client — Next.js 15 & Modern App Router Architecture
- Serialization Boundaries: Props & Server Guardrails — Next.js 15 & Modern App Router Architecture
- Not Found Handling: not-found.tsx & Programmatic Exits — Next.js 15 & Modern App Router Architecture
- Code-Splitting with React.lazy: Dynamic Imports And Chunks — React 19 & Modern Component Architecture
- Why Secrets Leak — Application Security & Threat Modeling for Engineers
- Why TypeScript: Contracts, Erased Types And Soundness — Production TypeScript
- The Compiler Pipeline: tsc, AST And Code Emission — Production TypeScript
- Why Generics: Functions, Identities And Type Variables — Production TypeScript
- ECMAScript Modules, CJS Interop And verbatimModuleSyntax — Production TypeScript
- Declaration Files, Ambient Namespaces And Module Augmentation — Production TypeScript