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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document webpack change: feat: add URL dependencies support to consume shared module via module federation #6802

Closed
webpack-bot opened this issue May 3, 2023 · 0 comments · Fixed by #7213
Assignees

Comments

@webpack-bot
Copy link

A pull request by @snitin315 was merged and maintainers requested a documentation change.

See pull request: webpack/webpack#16945


Fixes webpack/webpack#14035

For module federation shared, without requiredVersion configured, it will infer the version based on package.json, as we can see in ConsumeSharedPlugin.js.

But when we get requiredVersion from package.json, it just gets dep/dev /peer/optional dependencies value, without consideration of some URL Dependencies cases.

For example, "isarray": "git+https://github.com/juliangruber/isarray.git#v2.0.3", it's real version should be v2.0.3, but we can not get that.

Summary

🤖 Generated by Copilot at fb959e1

This pull request adds support for git urls as dependencies in shared modules. It implements a new function normalizeVersion to handle git urls in lib/sharing/utils.js and adds more tests and dependencies to the test/configCases/sharing/consume-multiple-versions folder to verify the feature. It also updates the cspell.json file to ignore the word "commithash".

Details

🤖 Generated by Copilot at fb959e1

  • Add normalizeVersion function to lib/sharing/utils.js to normalize the version of a shared module from a git url (link)
  • Use normalizeVersion function on the optional, dependencies, peer dependencies, and dev dependencies of a shared module in getRequiredVersion function in lib/sharing/utils.js to ensure consistent version resolution (link, link, link, link)
  • Add commithash to the cspell ignore list in cspell.json to avoid spelling errors in the code that deals with git commit hashes (link)
  • Add more shared modules with different versions and git urls as dependencies to the test/configCases/sharing/consume-multiple-versions test case to test the new feature of allowing git urls as dependencies in the package.json of a shared module (link, link, link)
  • Add more expectations to the test/configCases/sharing/consume-multiple-versions/index.js file to check the versions of the shared modules that are required by the host module (link)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants