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

fix(rspack_plugin_mf): add chunk js matcher runtime to federation runtime #6434

Merged
merged 6 commits into from
May 9, 2024

Conversation

ScriptedAlchemy
Copy link
Contributor

@ScriptedAlchemy ScriptedAlchemy commented May 2, 2024

Summary

Exposes internal chunk matcher that is used for ensureChunkHandlers. This allows one to patch js chunk handlers at runtime using the same logic that rspack uses internally. (chunk_matcher.render('chunkid'))

This allows me to reliably implement node federation support without adding a new chunk loading target in rust.

Original implementation: https://github.com/module-federation/core/blob/main/packages/enhanced/src/lib/container/runtime/FederationRuntimeModule.ts#L53

Checklist

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

@github-actions github-actions bot added the release: bug fix release: bug related release(mr only) label May 2, 2024
Copy link

netlify bot commented May 2, 2024

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit bd69e44
🔍 Latest deploy log https://app.netlify.com/sites/rspack/deploys/663c3376261468000867cd78

@ScriptedAlchemy ScriptedAlchemy force-pushed the feat/federation-runtime-js-matcher branch from 23e3978 to f2a5017 Compare May 2, 2024 03:33
@ScriptedAlchemy ScriptedAlchemy requested a review from ahabhgk May 3, 2024 00:53
@ScriptedAlchemy ScriptedAlchemy marked this pull request as ready for review May 3, 2024 00:53
@ahabhgk
Copy link
Contributor

ahabhgk commented May 6, 2024

Could you add a test under packages/rspack-test-tools/tests/container-1-5, just in case of regression

@ScriptedAlchemy
Copy link
Contributor Author

Could you add a test under packages/rspack-test-tools/tests/container-1-5, just in case of regression

can do!

@ahabhgk ahabhgk enabled auto-merge (squash) May 9, 2024 03:44
@ahabhgk ahabhgk merged commit f73d70c into main May 9, 2024
29 checks passed
@ahabhgk ahabhgk deleted the feat/federation-runtime-js-matcher branch May 9, 2024 03:44
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)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants