-
-
Notifications
You must be signed in to change notification settings - Fork 746
refactor!: lazy compilation middleware supports multiCompiler and use config from compiler instance #9828
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ Deploy Preview for rspack ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
CodSpeed Performance ReportMerging #9828 will not alter performanceComparing 🎉 Hooray!
|
241fc39 to
578a468
Compare
|
@JSerFeng Can we fix the CI and get this PR merged? ❤️ |
0d9ba83 to
612de05
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for passing a MultiCompiler to the lazy compilation middleware, enabling per-compiler lazy compilation configurations and introducing new hooks in MultiCompiler.
- Updated middleware to handle both Compiler and MultiCompiler instances.
- Added new hooks (beforeCompile, shutdown) and corresponding API updates.
- Enhanced tests to cover multiCompiler lazy compilation scenarios.
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/rspack/src/builtin-plugin/lazy-compilation/middleware.ts | Updated middleware to accept MultiCompiler and process each compiler. |
| packages/rspack/src/MultiWatching.ts | Introduced invalidateWithChangesAndRemovals for multi watching. |
| packages/rspack/src/MultiCompiler.ts | Added new hooks and watching property to MultiCompiler. |
| packages/rspack/etc/core.api.md | Updated API definitions to reflect new MultiCompiler support. |
| packages/rspack-test-tools/tests/legacy-test/MultiCompiler.test.js | Added tests for multi-compiler lazy compilation. |
| packages/rspack-test-tools/src/plugin/lazy-compilation-test-plugin.ts | Modified plugin to support MultiCompiler parameter. |
| packages/rspack-cli/src/commands/serve.ts | Modified serve command to use lazy compilation middleware with MultiCompiler. |
| Others | Minor updates to test fixtures and API documentation. |
6dc6454 to
8304647
Compare
packages/rspack/src/builtin-plugin/lazy-compilation/middleware.ts
Outdated
Show resolved
Hide resolved
5ff046f to
ade0661
Compare
ade0661 to
2b855c7
Compare
Summary
Lazy compilation middleware can receive multiCompiler as parameter
When there is a module triggers update, we notify the multiWatching, then multiWatching will invalidate its sub watching.
Every compiler can has its own lazy-compilation config, for example you can make compiler_1 only lazy compiles entries, while compiler_2 only lazy compiles imports
Checklist