Skip to content

Conversation

@hi-ogawa
Copy link
Contributor

@hi-ogawa hi-ogawa commented Aug 17, 2025

Description

We should avoid saying import * as ReactServer from "@vitejs/plugin-rsc/rsc" since @vitejs/plugin-rsc/rsc re-exports API both from react-server-dom/server.edge and react-server-dom/client.edge.

Replace wildcard imports with specific named imports across examples and documentation:

- @vitejs/plugin-rsc/rsc: renderToReadableStream, createTemporaryReferenceSet, etc.
- @vitejs/plugin-rsc/browser: createFromReadableStream, createFromFetch, etc.
- @vitejs/plugin-rsc/ssr: createFromReadableStream
- react-dom/client: hydrateRoot, createRoot
- react-dom/server.edge: renderToReadableStream

This improves code clarity and import specificity while maintaining full functionality.

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

Co-Authored-By: Claude <noreply@anthropic.com>
@hi-ogawa hi-ogawa changed the title refactor(rsc): replace wildcard imports with named imports chore(rsc): use named imports Aug 17, 2025
@hi-ogawa hi-ogawa marked this pull request as ready for review August 17, 2025 08:09
@hi-ogawa hi-ogawa merged commit ba25233 into main Aug 17, 2025
20 checks passed
@hi-ogawa hi-ogawa deleted the refactor/use-named-imports branch August 17, 2025 08:19
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