Skip to content

perf: cache generated SSR remote entry source - #1040

Merged
gioboa merged 2 commits into
module-federation:mainfrom
tonoizer:agent/cache-ssr-entry-source
Aug 7, 2026
Merged

perf: cache generated SSR remote entry source#1040
gioboa merged 2 commits into
module-federation:mainfrom
tonoizer:agent/cache-ssr-entry-source

Conversation

@tonoizer

@tonoizer tonoizer commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Cache the generated SSR remote-entry source within each plugin instance.
  • Reuse the stable base source across multiple Rollup outputs.
  • Preserve independent Nuxt expose-chunk rewriting for every output.
  • Add multi-output coverage proving one generation and two correctly rewritten assets.

Motivation

Rollup can invoke output-generation hooks for multiple outputs. The generated SSR entry depends only on normalized federation options, so regenerating the same base source for every output is unnecessary.

Scope

This is intentionally limited to the SSR source-generation path. It does not change environment gating, publication, dev-server behavior, or generated output semantics.

Validation

  • git diff --check
  • Added focused multi-output Nuxt unit coverage.
  • Vitest, typecheck, and formatting could not run in this checkout because node_modules is unavailable.

This is a small optimization; the benefit is proportional to the number of Rollup outputs and may be most useful for multi-output builds.

@tonoizer
tonoizer marked this pull request as ready for review August 6, 2026 21:08
@pkg-pr-new

pkg-pr-new Bot commented Aug 7, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@module-federation/vite@1040

commit: ab4de6a

@gioboa gioboa left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks @tonoizer
Nice one 👏

@gioboa
gioboa merged commit 7af2bea into module-federation:main Aug 7, 2026
19 checks passed
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.

2 participants