Skip to content

fix(rslib): treat module identifier as normal#11588

Merged
fi3ework merged 1 commit intomainfrom
rslib-2
Sep 5, 2025
Merged

fix(rslib): treat module identifier as normal#11588
fi3ework merged 1 commit intomainfrom
rslib-2

Conversation

@fi3ework
Copy link
Member

@fi3ework fi3ework commented Sep 4, 2025

Summary

do not treat module as a special identifier in Rslib.

Related links

Checklist

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

Copilot AI review requested due to automatic review settings September 4, 2025 13:13
@netlify
Copy link

netlify bot commented Sep 4, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit 384f894
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/68b99072db009100085eeb35

@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 Sep 4, 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 the treatment of the module identifier in the rslib parser to prevent it from being handled as a special webpack construct. The change ensures that the module identifier is treated as a normal JavaScript identifier rather than being transformed into webpack-specific code.

  • Adds an identifier hook in the rslib parser plugin to intercept module identifier handling
  • Updates test cases to verify that module references are preserved in the output and not transformed to __webpack_require__

Reviewed Changes

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

File Description
crates/rspack_plugin_rslib/src/parser_plugin.rs Implements identifier hook to treat module as normal identifier
packages/rspack-test-tools/tests/configCases/rslib/plugin-api/index.js Adds test case with module usage in function
packages/rspack-test-tools/tests/configCases/rslib/plugin-api/test.js Adds assertions to verify module is not transformed

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

@github-actions
Copy link
Contributor

github-actions bot commented Sep 4, 2025

📦 Binary Size-limit

Comparing 384f894 to refactor: Dependency remove source_map field (#11582) by jinrui

🎉 Size decreased by 17.63KB from 47.30MB to 47.29MB (⬇️0.04%)

@codspeed-hq
Copy link

codspeed-hq bot commented Sep 4, 2025

CodSpeed Performance Report

Merging #11588 will not alter performance

Comparing rslib-2 (384f894) with main (224197f)1

Summary

✅ 17 untouched benchmarks

Footnotes

  1. No successful run was found on main (09ddf50) during the generation of this report, so 224197f was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@fi3ework fi3ework requested a review from JSerFeng September 5, 2025 03:11
@fi3ework fi3ework enabled auto-merge (squash) September 5, 2025 06:20
@fi3ework fi3ework merged commit 15ba68e into main Sep 5, 2025
51 checks passed
@fi3ework fi3ework deleted the rslib-2 branch September 5, 2025 06:44
fi3ework added a commit to fi3ework/rspack that referenced this pull request Sep 10, 2025
fi3ework added a commit that referenced this pull request Sep 10, 2025
#11630)

Revert "fix(rslib): treat `module` identifier as normal (#11588)"

This reverts commit 15ba68e.
fi3ework added a commit that referenced this pull request Sep 10, 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.

3 participants