.agents/GLOSSARY.md
Terms and concepts used in Rspack codebase and documentation.
Tool that combines multiple JavaScript modules and dependencies into optimized bundles.
Single unit of code (typically JS/TS file) that can be imported/required by other modules.
Group of modules bundled together into a single output file. Types: entry chunks, async chunks, vendor chunks.
Starting point(s) of the application. Rspack builds the module graph from entry points.
Dependency graph structure tracking all modules and their dependencies in compilation.
Graph structure tracking relationships between chunks and which modules belong to which chunks.
Single build instance that processes modules, creates chunks, and generates output assets.
Main orchestrator managing compilation lifecycle, plugins, and configuration.
Process of transforming source code into optimized output files.
Phase where modules are built and dependency graph is constructed.
Phase where compilation is finalized and no more modules can be added.
Phase where output assets are written to the file system.
Regular JavaScript/TypeScript module parsed and processed normally.
Module created from dynamic require context (e.g., require.context('./dir', true, /\.js$/)).
Module not bundled but referenced externally (e.g., from CDN or global variable).
Multiple modules concatenated together for optimization (scope hoisting).
Module containing webpack runtime code for module loading and HMR.
Relationship between modules, representing an import, require, or other module reference.
Dependency on another module (e.g., import './module').
Dependency representing an entry point.
Dependency representing a require context.
Dependency on external module that won't be bundled.
Chunk generated from entry point. Can be initial (loaded immediately) or non-initial.
Chunk loaded asynchronously (e.g., via dynamic import or code splitting).
Chunk that must be loaded before entry point can execute.
Chunk containing webpack runtime code, can be separated for better caching.
Chunk containing third-party dependencies, often separated for caching.
Output file generated by compilation (JavaScript, CSS, images, etc.).
Content of an asset, represented as Source object that can be read and transformed.
Metadata about an asset (size, related assets, etc.).
Template string for generating output filenames with placeholders (e.g., [name].[hash].js).
JavaScript object or class extending Rspack's functionality by hooking into compilation lifecycle.
Point in compilation process where plugins can intercept and modify behavior.
Act of registering a callback function to a hook.
Execution model of a hook (sync/async, series/parallel, bail).
Core plugin provided by Rspack (e.g., JavaScript plugin, CSS plugin).
Function that transforms source code before it's added to the dependency graph.
Sequence of loaders applied to a module in reverse order.
Context object (this) provided to loaders with utilities and metadata.
Loader that executes in the "pitch" phase (before loader chain runs normally).
Process of removing unused code from bundle by analyzing import/export usage.
Process of splitting code into multiple chunks for better caching and loading performance.
Process of reducing code size by removing whitespace, shortening names, and optimizing code.
Optimization that concatenates modules into single scope to reduce function call overhead.
Removing code that is never executed (form of tree shaking).
Disk-based cache that persists across builds to speed up subsequent builds.
In-memory cache used during a single build.
Process of determining when cached data is no longer valid and needs regeneration.
Unique identifier for cached data, typically based on file content and configuration.
File system abstraction for reading source files.
File system abstraction for writing output files.
File system abstraction for temporary files during compilation.
File system abstraction for monitoring file changes in watch mode.
Feature allowing updating modules in browser without full page reload.
Mode where Rspack watches for file changes and automatically rebuilds.
Development server that serves built application and supports HMR.
File mapping transformed code back to original source code for debugging.
Optimized for fast builds and debugging, includes source maps and development tools.
Optimized for smaller bundle size and performance, includes minification and tree shaking.
Tree representation of syntactic structure of source code.
Stable API for building native Node.js addons, used for Rust-JavaScript interop.
Layer connecting Rust code to JavaScript/TypeScript, typically via NAPI.
Rust package/library (equivalent to npm package in JavaScript).
Repository containing multiple related packages or projects.
High-performance JavaScript bundler written in Rust.
Unified JavaScript toolchain centered on Rspack (includes Rspack, Rsbuild, Rslib, etc.).
Loader implemented natively in Rust for better performance (e.g., SWC loader, Lightning CSS loader).
Core plugin provided by Rspack, typically implemented in Rust.
Build analyzer tool for debugging and optimizing Rspack builds.
Testing framework for Rspack.
Linter for Rspack projects.
API or feature that works the same way as in webpack.
Plugin designed for webpack that may or may not work with Rspack.
Loader designed for webpack that may or may not work with Rspack.
Technique for sharing code between multiple applications at runtime.
Loading code only when needed, typically via dynamic imports.
Loading resources in advance before they're needed.
Loading critical resources early in page load process.