Skip to content

Conversation

@ahabhgk
Copy link
Contributor

@ahabhgk ahabhgk commented Oct 20, 2025

Summary

Should allow override can_inline_use in flag dependency usage plugin

Related links

Checklist

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

@Copilot Copilot AI review requested due to automatic review settings October 20, 2025 15:59
@netlify
Copy link

netlify bot commented Oct 20, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit 5ed63cb
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/68f65c50bcdafc0008c14b37

@ahabhgk ahabhgk enabled auto-merge (squash) October 20, 2025 15:59
@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 Oct 20, 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 fixes a bug in the flag dependency usage plugin to properly handle the can_inline_use state for export dependencies. The fix ensures that when an export cannot be inlined (due to destructuring patterns), the state is correctly set to CanInlineUse::No rather than remaining uninitialized.

Key changes:

  • Added logic to explicitly set can_inline_use to No when inlining is not possible
  • Renamed traverse_on_left to traverse_on_leaf for better semantic clarity
  • Added test coverage for reexported destructuring scenarios

Reviewed Changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
crates/rspack_plugin_javascript/src/plugin/flag_dependency_usage_plugin.rs Added explicit setting of can_inline_use to No when can_inline is false
crates/rspack_core/src/exports/utils.rs Added documentation explaining the need for HasInfo initial state in CanInlineUse enum
crates/rspack_plugin_javascript/src/visitors/dependency/parser/mod.rs Renamed traverse_on_left to traverse_on_leaf for semantic clarity
crates/rspack_plugin_javascript/src/parser_plugin/import_parser_plugin.rs Updated method calls from traverse_on_left to traverse_on_leaf
crates/rspack_plugin_javascript/src/dependency/esm/esm_import_specifier_dependency.rs Updated method call from traverse_on_left to traverse_on_leaf
tests/rspack-test/configCases/inline-enum/basic/rspack.config.js Added ES2022 target configuration for test
tests/rspack-test/configCases/inline-enum/basic/re-export.reexprt-destructuring.ts Added new test file for reexported destructuring scenario
tests/rspack-test/configCases/inline-enum/basic/enum.reexport-destructuring.ts Added enum definition for reexport destructuring test
tests/rspack-test/configCases/inline-enum/basic/index.js Added test case and fixed variable naming from "destructing" to "destructuring"

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@github-actions
Copy link
Contributor

📦 Binary Size-limit

Comparing 5ed63cb to chore: enable Rslint rule: no-empty-interface (#11915) by Dima Shugaev

🙈 Size remains the same at 47.73MB

@ahabhgk ahabhgk requested a review from SyMind October 20, 2025 16:10
@codspeed-hq
Copy link

codspeed-hq bot commented Oct 20, 2025

CodSpeed Performance Report

Merging #11934 will not alter performance

Comparing fix-inline-multi-use (5ed63cb) with main (e3199f4)

Summary

✅ 17 untouched

@ahabhgk ahabhgk merged commit 1b06dba into main Oct 21, 2025
99 of 103 checks passed
@ahabhgk ahabhgk deleted the fix-inline-multi-use branch October 21, 2025 04:42
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.

2 participants