Skip to content

Conversation

@unstubbable
Copy link
Collaborator

For Edge Flight servers, that use Web Streams, we're defining the debugChannel option as:

debugChannel?: {readable?: ReadableStream, writable?: WritableStream, ...}

Whereas for Node.js Flight servers, that use Node.js Streams, we're defining it as:

debugChannel?: Readable | Writable | Duplex | WebSocket

For the Edge Flight clients, there is currently only one direction of the debug channel supported, so we define the option as:

debugChannel?: {readable?: ReadableStream, ...}

Consequently, for the Node.js Flight clients, we define the option as:

debugChannel?: Readable

The presence of a readable debug channel is passed to the Flight client internally via the hasReadable flag on the internal debugChannel option. For the Node.js clients, that flag was accidentally derived from the public option debugChannel.readable, which is conceptually incorrect, because debugChannel is a Readable stream, not an options
object with a readable property. However, a Readable also has a readable property, which is a boolean that indicates whether the stream is in a readable state. This meant that the hasReadable flag was incidentally still set correctly. Regardless, this was confusing and unintentional, so we're now fixing it to always set hasReadable to true when a debugChannel is provided to the Node.js clients. We'll revisit this in case we ever add support for writable debug channels in Node.js (and Edge) clients.

For Edge Flight servers, that use Web Streams, we're defining the
`debugChannel` option as:

```
debugChannel?: {readable?: ReadableStream, writable?: WritableStream, ...}
```

Whereas for Node.js Flight servers, that use Node.js Streams, we're
defining it as:

```
debugChannel?: Readable | Writable | Duplex | WebSocket
```

For the Edge Flight clients, there is currently only one direction of
the debug channel supported, so we define the option as:

```
debugChannel?: {readable?: ReadableStream, ...}
```

Consequently, for the Node.js Flight clients, we define the option as:

```
debugChannel?: Readable
```

The presence of a readable debug channel is passed to the Flight client
internally via the `hasReadable` flag on the internal `debugChannel`
option. For the Node.js clients, that flag was accidentally derived from
the public option `debugChannel.readable`, which is conceptually
incorrect, because `debugChannel` is a `Readable` stream, not an options
object with a `readable` property. However, a `Readable` also has a
`readable` property, which is a boolean that indicates whether the
stream is in a readable state. This meant that the `hasReadable` flag
was incidentally still set correctly. Regardless, this was confusing and
unintentional, so we're now fixing it to always set `hasReadable` to
`true` when a `debugChannel` is provided to the Node.js clients. We'll
revisit this in case we ever add support for writable debug channels in
Node.js (and Edge) clients.
@meta-cla meta-cla bot added the CLA Signed label Nov 4, 2025
@github-actions github-actions bot added the React Core Team Opened by a member of the React Core Team label Nov 4, 2025
@react-sizebot
Copy link

Comparing: edd05f1...1340a57

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.js = 6.68 kB 6.68 kB +0.11% 1.83 kB 1.83 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 606.23 kB 606.23 kB = 107.38 kB 107.38 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.69 kB 6.69 kB +0.11% 1.83 kB 1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 665.20 kB 665.20 kB = 117.26 kB 117.26 kB
facebook-www/ReactDOM-prod.classic.js = 690.02 kB 690.02 kB = 121.46 kB 121.46 kB
facebook-www/ReactDOM-prod.modern.js = 680.45 kB 680.45 kB = 119.84 kB 119.85 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against 1340a57

@unstubbable unstubbable merged commit f646e8f into facebook:main Nov 4, 2025
249 checks passed
@unstubbable unstubbable deleted the fix-debug-channel-has-readable-flag-node-clients branch November 4, 2025 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed React Core Team Opened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants