Skip to content

Conversation

@stormslowly
Copy link
Contributor

@stormslowly stormslowly commented Dec 11, 2025

Summary

Enable LazyCompilation for dynamic imports by default.

know issue

Currently lazyCompilation with entries: true not working properly with module federation. So disable entries sub feature by default.

An anther case dynamic removed entry is also traced in issue.

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@netlify
Copy link

netlify bot commented Dec 11, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit 35f689f
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/6940d48e6602b40008a9760f

@github-actions github-actions bot added release: feature release: feature related release(mr only) team The issue/pr is created by the member of Rspack. labels Dec 11, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Dec 11, 2025

Rsdoctor Bundle Diff Analysis

Found 5 project(s) in monorepo.

📁 react-10k

Path: ../build-tools-performance/cases/react-10k/dist/rsdoctor-data.json

📌 Baseline Commit: a713d9fdb0 | PR: #12457

Metric Current Baseline Change
📊 Total Size 5.7 MB 5.7 MB 0 B (0.0%)
📄 JavaScript 5.7 MB 5.7 MB 0 B (0.0%)
🎨 CSS 21.0 B 21.0 B 0 B (0.0%)
🌐 HTML 0 B 0 B N/A
📁 Other Assets 0 B 0 B N/A

📦 Download Diff Report: react-10k Bundle Diff

📁 react-1k

Path: ../build-tools-performance/cases/react-1k/dist/rsdoctor-data.json

📌 Baseline Commit: a713d9fdb0 | PR: #12457

Metric Current Baseline Change
📊 Total Size 823.6 KB 823.6 KB 0 B (0.0%)
📄 JavaScript 823.6 KB 823.6 KB 0 B (0.0%)
🎨 CSS 0 B 0 B N/A
🌐 HTML 0 B 0 B N/A
📁 Other Assets 0 B 0 B N/A

📦 Download Diff Report: react-1k Bundle Diff

📁 react-5k

Path: ../build-tools-performance/cases/react-5k/dist/rsdoctor-data.json

📌 Baseline Commit: a713d9fdb0 | PR: #12457

Metric Current Baseline Change
📊 Total Size 2.7 MB 2.7 MB 0 B (0.0%)
📄 JavaScript 2.7 MB 2.7 MB 0 B (0.0%)
🎨 CSS 21.0 B 21.0 B 0 B (0.0%)
🌐 HTML 0 B 0 B N/A
📁 Other Assets 0 B 0 B N/A

📦 Download Diff Report: react-5k Bundle Diff

📁 rome

Path: ../build-tools-performance/cases/rome/dist/rsdoctor-data.json

📌 Baseline Commit: a713d9fdb0 | PR: #12457

Metric Current Baseline Change
📊 Total Size 984.3 KB 984.3 KB 0 B (0.0%)
📄 JavaScript 984.3 KB 984.3 KB 0 B (0.0%)
🎨 CSS 0 B 0 B N/A
🌐 HTML 0 B 0 B N/A
📁 Other Assets 0 B 0 B N/A

📦 Download Diff Report: rome Bundle Diff

📁 ui-components

Path: ../build-tools-performance/cases/ui-components/dist/rsdoctor-data.json

📌 Baseline Commit: a713d9fdb0 | PR: #12457

Metric Current Baseline Change
📊 Total Size 2.1 MB 2.1 MB 0 B (0.0%)
📄 JavaScript 2.0 MB 2.0 MB 0 B (0.0%)
🎨 CSS 83.0 KB 83.0 KB 0 B (0.0%)
🌐 HTML 0 B 0 B N/A
📁 Other Assets 0 B 0 B N/A

📦 Download Diff Report: ui-components Bundle Diff

Generated by Rsdoctor GitHub Action

@github-actions
Copy link
Contributor

github-actions bot commented Dec 11, 2025

📦 Binary Size-limit

Comparing 35f689f to refactor: remove unused code and methods (#12451) by harpsealjs

🙈 Size remains the same at 48.19MB

@codspeed-hq
Copy link

codspeed-hq bot commented Dec 11, 2025

CodSpeed Performance Report

Merging #12419 will not alter performance

Comparing chore/default_lazy_compilation (35f689f) with main (a713d9f)

Summary

✅ 17 untouched

@stormslowly stormslowly force-pushed the chore/default_lazy_compilation branch 4 times, most recently from bd90f13 to 3aa7d0e Compare December 13, 2025 07:31
@stormslowly stormslowly force-pushed the chore/default_lazy_compilation branch from 3aa7d0e to 2c28bcf Compare December 13, 2025 08:03
@stormslowly stormslowly marked this pull request as ready for review December 15, 2025 08:39
Copilot AI review requested due to automatic review settings December 15, 2025 08:39
@chenjiahan chenjiahan changed the title feat: default enable lazy compilation feat: enable lazy compilation for imports by defaults Dec 15, 2025
Copy link
Contributor

Copilot AI left a 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 lazyCompilation from false to { 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() and toHaveClass() 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.

chenjiahan
chenjiahan previously approved these changes Dec 16, 2025
@chenjiahan chenjiahan merged commit 919d595 into main Dec 16, 2025
52 checks passed
@chenjiahan chenjiahan deleted the chore/default_lazy_compilation branch December 16, 2025 04:38
@CPunisher CPunisher mentioned this pull request Dec 17, 2025
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release: feature release: feature related release(mr only) team The issue/pr is created by the member of Rspack.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants