Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to renderToReadableStream #152

Closed
wants to merge 2 commits into from
Closed

Conversation

brookslybrand
Copy link
Contributor

Resolves #147

@brookslybrand
Copy link
Contributor Author

I'm not convinced there's much a reason to switch given that we're using node as our server. We can revisit, or if someone wants to put up a PR that works (this one fails when I refresh for some reason), we can reconsider

@kinggoesgaming
Copy link
Contributor

kinggoesgaming commented Jan 7, 2025

So further looking into this, this is specific to platforms that support Web Streams, currently that would Browser (as expected), Deno and Bun.

Node supports ReadableStreams since 16.x.

However since react-dom has minimum version 16 and such does not have ReadableStream in the globalThis object (which happened in 18.x. I believe once react does update its minimum version, we will have it available. 🤞


Edit: Here's the specific export conditions

{
  "exports": {
    "./server": {
      "react-server": "./server.react-server.js",
      "workerd": "./server.edge.js",
      "bun": "./server.bun.js",
      "deno": "./server.browser.js",
      "worker": "./server.browser.js",
      "node": "./server.node.js",
      "edge-light": "./server.edge.js",
      "browser": "./server.browser.js",
      "default": "./server.node.js"
    }
  }
}

server.browser.js, server.bun.js, server.edge.js all have renderToReadableStream implementated. The only oddball funnily enough server.node.js


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.

use renderToReadableStream
2 participants