Skip to content

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


@brookslybrand brookslybrand deleted the readable-stream branch January 22, 2025 19:49
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

3 participants