Skip to content

fix: use persistent cache with module federation#9445

Merged
jerrykingxyz merged 1 commit intomainfrom
jerry/mf
Feb 25, 2025
Merged

fix: use persistent cache with module federation#9445
jerrykingxyz merged 1 commit intomainfrom
jerry/mf

Conversation

@jerrykingxyz
Copy link
Contributor

@jerrykingxyz jerrykingxyz commented Feb 25, 2025

Summary

The Module federation plugin collects the consumption location and use compilation.add_includes to generate them as entry, but the plugin state cannot be saved to the persistent cache, which will cause bug when hot start.
https://github.com/web-infra-dev/rspack/blob/main/crates/rspack_plugin_mf/src/sharing/provide_shared_plugin.rs#L85

This PR will make the ConsumeSharedModule non-cacheable so that it is always regenerated on hot start to restore plugin state.

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@netlify
Copy link

netlify bot commented Feb 25, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit b7697fd
🔍 Latest deploy log https://app.netlify.com/sites/rspack/deploys/67bd3bd5d0ee1d0008513a43

@jerrykingxyz jerrykingxyz linked an issue Feb 25, 2025 that may be closed by this pull request
@github-actions github-actions bot added release: bug fix release: bug related release(mr only) team The issue/pr is created by the member of Rspack. labels Feb 25, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Feb 25, 2025

CodSpeed Performance Report

Merging #9445 will not alter performance

Comparing jerry/mf (b7697fd) with main (33b3a41)

Summary

✅ 7 untouched benchmarks

@jerrykingxyz jerrykingxyz requested a review from ahabhgk February 25, 2025 06:12
@jerrykingxyz jerrykingxyz merged commit fd867cf into main Feb 25, 2025
35 checks passed
@jerrykingxyz jerrykingxyz deleted the jerry/mf branch February 25, 2025 06:22
@jerrykingxyz jerrykingxyz changed the title fix: use persistent cache with module foundation fix: use persistent cache with module federation Feb 25, 2025
@h-a-n-a h-a-n-a mentioned this pull request Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release: bug fix release: bug related release(mr only) 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]: Starting build from file cache breaks MFP runtime

2 participants