Support React SSR import maps - #8217
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe router core now exposes reusable SSR option types. React Router adds typed import-map support and forwards the configured import map to both React streaming SSR renderers. Tests cover readable and pipeable rendering. ChangesSSR import-map forwarding
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This change passes the configured SSR import map through both React streaming render paths; no actionable merge-blocking risk remains after normal checks and review. Sequence Diagram(s)sequenceDiagram
participant RouterOptions
participant renderRouterToStream
participant ReactDOMServer
RouterOptions->>renderRouterToStream: provide ssr.importMap
renderRouterToStream->>ReactDOMServer: pass importMap to streaming renderer
ReactDOMServer-->>renderRouterToStream: return readable or pipeable stream
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🎯 Changes
Pass the router
ssr.importMapoption through to React's readable and pipeable streaming server renderers.The import map shape is declared by the React router through an extensible core SSR options interface. This keeps router core framework-agnostic and preserves React 18 type compatibility, where
ReactImportMapis not exported by@types/react-dom.Adds coverage for both React streaming paths.
Tests:
pnpm test:eslintpnpm test:typespnpm test:unit✅ Checklist
🚀 Release Impact
Summary by CodeRabbit
New Features
Bug Fixes