Skip to content

feat(mf): support layered container exposes - #14912

Open
ScriptedAlchemy wants to merge 80 commits into
codex/mf-share-scope-runtimefrom
codex/mf-layered-container-exposes
Open

ScriptedAlchemy wants to merge 80 commits into
codex/mf-share-scope-runtimefrom
codex/mf-layered-container-exposes

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

Expose the same source in different layers without requiring users to assign each variant through module.rules.

Changes

Add exposes.*.layer to enhanced containers and carry the configured layer through bindings, dependencies, and module builds:

exposes: {
  './server': { import: './src/component.js', layer: 'server' },
  './client': { import: './src/component.js', layer: 'client' },
}

Omitting layer leaves it unspecified. Legacy expose configurations retain their behavior. The final stack adds nonempty-name validation in #14913.

Direct expose tests cover server/client and omitted layers in both runtime modes. Type tests check the enhanced API boundary; serial fixtures cover layered remote loading.

Stack 3/4: #12977 → #14911 → #14912 → #14913.

Enhanced Webpack parity and layer-aware federation RFC.

@codspeed

codspeed Bot commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 57 untouched benchmarks
⏩ 47 skipped benchmarks1


Comparing codex/mf-layered-container-exposes (728b7a9) with codex/mf-share-scope-runtime (5b1e45a)

Open in CodSpeed

Footnotes

  1. 47 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@ScriptedAlchemy
ScriptedAlchemy force-pushed the codex/mf-layered-container-exposes branch from 9d29773 to 5ffeb7a Compare July 22, 2026 23:05
@github-actions

github-actions Bot commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor

📦 Binary Size-limit

Comparing 728b7a9 to fix: allocative crate package names (#16212) by AsyncIter

Note

This PR is stacked on codex/mf-share-scope-runtime. Sizes are compared against main, so the diff below covers the whole stack, not this PR alone.

❌ Size increased by 56.13KB from 67.74MB to 67.80MB (⬆️0.08%)

@github-actions

github-actions Bot commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor

Rsdoctor Bundle Diff Analysis

Found 5 projects in monorepo, 0 projects with changes.

📊 Quick Summary
Project Total Size Gzip Size Change Gzip Change
popular-libs 1.7 MB 536.3 KB 0 0
react-10k 5.4 MB 1.3 MB 0 0
react-1k 827.7 KB 225.2 KB 0 0
react-5k 2.6 MB 670.6 KB 0 0
ui-components 4.7 MB 1.4 MB 0 0

Generated by Rsdoctor GitHub Action

@ScriptedAlchemy
ScriptedAlchemy force-pushed the codex/mf-layered-container-exposes branch from 5ffeb7a to 684b404 Compare July 23, 2026 00:49
@ScriptedAlchemy
ScriptedAlchemy force-pushed the codex/mf-layered-container-exposes branch from 684b404 to c4d3c04 Compare July 23, 2026 01:16
@ScriptedAlchemy
ScriptedAlchemy marked this pull request as ready for review July 23, 2026 01:52

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c4d3c0444e

ℹ️ 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".

Comment thread packages/rspack/src/container/ContainerPlugin.ts Outdated
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 27, 2026 •

Copy link
Copy Markdown

Deploying rspack with  Cloudflare Pages  Cloudflare Pages

Latest commit: 1162106
Status: ✅  Deploy successful!
Preview URL: https://ae1a8f02.rspack-v2.pages.dev
Branch Preview URL: https://codex-mf-layered-container-e.rspack-v2.pages.dev

View logs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b3a3fedc2e

ℹ️ 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".

Comment thread crates/rspack_plugin_mf/src/container/container_exposed_dependency.rs Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7ee51282af

ℹ️ 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".

Comment thread packages/rspack/src/container/ContainerPlugin.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6c1af2cc11

ℹ️ 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".

Comment thread packages/rspack/src/container/ContainerPlugin.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b21cf1d6ee

ℹ️ 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".

Comment thread packages/rspack/src/container/ModuleFederationPluginV1.ts Outdated
…tainer-exposes

# Conflicts:
#	crates/rspack_plugin_mf/src/container/container_entry_module.rs
Replace the parallel expose_layers vector, its constructors, and the
ExposeIdentifierPayload mirror with an optional layer field on ExposeOptions,
serialized only when present so unlayered container identifiers keep webpack's
[[key, options]] payload. Follows ProvideOptions::layer.
…ures

Validate exposes.layer where the option is introduced, drop the empty-layer
expose from the option fixture and docs, and remove experiments.outputModule
from the ported layers-full fixtures, which already set output.module.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a47cc845f2

ℹ️ 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".

Comment thread packages/rspack/src/container/ContainerPlugin.ts Outdated

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant