exhibitionist-digital / ultra

Zero-Legacy Deno/React Suspense SSR Framework
https://ultrajs.dev
MIT License
2.99k stars 65 forks source link

tech: narrow typings for refactor server handler #280

Closed Danielduel closed 9 months ago

Danielduel commented 9 months ago

I believe both of those renderers exist in the scope of the server.

On in the framework-agnostic land I believe you want to narrow the rendered type to ReadableStream. This typing would work as a return type for React's SSR, but I think it will be better to use their fancy ReactDOMServerReadableStream type.

I think it is ready for merge, running app from ./app works and I can click the button to increment the counter.

Danielduel commented 9 months ago

Just to underline - I want to merge it into refactor branch

Danielduel commented 9 months ago

Forgot the reason behind it: When you stream data you don't stream Elements, but ReadableStream: (the screenshot is from the basic server which uses react, so the wrapped typing is ReactDOMServerReadableStream)

image