Skip to content

Conversation

@ahabhgk
Copy link
Contributor

@ahabhgk ahabhgk commented Nov 4, 2025

Summary

fix #12069

Related links

Checklist

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

Copilot AI review requested due to automatic review settings November 4, 2025 12:17
@github-actions github-actions bot added release: bug fix release: bug related release(mr only) team The issue/pr is created by the member of Rspack. labels Nov 4, 2025
@netlify
Copy link

netlify bot commented Nov 4, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit d2d6b7a
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/6909fd2e6bba110008d78f90

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 implements tracking of non-deferred access to deferred modules in module concatenation, ensuring that when a deferred module is accessed in a non-deferred context, the evaluation order is correctly maintained. The changes primarily affect how concatenated modules handle mixed defer/non-defer imports.

  • Adds NonDeferAccess tracking to distinguish defer vs non-defer module access
  • Refactors module evaluation order to hoist deferred namespace object definitions
  • Removes unused ExportsInfoGetter imports and runtime_condition field from ExternalModuleInfo

Reviewed Changes

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

Show a summary per file
File Description
tests/rspack-test/configCases/defer-import/dynamic-default-mixed/rspack.config.js Test configuration for mixed defer/non-defer imports
tests/rspack-test/configCases/defer-import/dynamic-default-mixed/reexport.js Test module demonstrating deferred and default imports
tests/rspack-test/configCases/defer-import/dynamic-default-mixed/index.js Test case verifying correct default export with module concatenation
tests/rspack-test/configCases/defer-import/dynamic-default-mixed/dynamic.cjs CommonJS module with dynamic ES module flag
crates/rspack_plugin_esm_library/src/plugin.rs Removes unused ExportsInfoGetter import and runtime_condition field usage
crates/rspack_core/src/concatenated_module.rs Core implementation of NonDeferAccess tracking and refactored module evaluation order

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

@ahabhgk ahabhgk enabled auto-merge (squash) November 4, 2025 12:21
@github-actions
Copy link
Contributor

github-actions bot commented Nov 4, 2025

📦 Binary Size-limit

Comparing d2d6b7a to fix: treat HMR's warnUnexpectedRequire as undefined module factory (#12016) by pshu

🎉 Size decreased by 6.13KB from 47.86MB to 47.85MB (⬇️0.01%)

@codspeed-hq
Copy link

codspeed-hq bot commented Nov 4, 2025

CodSpeed Performance Report

Merging #12082 will not alter performance

Comparing fix-defer-default-mixed (d2d6b7a) with main (a0be7ea)

Summary

✅ 17 untouched

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@ahabhgk ahabhgk merged commit 014cbf7 into main Nov 5, 2025
44 checks passed
@ahabhgk ahabhgk deleted the fix-defer-default-mixed branch November 5, 2025 01:30
@h-a-n-a h-a-n-a mentioned this pull request Nov 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release: bug fix release: bug 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.

[Bug]: Panic occurred when using import defer

3 participants