Skip to content

feat(rspress): support remote code block transforms - #4931

Draft
2heal1 wants to merge 1 commit into
mainfrom
codex/rspress-codeblock-transform
Draft

feat(rspress): support remote code block transforms#4931
2heal1 wants to merge 1 commit into
mainfrom
codex/rspress-codeblock-transform

Conversation

@2heal1

@2heal1 2heal1 commented Jul 24, 2026

Copy link
Copy Markdown
Member

Description

Adds an opt-in code-block transformation capability to @module-federation/rspress-plugin.

Producer documents can keep ordinary fenced code blocks. A consumer can pass a transformer to a remote document to replace matching code content without creating a dedicated component in the producer. The transformed result is also available to SSG output, generated Markdown, and LLM text output.

This change includes the public helper, runtime handling, Markdown integration, tests, documentation, and a patch changeset.

Validation completed:

  • pnpm exec prettier --check .
  • pnpm exec turbo run build --filter=@module-federation/rspress-plugin
  • pnpm exec turbo run test --filter=@module-federation/rspress-plugin
  • Changeset validation
  • An end-to-end Module Federation producer/consumer SSG build, including generated HTML, Markdown, and llms-full.txt

The full repository test suite was not run; validation was scoped to the affected package and its dependencies, plus the end-to-end SSG scenario.

Related Issue

No linked issue.

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have updated the documentation.

@changeset-bot

changeset-bot Bot commented Jul 24, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 39467d7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 47 packages
Name Type
@module-federation/rspress-plugin Patch
website-new Patch
@module-federation/runtime Patch
@module-federation/enhanced Patch
@module-federation/rspack Patch
@module-federation/webpack-bundler-runtime Patch
@module-federation/sdk Patch
@module-federation/runtime-tools Patch
@module-federation/managers Patch
@module-federation/manifest Patch
@module-federation/dts-plugin Patch
@module-federation/third-party-dts-extractor Patch
@module-federation/devtools Patch
@module-federation/bridge-react Patch
@module-federation/bridge-vue3 Patch
@module-federation/bridge-shared Patch
@module-federation/bridge-react-webpack-plugin Patch
@module-federation/modern-js Patch
@module-federation/modern-js-v3 Patch
@module-federation/retry-plugin Patch
@module-federation/rsbuild-plugin Patch
@module-federation/error-codes Patch
@module-federation/inject-external-runtime-core-plugin Patch
@module-federation/runtime-core Patch
create-module-federation Patch
@module-federation/cli Patch
@module-federation/treeshake-server Patch
@module-federation/treeshake-frontend Patch
@module-federation/metro Patch
@module-federation/metro-plugin-rnef Patch
@module-federation/metro-plugin-rock Patch
@module-federation/metro-plugin-rnc-cli Patch
@module-federation/esbuild Patch
@module-federation/nextjs-mf Patch
@module-federation/node Patch
@module-federation/observability-plugin Patch
@module-federation/playground Patch
@module-federation/storybook-addon Patch
shared-tree-shaking-no-server-host Patch
shared-tree-shaking-no-server-provider Patch
@module-federation/utilities Patch
remote5 Patch
remote6 Patch
shared-tree-shaking-with-server-host Patch
shared-tree-shaking-with-server-provider Patch
node-dynamic-remote-new-version Patch
node-dynamic-remote Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Jul 24, 2026

Copy link
Copy Markdown

Open in StackBlitz

@module-federation/devtools

pnpm add https://pkg.pr.new/@module-federation/devtools@39467d7

@module-federation/cli

pnpm add https://pkg.pr.new/@module-federation/cli@39467d7

create-module-federation

pnpm add https://pkg.pr.new/create-module-federation@39467d7

@module-federation/dts-plugin

pnpm add https://pkg.pr.new/@module-federation/dts-plugin@39467d7

@module-federation/enhanced

pnpm add https://pkg.pr.new/@module-federation/enhanced@39467d7

@module-federation/error-codes

pnpm add https://pkg.pr.new/@module-federation/error-codes@39467d7

@module-federation/esbuild

pnpm add https://pkg.pr.new/@module-federation/esbuild@39467d7

@module-federation/managers

pnpm add https://pkg.pr.new/@module-federation/managers@39467d7

@module-federation/manifest

pnpm add https://pkg.pr.new/@module-federation/manifest@39467d7

@module-federation/metro

pnpm add https://pkg.pr.new/@module-federation/metro@39467d7

@module-federation/metro-plugin-rnc-cli

pnpm add https://pkg.pr.new/@module-federation/metro-plugin-rnc-cli@39467d7

@module-federation/metro-plugin-rnef

pnpm add https://pkg.pr.new/@module-federation/metro-plugin-rnef@39467d7

@module-federation/metro-plugin-rock

pnpm add https://pkg.pr.new/@module-federation/metro-plugin-rock@39467d7

@module-federation/modern-js

pnpm add https://pkg.pr.new/@module-federation/modern-js@39467d7

@module-federation/modern-js-v3

pnpm add https://pkg.pr.new/@module-federation/modern-js-v3@39467d7

@module-federation/native-federation-tests

pnpm add https://pkg.pr.new/@module-federation/native-federation-tests@39467d7

@module-federation/native-federation-typescript

pnpm add https://pkg.pr.new/@module-federation/native-federation-typescript@39467d7

@module-federation/nextjs-mf

