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

feat(core): external supports array #3141

Merged
merged 7 commits into from
May 15, 2023
Merged

feat(core): external supports array #3141

merged 7 commits into from
May 15, 2023

Conversation

hardfist
Copy link
Contributor

@hardfist hardfist commented May 12, 2023

Related issue (if exists)

closes #1803

Summary

馃 Generated by Copilot at 3f82dc2

This pull request adds support for array values in external module configuration and simplifies the logic for handling different external types. It introduces a new ExternalRequest struct to represent the request of an external module as a vector of strings, and updates the ExternalModule struct and its methods accordingly. It also modifies the ExternalItemValue enum, the plugin.rs file, and the umd_library_plugin.rs file to use the new struct and handle array values.

Walkthrough

馃 Generated by Copilot at 3f82dc2

  • Introduce ExternalRequest struct to wrap external module requests as vectors of strings (link, link, link, link)
  • Update ExternalModule struct and methods to use ExternalRequest instead of String for request field and id generation (link, link, link, link, link, link)
  • Update get_external_module method in plugin.rs to handle Array variant of ExternalItemValue and convert it to ExternalRequest (link, link)
  • Update get_umd_library_source method in umd_library_plugin.rs to use as_str method of ExternalRequest to get first element of request vector (link)

@hardfist hardfist marked this pull request as draft May 12, 2023 08:36
@github-actions github-actions bot added release: feature team The issue/pr is created by the member of Rspack. labels May 12, 2023
@hardfist hardfist force-pushed the external-array branch 2 times, most recently from 1245d80 to 263f4bb Compare May 15, 2023 06:11
@hardfist hardfist marked this pull request as ready for review May 15, 2023 06:16
underfin
underfin previously approved these changes May 15, 2023
@underfin underfin added this pull request to the merge queue May 15, 2023
Merged via the queue into main with commit 7587f31 May 15, 2023
12 checks passed
@underfin underfin deleted the external-array branch May 15, 2023 09:27
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.

[Bug Report]: Property accessing logic in Externals is basically not right
2 participants