Skip to content

[stream] Make _readableState and _writableState part of the public API #7629

Closed
@mcollina

Description

@mcollina

Following up from #7077 (comment), and other discussion.

One of the problem that has lead to breaking userland stream modules is related to the fact that they rely on functionality available in _readableState and _writableState that is not documented, and that is the only possible way for solving some issues, like knowing if a stream is in objectMode: true, clearing up the leftover write callbacks, and many other functionalities.

I propose we document, standardize and test a piece of _readableState  and _writableState.

I think we should have been able to spot mafintosh/duplexify#6 before releasing, sigh. @calvinmetcalf @thealphanerd are we setting readable-stream in passthrough mode for citgm run?

I am opening this discussion here rather than in readable-stream because I would like all possible feedback. As @mikeal said, "So, what are we gonna do about streams?" openjs-foundation/summit#16 (comment).

@nodejs/streams we might want probably put this at in our next meeting.

cc @ronkorving @mafintosh

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues that request new features to be added to Node.js.metaIssues and PRs related to the general management of the project.streamIssues and PRs related to the stream subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions