8000 refactor!: lazy compilation middleware supports multiCompiler and use config from compiler instance by JSerFeng · Pull Request #9828 · web-infra-dev/rspack · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@JSerFeng
Copy link
Contributor
@JSerFeng JSerFeng commented Mar 28, 2025

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

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

@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 Mar 28, 2025
@netlify
Copy link
netlify bot commented Mar 28, 2025

Deploy Preview for rspack ready!

Name Link
🔨 Latest commit 2b855c7
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/684f956cd99ec900087c3396
😎 Deploy Preview https://deploy-preview-9828--rspack.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

-->

@codspeed-hq
Copy link
codspeed-hq bot commented Mar 28, 2025

CodSpeed Performance Report

Merging #9828 will not alter performance

Comparing feat/lazy-compilation-multi-compiler (2b855c7) with main (7bc5051)

🎉 Hooray! codspeed-rust just leveled up to 2.7.2!

A heads-up, this is a breaking change and it might affect your current performance baseline a bit. But here's the exciting part - it's packed with new, cool features and promises improved result stability 🥳!
Curious about what's new? Visit our releases page to delve into all the awesome details about this new version.

Summary

✅ 12 untouched benchmarks

@JSerFeng JSerFeng force-pushed the feat/lazy-compilation-multi-compiler branch from 241fc39 to 578a468 Compare March 28, 2025 10:03
@chenjiahan
Copy link
Member

@JSerFeng Can we fix the CI and get this PR merged? ❤️

@JSerFeng JSerFeng force-pushed the feat/lazy-compilation-multi-compiler branch 5 times, most recently from 0d9ba83 to 612de05 Compare May 8, 2025 11:19
@JSerFeng JSerFeng requested a review from Copilot May 9, 2025 04:10
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 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.

@JSerFeng JSerFeng force-pushed the feat/lazy-compilation-multi-compiler branch 4 times, most recently from 6dc6454 to 8304647 Compare May 12, 2025 06:12
@JSerFeng JSerFeng enabled auto-merge (squash) May 12, 2025 06:50
@JSerFeng JSerFeng force-pushed the feat/lazy-compilation-multi-compiler branch 2 times, most recently from 5ff046f to ade0661 Compare May 18, 2025 18:44
@JSerFeng JSerFeng changed the title feat: lazy compilation middleware supports multiCompiler refactor: lazy compilation middleware supports multiCompiler and use config from compiler instance May 18, 2025
@JSerFeng JSerFeng changed the title refactor: lazy compilation middleware supports multiCompiler and use config from compiler instance !refactor: lazy compilation middleware supports multiCompiler and use config from compiler instance May 18, 2025
@github-actions github-actions bot removed the release: feature release: feature related release(mr only) label May 18, 2025
@JSerFeng JSerFeng changed the title !refactor: lazy compilation middleware supports multiCompiler and use config from compiler instance refactor!: lazy compilation middleware supports multiCompiler and use config from compiler instance May 18, 2025
@chenjiahan chenjiahan added this to the 1.4.0 milestone May 19, 2025
@JSerFeng JSerFeng force-pushed the feat/lazy-compilation-multi-compiler branch from ade0661 to 2b855c7 Compare June 16, 2025 03:54
@JSerFeng JSerFeng requested a review from chenjiahan June 16, 2025 06:12
@JSerFeng JSerFeng merged commit a076969 into main Jun 16, 2025
34 checks passed
@JSerFeng JSerFeng deleted the feat/lazy-compilation-multi-compiler branch June 16, 2025 06:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team The issue/pr is created by the member of Rspack.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

0