Content
@
https://warpcast.com/~/channel/the-arena
0 reply
0 recast
0 reaction
TOM
@subtlegradient
building /frens Shipped the world’s first(?) realtime streaming subscription based react server renderer infra for native mobile It’s like next.js app router, but for realtime streaming live views instead of a single fire and forget server render pass dramatically pushing the state of the art forward
2 replies
1 recast
8 reactions
Hector
@noctis
If I understand, you're sending components to React Native through a stream, allowing them to be updated in real-time when they are subscribed to a sort of message queue ? Do they come into text format or something React Native can directly render ? Would it be possible to make a live updating graph for token prices? Streaming a rich <svg> component (or anything easily renderable on React Native) to the app so you can see the graph updating in real time?
1 reply
0 recast
0 reaction
TOM
@subtlegradient
The text/x-component content type (aka “RSC”) is an async stream of binary chunks. It’s like a cross between a serialization syntax and an RPC protocol. React repo implements a server side encoder and client side decoder that effectively allows you to send any kind of complex nested asynchronous JavaScript objects across the wire, including references to opaque client objects and opaque references to server objects. It also supports Suspense, promises, asynciterables, etc “RSC” has been used in production at Meta and all Next.js App router apps for a long time. We’ve been using it in /frens for like 7 months with our own custom React Native compatibility layer. Typical server rendered components can load server data as part of the server render response. But then they’re done. There’s nothing like setState or hooks in server components, typically. Until now. We figured out how to make server components stateful and reactively rerender from ALL kinds of realtime data streams 🤫
1 reply
0 recast
2 reactions
Hector
@noctis
That sounds amazing. The research to make that must have been fun. If you have the time, could you link where the server side encoder is implemented in the React repo I'm so curious about this
1 reply
0 recast
1 reaction
TOM
@subtlegradient
https://github.com/facebook/react/tree/main/packages/react-server
0 reply
0 recast
1 reaction