rspack icon indicating copy to clipboard operation
rspack copied to clipboard

fix(mf): use unresolved request to match shared module

Open elbywan opened this issue 3 months ago • 5 comments
trafficstars

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).

elbywan avatar Aug 25 '25 14:08 elbywan

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

netlify[bot] avatar Aug 25 '25 14:08 netlify[bot]

CodSpeed Performance Report

Merging #11478 will not alter performance

Comparing elbywan:fix-mf-shared-custom-resolution (8163e79) with main (a915dab)

Summary

✅ 17 untouched

codspeed-hq[bot] avatar Aug 25 '25 14:08 codspeed-hq[bot]

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

Nsttt avatar Sep 30 '25 10:09 Nsttt

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 😬

elbywan avatar Sep 30 '25 11:09 elbywan

👋 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

elbywan avatar Oct 13 '25 14:10 elbywan