Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: builtins.provide function params transform bug #3347

Merged
merged 1 commit into from
May 30, 2023
Merged

Conversation

jerrykingxyz
Copy link
Collaborator

@jerrykingxyz jerrykingxyz commented May 30, 2023

Related issue (if exists)

Summary

馃 Generated by Copilot at d05c84d

This pull request enhances the provide plugin for JavaScript, which resolves unresolved identifiers with built-in modules. It improves the plugin's logic and performance, adds a new test case, and updates the existing test cases to cover more scenarios. The changes affect the provide.rs file, the crates/rspack_plugin_javascript/tests/fixtures/provide folder, and the packages/rspack/tests/configCases/builtins/provide folder.

Walkthrough

馃 Generated by Copilot at d05c84d

  • Add a condition to avoid providing built-in modules for unresolved identifiers (link)
  • Simplify the logic of getting the name of a nested identifier (link, link)
  • Modify the provide plugin test case to check if the provided module is not overwritten by a function parameter (crates/rspack_plugin_javascript/tests/fixtures/provide/index.js, crates/rspack_plugin_javascript/tests/fixtures/provide/expected/main.js, link, link)
  • Add a new test case to the builtins provide config case to check if the provide plugin does not inject a module for a function defined variable (packages/rspack/tests/configCases/builtins/provide/index.js, link)

@github-actions github-actions bot added release: bug fix team The issue/pr is created by the member of Rspack. labels May 30, 2023
@jerrykingxyz jerrykingxyz linked an issue May 30, 2023 that may be closed by this pull request
@jerrykingxyz jerrykingxyz added this pull request to the merge queue May 30, 2023
Merged via the queue into main with commit ce220cf May 30, 2023
12 checks passed
@jerrykingxyz jerrykingxyz deleted the jerry/provide branch May 30, 2023 06:21
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.

builtins.provide function params transform bug
2 participants