Skip to content

Conversation

@chenjiahan
Copy link
Member

Summary

Since the lazyCompilation option was stabilized in Rspack 1.5, we can also stabilize lazyCompilationMiddleware to keep things consistent.

Related links

Checklist

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

Copilot AI review requested due to automatic review settings December 12, 2025 06:37
@netlify
Copy link

netlify bot commented Dec 12, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit 8a6674a
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/693be379b1d8b10008f4ea52

@github-actions github-actions bot added team The issue/pr is created by the member of Rspack. release: feature release: feature related release(mr only) labels Dec 12, 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 stabilizes the lazyCompilationMiddleware by promoting it from the experimental experiments namespace to the main Rspack API. This change aligns with the earlier stabilization of the lazyCompilation configuration option in Rspack 1.5.

Key Changes

  • Moved lazyCompilationMiddleware from rspack.experiments.lazyCompilationMiddleware to rspack.lazyCompilationMiddleware
  • Added deprecation marker to the old experiments location for backward compatibility
  • Updated all documentation and code examples to use the new stable API
  • Added JSDoc documentation for the newly stabilized middleware function

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
website/docs/en/guide/features/lazy-compilation.mdx Updated English documentation to reference the new stable API location and added migration notice
website/docs/zh/guide/features/lazy-compilation.mdx Updated Chinese documentation to reference the new stable API location and added migration notice
tests/e2e/fixtures/rspack.ts Updated test fixture to use the new stable API import
packages/rspack/src/exports.ts Added top-level export for lazyCompilationMiddleware and marked the experiments version as deprecated
packages/rspack/src/builtin-plugin/lazy-compilation/middleware.ts Added JSDoc comment documenting the middleware function
packages/rspack/etc/core.api.md Updated TypeScript API definitions to reflect the stabilization and deprecation
packages/rspack-test-tools/src/plugin/lazy-compilation-test-plugin.ts Updated test plugin to use the new stable API import
packages/rspack-cli/src/commands/serve.ts Updated CLI serve command to use the new stable API

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@github-actions
Copy link
Contributor

github-actions bot commented Dec 12, 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: 6f3f4de245 | PR: #12431

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: 6f3f4de245 | PR: #12431

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: 6f3f4de245 | PR: #12431

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: 6f3f4de245 | PR: #12431

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: 6f3f4de245 | PR: #12431

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 12, 2025

📦 Binary Size-limit

Comparing 8a6674a to chore: bump swc_experimental to fix parsing utf8 in template (#12431) by CPunisher

🙈 Size remains the same at 48.20MB

@codspeed-hq
Copy link

codspeed-hq bot commented Dec 12, 2025

CodSpeed Performance Report

Merging #12429 will not alter performance

Comparing stablize_lazy_middleware_1212 (8a6674a) with main (6f3f4de)

Summary

✅ 17 untouched

@chenjiahan chenjiahan requested review from stormslowly and removed request for LingyuCoder and hardfist December 12, 2025 14:05
@chenjiahan chenjiahan enabled auto-merge (squash) December 12, 2025 14:14
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