-
-
Notifications
You must be signed in to change notification settings - Fork 746
feat: enable lazy compilation for imports by defaults #12419
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 canceled.
|
Rsdoctor Bundle Diff AnalysisFound 5 project(s) in monorepo. 📁 react-10kPath:
📦 Download Diff Report: react-10k Bundle Diff 📁 react-1kPath:
📦 Download Diff Report: react-1k Bundle Diff 📁 react-5kPath:
📦 Download Diff Report: react-5k Bundle Diff 📁 romePath:
📦 Download Diff Report: rome Bundle Diff 📁 ui-componentsPath:
📦 Download Diff Report: ui-components Bundle Diff Generated by Rsdoctor GitHub Action |
📦 Binary Size-limit
🙈 Size remains the same at 48.19MB |
CodSpeed Performance ReportMerging #12419 will not alter performanceComparing Summary
|
bd90f13 to
3aa7d0e
Compare
3aa7d0e to
2c28bcf
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 enables lazy compilation by default in Rspack with the configuration { entries: false }, addressing known issues with entry-level lazy compilation in module federation and dynamic entry scenarios. The change includes updates to test configurations to explicitly disable lazy compilation where needed, and refactors test assertions to use Playwright's built-in matchers.
Key Changes
- Changed default
lazyCompilationfromfalseto{ entries: false }in the configuration defaults - Updated multiple test configurations to explicitly disable lazy compilation where it conflicts with test objectives
- Refactored E2E test assertions to use Playwright's
toHaveText()andtoHaveClass()matchers instead of manual DOM evaluation - Reduced E2E test timeout from 2 minutes to 1 minute
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/rspack/src/config/defaults.ts | Changed lazyCompilation default from false to { entries: false } to enable lazy compilation with entries disabled |
| tests/rspack-test/defaultsCases/default/base.js | Updated expected default configuration to match new lazyCompilation default |
| tests/rspack-test/multiCompilerCases/lazy-compilation.js | Added explicit lazyCompilation: false to first compiler config to maintain test isolation |
| tests/e2e/playwright.config.ts | Reduced TIMEOUT from 2 minutes to 1 minute |
| tests/e2e/cases/react/tailwindcss/index.test.ts | Refactored test assertions from manual getComputedStyle to Playwright's toHaveClass matcher |
| tests/e2e/cases/react/tailwindcss-with-css-extract/index.test.ts | Refactored test assertions from manual getComputedStyle to Playwright's toHaveClass matcher |
| tests/e2e/cases/make/remove-dynamic-entry/rspack.config.js | Added lazyCompilation: { entries: false } to address known issue with dynamic entry removal |
| tests/e2e/cases/make/remove-dynamic-entry/index.test.ts | Updated selectors from text-based to ID-based for more robust element targeting |
| tests/e2e/cases/make/remove-dynamic-entry-with-loader/rspack.config.js | Added lazyCompilation: false to disable lazy compilation for loader-based dynamic entry test |
| tests/e2e/cases/make/remove-dynamic-entry-with-loader/index.test.ts | Refactored assertions to use toHaveText and improved test structure with blank line |
| tests/e2e/cases/html/cross-origin-loading/rspack.config.js | Added lazyCompilation: false for concise asset assertions |
| tests/e2e/cases/hooks/asset-emitted/rspack.config.js | Added lazyCompilation: false to ensure deterministic asset emission for hook testing |
| tests/e2e/cases/hooks/asset-emitted/index.test.ts | Refactored assertion to use Playwright's toHaveText matcher |
| tests/e2e/cases/file/context-delete-file/index.test.ts | Refactored assertion to use Playwright's toHaveText matcher |
| tests/e2e/cases/css/import-empty-css-file/index.test.ts | Refactored assertion to use Playwright's toHaveText matcher |
| tests/e2e/cases/chunk/recover-error/index.test.ts | Updated expected chunk filename from AppIndex.js to src_AppIndex_jsx.js to match lazy compilation output naming |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: neverland <[email protected]>
…-dev/rspack into chore/default_lazy_compilation
Co-authored-by: neverland <[email protected]>
Co-authored-by: Copilot <[email protected]>
Summary
Enable LazyCompilation for dynamic imports by default.
know issue
Currently lazyCompilation with
entries: truenot working properly with module federation. So disableentriessub feature by default.An anther case dynamic removed entry is also traced in issue.
Checklist