refactor(loader): schedule loader chains as execution units - #15219
Draft
intellild wants to merge 9 commits into
Draft
refactor(loader): schedule loader chains as execution units#15219intellild wants to merge 9 commits into
intellild wants to merge 9 commits into
Conversation
Contributor
📦 Binary Size-limit
❌ Size increased by 8.00KB from 68.26MB to 68.27MB (⬆️0.01%) |
Contributor
Rsdoctor Bundle Diff AnalysisFound 5 projects in monorepo, 0 projects with changes. 📊 Quick Summary
Generated by Rsdoctor GitHub Action |
intellild
force-pushed
the
codex/loader-chain
branch
from
August 17, 2026 06:38
cd6c776 to
e34d114
Compare
Contributor
Merging this PR will not alter performance
Comparing Footnotes
|
This was referenced Aug 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Loaders<Context>the single owner of raw loaders, loader items, and execution chainsLoaders::run_loadersArcComputedto project lazy items/chains directly fromArc<Loaders>This reduces repeated Rust ↔ JavaScript scheduling boundaries and avoids rebuilding loader items for every module build.
For example, a chain like
js-a -> js-b -> builtin:swc-loader -> js-cis planned as[js-a, js-b],[builtin:swc-loader], and[js-c]. The first two JavaScript loaders execute in one JavaScript scheduling unit, while the native loader stays on the Rust side. When a parallel worker runs that first span, options outside[js-a, js-b]are excluded from structured cloning.Implementation flow
Loadersand the otherArcComputedowner,ResolvedModuleOptions, carryPhantomPinned. Loader-chain ranges remain compactu8values, with a debug assertion protecting the internal maximum-loader-count invariant.Validation
cargo fmt --all --checkcargo check -p rspack_loader_runner -p rspack_core -p rspack_binding_api --all-targets --lockedcargo test -p rspack_loader_runner --locked(10 passed)./node_modules/.bin/tsc --noEmit --pretty false -p packages/rspack/tsconfig.jsonpnpm run build:jsRelated links
N/A
Checklist
by OpenAI Codex