Skip to content

Conversation

@jerrykingxyz
Copy link
Contributor

@jerrykingxyz jerrykingxyz commented Nov 12, 2025

Copilot AI review requested due to automatic review settings November 12, 2025 07:04
@netlify
Copy link

netlify bot commented Nov 12, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit 4dbac1b
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/69143171f16e5e0008bc2a18

@github-actions github-actions bot added the team The issue/pr is created by the member of Rspack. label Nov 12, 2025
@stormslowly stormslowly changed the title Revert "refactor: remove support for nested importModule usage (#12111)" revert: refactor: remove support for nested importModule usage (#12111) Nov 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 reverts commit a2ba295 which had removed support for nested importModule usage in loaders. The revert re-enables nested importModule calls by changing the error handling from "not supported" to proper circular dependency detection.

Key changes:

  • Re-enables nested importModule usage in loaders by removing the early rejection
  • Updates error messages to report "circular build dependency" instead of "nested calls not supported"
  • Adds new test cases for cache behavior with loader import modules

Reviewed Changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
crates/rspack_core/src/compilation/make/module_executor/module_tracker.rs Removes is_module_building check and renames is_entry_running to is_running
crates/rspack_core/src/compilation/make/module_executor/entry.rs Removes nested importModule check and updates function call to is_running
tests/rspack-test/normalCases/errors/import-module-cycle/index.js Updates error expectations from "nested calls not supported" to "circular build dependency"
tests/rspack-test/normalCases/errors/import-module-cycle-multiple/index.js Updates expected error outputs to show deeper cycle detection
tests/rspack-test/configCases/loader-import-module/recursive-import-module/errors.js Removes error expectations for nested importModule (now allowed)
tests/rspack-test/configCases/loader-parallel-import-module/recursive-import-module/errors.js Removes error expectations for nested importModule (now allowed)
tests/rspack-test/watchCases/cache/loader-import-module/* Adds new test suite for cache behavior with loader import modules

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

@@ -0,0 +1,2 @@

module.exports = () => "FIXME: panic"
Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test filter contains a 'FIXME: panic' message, indicating the test is currently disabled or broken. This should be addressed before merging the revert to ensure the test properly validates the restored nested importModule functionality.

Suggested change
module.exports = () => "FIXME: panic"
module.exports = () => true

Copilot uses AI. Check for mistakes.
import a from "./a.generate-json.js";
import { value as unrelated } from "./unrelated";

it("should have to correct values and validate on change", () => {
Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The base expression of this property access is always undefined.

Suggested change
it("should have to correct values and validate on change", () => {
it("should have to correct values and validate on change", () => {
expect(a).not.toBeUndefined();

Copilot uses AI. Check for mistakes.
import a from "./a.generate-json.js";
import { value as unrelated } from "./unrelated";

it("should have to correct values and validate on change", () => {
Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The base expression of this property access is always undefined.

Suggested change
it("should have to correct values and validate on change", () => {
it("should have to correct values and validate on change", () => {
if (typeof a === "undefined") {
throw new Error('Imported "a" from "./a.generate-json.js" is undefined. Please ensure the module exports the expected object.');
}

Copilot uses AI. Check for mistakes.
Comment on lines +8 to +13
expect(a.nested.value).toBe(step < 3 ? 42 : 24);
expect(a.nested.a).toBe(step < 3 ? "a" : undefined);
expect(a.b).toBe(step < 1 ? "b" : undefined);
expect(a.nested.b).toBe(step < 1 ? "b" : undefined);
expect(a.c).toBe(step < 1 ? undefined : "c");
expect(a.nested.c).toBe(step < 1 || step >= 3 ? undefined : "c");
Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The base expression of this property access is always undefined.

Suggested change
expect(a.nested.value).toBe(step < 3 ? 42 : 24);
expect(a.nested.a).toBe(step < 3 ? "a" : undefined);
expect(a.b).toBe(step < 1 ? "b" : undefined);
expect(a.nested.b).toBe(step < 1 ? "b" : undefined);
expect(a.c).toBe(step < 1 ? undefined : "c");
expect(a.nested.c).toBe(step < 1 || step >= 3 ? undefined : "c");
expect(a.nested?.value).toBe(step < 3 ? 42 : 24);
expect(a.nested?.a).toBe(step < 3 ? "a" : undefined);
expect(a.b).toBe(step < 1 ? "b" : undefined);
expect(a.nested?.b).toBe(step < 1 ? "b" : undefined);
expect(a.c).toBe(step < 1 ? undefined : "c");
expect(a.nested?.c).toBe(step < 1 || step >= 3 ? undefined : "c");

Copilot uses AI. Check for mistakes.
Comment on lines +8 to +13
expect(a.nested.value).toBe(step < 3 ? 42 : 24);
expect(a.nested.a).toBe(step < 3 ? "a" : undefined);
expect(a.b).toBe(step < 1 ? "b" : undefined);
expect(a.nested.b).toBe(step < 1 ? "b" : undefined);
expect(a.c).toBe(step < 1 ? undefined : "c");
expect(a.nested.c).toBe(step < 1 || step >= 3 ? undefined : "c");
Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The base expression of this property access is always undefined.

Suggested change
expect(a.nested.value).toBe(step < 3 ? 42 : 24);
expect(a.nested.a).toBe(step < 3 ? "a" : undefined);
expect(a.b).toBe(step < 1 ? "b" : undefined);
expect(a.nested.b).toBe(step < 1 ? "b" : undefined);
expect(a.c).toBe(step < 1 ? undefined : "c");
expect(a.nested.c).toBe(step < 1 || step >= 3 ? undefined : "c");
expect(a.nested?.value).toBe(step < 3 ? 42 : 24);
expect(a.nested?.a).toBe(step < 3 ? "a" : undefined);
expect(a.b).toBe(step < 1 ? "b" : undefined);
expect(a.nested?.b).toBe(step < 1 ? "b" : undefined);
expect(a.c).toBe(step < 1 ? undefined : "c");
expect(a.nested?.c).toBe(step < 1 || step >= 3 ? undefined : "c");

Copilot uses AI. Check for mistakes.
expect(a.nested.a).toBe(step < 3 ? "a" : undefined);
expect(a.b).toBe(step < 1 ? "b" : undefined);
expect(a.nested.b).toBe(step < 1 ? "b" : undefined);
expect(a.c).toBe(step < 1 ? undefined : "c");
Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The base expression of this property access is always undefined.

Copilot uses AI. Check for mistakes.
expect(a.b).toBe(step < 1 ? "b" : undefined);
expect(a.nested.b).toBe(step < 1 ? "b" : undefined);
expect(a.c).toBe(step < 1 ? undefined : "c");
expect(a.nested.c).toBe(step < 1 || step >= 3 ? undefined : "c");
Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The base expression of this property access is always undefined.

Suggested change
expect(a.nested.c).toBe(step < 1 || step >= 3 ? undefined : "c");
expect(a.nested?.c).toBe(step < 1 || step >= 3 ? undefined : "c");

Copilot uses AI. Check for mistakes.
expect(a.c).toBe(step < 1 ? undefined : "c");
expect(a.nested.c).toBe(step < 1 || step >= 3 ? undefined : "c");
if (step !== 0) {
expect(STATE.random === a.random).toBe(step === 2);
Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The base expression of this property access is always undefined.

Copilot uses AI. Check for mistakes.
if (step !== 0) {
expect(STATE.random === a.random).toBe(step === 2);
}
STATE.random = a.random;
Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The base expression of this property access is always undefined.

Copilot uses AI. Check for mistakes.
Comment on lines +2 to +3
import { value as unrelated } from "./unrelated";

Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused import unrelated.

Suggested change
import { value as unrelated } from "./unrelated";

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Contributor

📦 Binary Size-limit

Comparing 4dbac1b to feat(react-refresh-loader): generate more compact runtime code (#12160) by neverland

🙈 Size remains the same at 48.09MB

@hardfist hardfist merged commit 7c5ba6a into main Nov 12, 2025
77 of 80 checks passed
@hardfist hardfist deleted the jerry/module_executor branch November 12, 2025 09:55
@codspeed-hq
Copy link

codspeed-hq bot commented Nov 12, 2025

CodSpeed Performance Report

Merging #12165 will not alter performance

Comparing jerry/module_executor (4dbac1b) with main (0c06124)

Summary

✅ 17 untouched

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.

4 participants