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: fix wrong context in external function #3370

Merged
merged 1 commit into from
May 31, 2023
Merged

Conversation

hardfist
Copy link
Contributor

@hardfist hardfist commented May 31, 2023

Related issue (if exists)

Summary

馃 Generated by Copilot at 4518bd7

This pull request adds a context field to the structs and arguments used for module creation and dependency resolution. This improves the performance and reliability of the ExternalPlugin and allows it to access the directory of the module that requires the dependency.

Walkthrough

馃 Generated by Copilot at 4518bd7

  • Add context field to NormalModuleFactoryCreateData to pass the directory of the module that requires the dependency (link)
  • Add context field to ExternalPluginArgs to pass the reference to the context field from NormalModuleFactoryCreateData to the ExternalPlugin (link)
  • Use context field from ExternalPluginArgs instead of deriving it from request in ExternalPlugin implementation in plugin.rs (link)
  • Add expect call to ensure context field is present and provide a more informative error message in ExternalPlugin implementation in plugin.rs (link)

@github-actions github-actions bot added release: bug fix team The issue/pr is created by the member of Rspack. labels May 31, 2023
hyf0
hyf0 previously approved these changes May 31, 2023
@github-actions
Copy link
Contributor

Test Compatibility Diff

@hardfist hardfist added this pull request to the merge queue May 31, 2023
Merged via the queue into main with commit e8556c5 May 31, 2023
16 of 17 checks passed
@hardfist hardfist deleted the fix-external-context branch May 31, 2023 17:25
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.

None yet

2 participants