Repository navigation
feat(mf): add layer-aware shared module core - #12977
ScriptedAlchemy wants to merge 55 commits into
Conversation
Rsdoctor Bundle Diff AnalysisFound 5 projects in monorepo, 0 projects with changes. 📊 Quick Summary
Generated by Rsdoctor GitHub Action |
📦 Binary Size-limit
❌ Size increased by 36.00KB from 69.42MB to 69.46MB (⬆️0.05%) |
Merging this PR will not alter performance
Comparing Footnotes
|
Deploying rspack with
|
| Latest commit: |
06742b2
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://c232bd4d.rspack-v2.pages.dev |
| Branch Preview URL: | https://feat-mf-layers.rspack-v2.pages.dev |
405989b to
42b9549
Compare
| let share_init_items = scopes | ||
| .iter() | ||
| .map(|scope| ShareInitData { | ||
| share_scope: ShareScope::Single(scope.clone()), |
There was a problem hiding this comment.
Why not pass through the scopes and change to Single here?
There was a problem hiding this comment.
Also need @2heal1 to review share_scope related changes, I see lots of similar changes like this, not sure whether it's expected
There was a problem hiding this comment.
The remote now passes the scopes through with share_scope: self.share_scope.clone():
rspack/crates/rspack_plugin_mf/src/container/remote_module.rs
Lines 207 to 212 in 29de6a6
Leaving this thread open for the requested @2heal1 review of the share-scope changes.
| } | ||
|
|
||
| if matches!(module_type, ModuleType::ConsumeShared) | ||
| && let Some((pkg, required)) = parse_consume_shared_identifier(&identifier) |
There was a problem hiding this comment.
Need @2heal1 to review the manifest related changes
54a0d8f to
5a2fd79
Compare
15e299e to
3a443d9
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 907852d953
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ca4e8cc35e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
# Conflicts: # crates/rspack_plugin_mf/src/container/container_entry_module.rs # crates/rspack_plugin_mf/src/sharing/consume_shared_module.rs # crates/rspack_plugin_mf/src/sharing/provide_shared_module.rs
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b17652661c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ff601a5915
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Resolve two conflicts from #15674 (share BuildContext across module graph tasks): keep the layer-aware branches and read runtime_mode from data.build_context.compiler_options.
The ConsumeShared source is the same string as CodeGenerationDataConsumeShared::fallback, falling back to "undefined" in both places.
Restore webpack's early return in ProvideSharedPlugin for a resource already resolved for the same config, now keyed by (resource, layer). Validate that shared layer and issuerLayer are non-empty strings where the options are introduced, and document that they need the enhanced runtime.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
…umes Only a consume with issuerLayer is matched and resolved from its issuer, as the enhanced webpack plugin does. Unlayered relative shared requests and fallback imports resolve against the compiler context again, so the pre-existing fallback-context case is shared instead of silently falling through, and the request-origins fixture asserts the compiler-context fallback.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 738ce9861d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Summary
Add layer-aware shared module matching to Module Federation 1.5 (RFC #15576).
issuerLayeris matched and resolved from its issuer, matching the enhanced webpack plugin. Layer names must be non-empty strings.Rust
SharedIdentityvalues are cloned because the same owned scope/key/layer identity keys separate matching, provider, and export-usage maps.RequestMatchKeyclones copy request/layer strings when the export optimizer builds its prefix lookup map.Coverage
Config cases cover layered matching, aliases, prefix requests, fallback imports, identifier collisions, and export usage. Public API and type tests cover enhanced-option validation.
Related links
Stack 1/4: #12977 → #14911 → #14912 → #14913.
Checklist