Skip to content

feat(react-server): migrate to @vitejs/plugin-rsc#1332

Draft
hi-ogawa wants to merge 7 commits intomainfrom
feat/react-server-migrate-to-vitejs-plugin-rsc
Draft

feat(react-server): migrate to @vitejs/plugin-rsc#1332
hi-ogawa wants to merge 7 commits intomainfrom
feat/react-server-migrate-to-vitejs-plugin-rsc

Conversation

@hi-ogawa
Copy link
Owner

@hi-ogawa hi-ogawa commented Jan 5, 2026

Summary

Migrate @hiogawa/react-server from @hiogawa/vite-rsc to @vitejs/plugin-rsc.

This is an "all-in" migration where @vitejs/plugin-rsc provides the complete RSC bundler layer:

  • "use client" / "use server" transforms
  • CSS code-splitting and injection
  • Multi-environment build orchestration
  • Runtime helpers (loadModule, loadBootstrapScriptContent, loadCss)

@hiogawa/react-server becomes a thin framework layer on top, keeping only:

  • File-based routing
  • Metadata handling
  • Error handling
  • Request context
  • Prerender
  • Next.js compatibility

See docs/migration-vite-rsc-to-vitejs-plugin-rsc.md for the full migration plan.

Test plan

  • Type checking passes
  • Unit tests pass
  • E2E tests pass
  • Dev server works (HMR for server + client components)
  • Production build works
  • Server actions work (JS-enabled and progressive enhancement)

🤖 Generated with Claude Code

hi-ogawa and others added 7 commits January 5, 2026 15:03
Plan to migrate @hiogawa/react-server from @hiogawa/vite-rsc to
@vitejs/plugin-rsc. This is an "all-in" migration where plugin-rsc
provides the complete RSC bundler layer.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Replace @hiogawa/vite-rsc with @vitejs/plugin-rsc
- Remove custom "use client" and "use server" transform plugins
  (now handled by @vitejs/plugin-rsc)
- Update entry points to import from @vitejs/plugin-rsc/*
- Remove client reference preloading (not supported in native RSC)
  TODO: wakujs/waku#1656
- Simplify PluginStateManager by removing unused reference maps
- Remove manual setRequireModule initialization
  (@vitejs/plugin-rsc auto-initializes)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Mark status as "In Progress"
- Document completed changes
- Document known issues and remaining work:
  - Build orchestration mismatch
  - Route-based client reference tracking broken
  - Virtual module conflicts
  - E2E testing needed

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Removed:
- rscParentPlugin (replaced with frameworkConfigPlugin)
- buildOrchestrationPlugin
- inject-async-local-storage
- validateImportPlugin
- serverDepsConfigPlugin
- serverAssetsPluginServer
- virtual:react-server-build (use import.meta.viteRsc.loadModule)
- client-component/plugin.ts
- server-action/plugin.tsx

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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