Skip to content

feat: add React federation example apps#3

Draft
Nsttt wants to merge 1 commit intomainfrom
codex/react-example-host-remote
Draft

feat: add React federation example apps#3
Nsttt wants to merge 1 commit intomainfrom
codex/react-example-host-remote

Conversation

@Nsttt
Copy link
Copy Markdown
Member

@Nsttt Nsttt commented Mar 31, 2026

What changed

  • add apps/react with one Astro host and one Astro remote using React
  • add root dev:react / build scripts and a small port cleanup helper
  • wire the host to own @astrojs/react, react, and react-dom explicitly
  • update @module-federation/astro SSR local remote resolution to include .tsx and .jsx
  • bump @module-federation/vite to ^1.13.6
  • document the new React example and the host-owned React setup

Why

The repo only had the Astro-to-Astro example. We needed a concrete React remote example that matches the current package contract: no renderer API in @module-federation/astro, host config owns the React renderer setup.

The SSR local remote resolver also skipped .tsx / .jsx, which broke the React remote SSR path when ssr.localRemotes was configured.

Impact

  • contributors now have a runnable host/remote React example under apps/react
  • host SSR works through ssr.localRemotes for React component sources
  • package examples/docs match the intended API direction

Validation

  • pnpm --filter @module-federation/astro test
  • pnpm --filter react-remote build
  • pnpm --filter react-host build
  • pnpm dev:react
  • curl -I http://localhost:4331/
  • curl -I http://localhost:4332/mf-manifest.json

@Nsttt Nsttt changed the title [codex] add React federation example apps feat: add React federation example apps Mar 31, 2026
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