pnpm add https://pkg.pr.new/@module-federation/nextjs-mf@39467d7

@module-federation/node

pnpm add https://pkg.pr.new/@module-federation/node@39467d7

@module-federation/observability-plugin

pnpm add https://pkg.pr.new/@module-federation/observability-plugin@39467d7

@module-federation/playground

pnpm add https://pkg.pr.new/@module-federation/playground@39467d7

@module-federation/retry-plugin

pnpm add https://pkg.pr.new/@module-federation/retry-plugin@39467d7

@module-federation/rsbuild-plugin

pnpm add https://pkg.pr.new/@module-federation/rsbuild-plugin@39467d7

@module-federation/rspack

pnpm add https://pkg.pr.new/@module-federation/rspack@39467d7

@module-federation/rspress-plugin

pnpm add https://pkg.pr.new/@module-federation/rspress-plugin@39467d7

@module-federation/runtime

pnpm add https://pkg.pr.new/@module-federation/runtime@39467d7

@module-federation/runtime-core

pnpm add https://pkg.pr.new/@module-federation/runtime-core@39467d7

@module-federation/runtime-tools

pnpm add https://pkg.pr.new/@module-federation/runtime-tools@39467d7

@module-federation/sdk

pnpm add https://pkg.pr.new/@module-federation/sdk@39467d7

@module-federation/storybook-addon

pnpm add https://pkg.pr.new/@module-federation/storybook-addon@39467d7

@module-federation/third-party-dts-extractor

pnpm add https://pkg.pr.new/@module-federation/third-party-dts-extractor@39467d7

@module-federation/treeshake-frontend

pnpm add https://pkg.pr.new/@module-federation/treeshake-frontend@39467d7

@module-federation/treeshake-server

pnpm add https://pkg.pr.new/@module-federation/treeshake-server@39467d7

@module-federation/typescript

pnpm add https://pkg.pr.new/@module-federation/typescript@39467d7

@module-federation/utilities

pnpm add https://pkg.pr.new/@module-federation/utilities@39467d7

@module-federation/webpack-bundler-runtime

pnpm add https://pkg.pr.new/@module-federation/webpack-bundler-runtime@39467d7

@module-federation/bridge-react

pnpm add https://pkg.pr.new/@module-federation/bridge-react@39467d7

@module-federation/bridge-react-webpack-plugin

pnpm add https://pkg.pr.new/@module-federation/bridge-react-webpack-plugin@39467d7

@module-federation/bridge-shared

pnpm add https://pkg.pr.new/@module-federation/bridge-shared@39467d7

@module-federation/bridge-vue3

pnpm add https://pkg.pr.new/@module-federation/bridge-vue3@39467d7

@module-federation/inject-external-runtime-core-plugin

pnpm add https://pkg.pr.new/@module-federation/inject-external-runtime-core-plugin@39467d7

commit: 39467d7

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Preview Environment Ready!

Name Status URL
website-new ✅ Active https://nestor-lopez-30608-website-new-core-module-federa-e2ae226... ↗

Details:

  • Latest Commit: 39467d7
  • Created at: 7/24/2026, 10:00:42 AM

@github-actions

Copy link
Copy Markdown
Contributor

Bundle Size Report

7 package(s) changed, 35 unchanged.

Package dist + ESM entry

Package Total dist (raw) Delta ESM gzip Delta
@module-federation/rspress-plugin 30.1 kB +10.5 kB (+53.6%) 5.0 kB +498 B (+10.7%)

Bundle targets

Package Web bundle (gzip) Delta Node bundle (gzip) Delta
@module-federation/cli 2.3 kB -2 B (-0.1%) 2.4 kB -33 B (-1.3%)
@module-federation/core 1.0 kB -1 B (-0.1%) 1.0 kB -34 B (-3.1%)
@module-federation/devtools 30.3 kB -1 B (-0.0%) 30.3 kB -25 B (-0.1%)
@module-federation/enhanced 2.7 kB +3 B (+0.1%) 2.8 kB -45 B (-1.6%)
@module-federation/metro-plugin-rnc-cli 416 B -1 B (-0.2%) 435 B -27 B (-5.8%)
@module-federation/node 9.2 kB no change 9.2 kB -30 B (-0.3%)
@module-federation/rspress-plugin 3.4 kB +315 B (+9.8%) 3.4 kB +315 B (+9.8%)

Consumer scenarios

Scenario Web output (gzip) Delta Node output (gzip) Delta Gap (node-web) Delta
Enhanced remoteEntry 21.4 kB -15 B (-0.1%) 23.1 kB -28 B (-0.1%) +1.7 kB -13 B

Total dist (raw): 35.80 MB (+10.5 kB (+0.0%))
Total ESM gzip: 105.3 kB (+498 B (+0.5%))
Total web bundle (gzip): 233.8 kB (+313 B (+0.1%))
Total node bundle (gzip): 236.5 kB (+121 B (+0.0%))
Tracked ./bundler entry gzip: 556 B (no change)
Tracked ./bundler web bundle (gzip): 4.8 kB (no change)
Tracked ./bundler node bundle (gzip): 4.8 kB (no change)

Bundle sizes are generated with rslib (Rspack). Package-root metrics preserve the historical report. Tracked subpath exports such as ./bundler are measured separately so ENV_TARGET-driven tree-shaking is visible. Bare imports are externalized to keep package-level sizes consistent, and assets are emitted as resources.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant