Add missing stream state properties to Flow defs#56224
Closed
Conversation
Summary: Add standard Node.js stream properties to the Flow type definitions for `stream$Readable` and `stream$Writable` that were previously missing: - `stream$Readable`: - [`closed: boolean`](https://nodejs.org/api/stream.html#readableclosed) - [`destroyed: boolean`](https://nodejs.org/api/stream.html#readabledestroyed) - [`errored: ?Error`](https://nodejs.org/api/stream.html#readableerrored) - [`readableEnded: boolean`](https://nodejs.org/api/stream.html#readablereadableended) - [`readableAborted: boolean`](https://nodejs.org/api/stream.html#readablereadableaborted) - [`readableDidRead: boolean`](https://nodejs.org/api/stream.html#readablereadabledidread) - [`readableFlowing: ?boolean`](https://nodejs.org/api/stream.html#readablereadableflowing) - [`readableObjectMode: boolean`](https://nodejs.org/api/stream.html#readablereadableobjectmode) - `stream$Writable`: - [`closed: boolean`](https://nodejs.org/api/stream.html#writableclosed) - [`destroyed: boolean`](https://nodejs.org/api/stream.html#writabledestroyed) - [`errored: ?Error`](https://nodejs.org/api/stream.html#writableerrored) - [`writableEnded: boolean`](https://nodejs.org/api/stream.html#writablewritableended) - [`writableAborted: boolean`](https://nodejs.org/api/stream.html#writablewritableaborted) - [`writableFinished: boolean`](https://nodejs.org/api/stream.html#writablewritablefinished) - [`writableNeedDrain: boolean`](https://nodejs.org/api/stream.html#writablewritableneeddrain) - [`writableObjectMode: boolean`](https://nodejs.org/api/stream.html#writablewritableobjectmode) Docs: https://nodejs.org/api/stream.html These properties exist on all Node.js streams and are needed by Metro to detect when HTTP response streams have been closed by a client disconnect. Changelog: [Internal] Differential Revision: D98176491
|
This pull request has been merged in 402001f. |
Collaborator
|
This pull request was successfully merged by @robhogan in 402001f When will my fix make it into a release? | How to file a pick request? |
meta-codesync bot
pushed a commit
to facebook/metro
that referenced
this pull request
Mar 25, 2026
Summary: X-link: facebook/react-native#56224 Add standard Node.js stream properties to the Flow type definitions for `stream$Readable` and `stream$Writable` that were previously missing: - `stream$Readable`: - [`closed: boolean`](https://nodejs.org/api/stream.html#readableclosed) - [`destroyed: boolean`](https://nodejs.org/api/stream.html#readabledestroyed) - [`errored: ?Error`](https://nodejs.org/api/stream.html#readableerrored) - [`readableEnded: boolean`](https://nodejs.org/api/stream.html#readablereadableended) - [`readableAborted: boolean`](https://nodejs.org/api/stream.html#readablereadableaborted) - [`readableDidRead: boolean`](https://nodejs.org/api/stream.html#readablereadabledidread) - [`readableFlowing: ?boolean`](https://nodejs.org/api/stream.html#readablereadableflowing) - [`readableObjectMode: boolean`](https://nodejs.org/api/stream.html#readablereadableobjectmode) - `stream$Writable`: - [`closed: boolean`](https://nodejs.org/api/stream.html#writableclosed) - [`destroyed: boolean`](https://nodejs.org/api/stream.html#writabledestroyed) - [`errored: ?Error`](https://nodejs.org/api/stream.html#writableerrored) - [`writableEnded: boolean`](https://nodejs.org/api/stream.html#writablewritableended) - [`writableAborted: boolean`](https://nodejs.org/api/stream.html#writablewritableaborted) - [`writableFinished: boolean`](https://nodejs.org/api/stream.html#writablewritablefinished) - [`writableNeedDrain: boolean`](https://nodejs.org/api/stream.html#writablewritableneeddrain) - [`writableObjectMode: boolean`](https://nodejs.org/api/stream.html#writablewritableobjectmode) Docs: https://nodejs.org/api/stream.html These properties exist on all Node.js streams and are needed by Metro to detect when HTTP response streams have been closed by a client disconnect. Changelog: [Internal] Reviewed By: christophpurrer Differential Revision: D98176491 fbshipit-source-id: 2407367c52e5ece9099289ffd18642bdc4a7047d
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Add standard Node.js stream properties to the Flow type definitions for
stream$Readableandstream$Writablethat were previously missing:stream$Readable:closed: booleandestroyed: booleanerrored: ?ErrorreadableEnded: booleanreadableAborted: booleanreadableDidRead: booleanreadableFlowing: ?booleanreadableObjectMode: booleanstream$Writable:closed: booleandestroyed: booleanerrored: ?ErrorwritableEnded: booleanwritableAborted: booleanwritableFinished: booleanwritableNeedDrain: booleanwritableObjectMode: booleanDocs: https://nodejs.org/api/stream.html
These properties exist on all Node.js streams and are needed by Metro to detect when HTTP response streams have been closed by a client disconnect.
Changelog: [Internal]
Differential Revision: D98176491