rspack
rspack copied to clipboard
fix(mf): use unresolved request to match shared module
Summary
Use data.dependencies[0].request instead of create_data.raw_request to check if a module is declared in the MF shared configuration.
Without it and when using a custom resolver hooking into normalModuleFactory.hooks.resolve the fully qualified path would be used and would end up not matching anything.
This PR should restore the same behaviour as before v1.4.7 and specifically https://github.com/web-infra-dev/rspack/pull/10999
Related links
- https://github.com/web-infra-dev/rspack/issues/11477
Checklist
- [x] Tests updated (or not required).
- [x] Documentation updated (or not required).
Deploy Preview for rspack canceled.
Built without sensitive environment variables
| Name | Link |
|---|---|
| Latest commit | 8163e7972c238d030a01eaa54d8cfd1baf0014c3 |
| Latest deploy log | https://app.netlify.com/projects/rspack/deploys/68ed06ededf97b0008789e09 |
CodSpeed Performance Report
Merging #11478 will not alter performance
Comparing elbywan:fix-mf-shared-custom-resolution (8163e79) with main (a915dab)
Summary
✅ 17 untouched
Hey, got some feedback from the MF team, can you add the tests to https://github.com/web-infra-dev/rspack/tree/main/tests/rspack-test/configCases/sharing
Hey @Nsttt, that's great thanks for the update!
Hey, got some feedback from the MF team, can you add the tests to https://github.com/web-infra-dev/rspack/tree/main/tests/rspack-test/configCases/sharing
Sure I'll try to dedicate some time ~this week~ next week to write them 👍
EDIT: sorry I need a little more time 😬
👋 Just added a test case https://github.com/web-infra-dev/rspack/pull/11478/commits/8163e7972c238d030a01eaa54d8cfd1baf0014c3
pnpm run --filter="@rspack/tests" test:base -t configCases/sharing/provide-shared-with-custom-resolver