react-server675fbba4
react-servercommit47813852a72d

feat: render ssr (#400)

Adds a fast path for the case where an app's root module is itself a "use client" boundary. The RSC flight pipeline pays serialization, transport, and deserialization cost on every render even when the flight payload contains nothing but a single client reference — pure overhead for SPA-shaped apps where there is no server tree to bridge. With this change, the runtime detects at startup whether the resolved root module carries the "use client" directive (one property read on REACT_CLIENT_REFERENCE) and, when it does, routes rendering directly through React DOM's renderToReadableStream, skipping the flight pipeline entirely for the lifetime of the process. There is nothing to enable; the same component code works under either pipeline, and authors switch between them by changing only the directive on the entry file.

Author
Viktor Lázár <lazarv1982@gmail.com>
Date
Commit
47813852a72d2f01e983f6d9a601e616607c4b66
34 files changed+2356 -88