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

stream: add iterator helper find #41849

Merged
merged 2 commits into from Feb 7, 2022

Conversation

Linkgoron
Copy link
Member

@Linkgoron Linkgoron commented Feb 4, 2022

Add find from the iterator-helper tc39 proposal.

I've also simplified some other things:

  • some now uses filter, and doesn't create an additional abort controller
  • this.map calls replaced with map.call <- as calling this.map creates an additional Readable

There is a behaviour change to some/every where stream.destroyed isn't marked as destroyed synchronously, but needs an additional tick.

@Linkgoron Linkgoron requested a review from benjamingr Feb 4, 2022
@nodejs-github-bot
Copy link
Contributor

@nodejs-github-bot nodejs-github-bot commented Feb 4, 2022

Review requested:

doc/api/stream.md Outdated Show resolved Hide resolved
on the stream at once. **Default:** `1`.
* `signal` {AbortSignal} allows destroying the stream if the signal is
aborted.
* Returns: {Promise} a promise evaluating to the first chunk for which `fn`
Copy link
Contributor

@vweevers vweevers Feb 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it "chunk" or "item"? Let's choose one and use that throughout documentation

Copy link
Member Author

@Linkgoron Linkgoron Feb 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want me to change if for every/some as well?

Copy link
Contributor

@vweevers vweevers Feb 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might as well! Fits in this PR because it already touches those.

Copy link
Member Author

@Linkgoron Linkgoron Feb 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed item to chunk in all places except in one unrelated place.

Copy link
Member

@benjamingr benjamingr left a comment

Left some comments, lgtm

@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot

This comment has been minimized.

jasnell
jasnell approved these changes Feb 5, 2022
@nodejs-github-bot
Copy link
Contributor

@nodejs-github-bot nodejs-github-bot commented Feb 5, 2022

Continue iterator-helpers work by adding `find` to readable streams.
Copy link
Member

@mcollina mcollina left a comment

lgtm

@nodejs-github-bot
Copy link
Contributor

@nodejs-github-bot nodejs-github-bot commented Feb 5, 2022

@nodejs-github-bot nodejs-github-bot merged commit 42ad413 into nodejs:master Feb 7, 2022
53 checks passed
@nodejs-github-bot
Copy link
Contributor

@nodejs-github-bot nodejs-github-bot commented Feb 7, 2022

Landed in 42ad413

@ruyadorno
Copy link
Member

@ruyadorno ruyadorno commented Feb 7, 2022

It looks to me that this should be labelled as semver-minor in order for it to be properly picked up by the changelog. Please let me know (and feel free to remove the label) if that's not the case.

Also @Linkgoron should this be marked as a notable-change ?

@Linkgoron
Copy link
Member Author

@Linkgoron Linkgoron commented Feb 8, 2022

It looks to me that this should be labelled as semver-minor in order for it to be properly picked up by the changelog. Please let me know (and feel free to remove the label) if that's not the case.

Also @Linkgoron should this be marked as a notable-change ?

Some and every were, so I assume that it should be.

ruyadorno added a commit that referenced this issue Feb 8, 2022
Continue iterator-helpers work by adding `find` to readable streams.

PR-URL: #41849
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
ruyadorno added a commit that referenced this issue Feb 8, 2022
Notable changes:

lib:
  * (SEMVER-MINOR) add fetch (Michaël Zasso) #41749
module:
  * unflag esm json modules (Geoffrey Booth) #41736
node-api:
  * (SEMVER-MINOR) add node_api_symbol_for() (Darshan Sen) #41329
stream:
  * (SEMVER-MINOR) add iterator helper find (linkgoron) #41849
  * (SEMVER-MINOR) add toArray (Benjamin Gruenbaum) #41553
  * (SEMVER-MINOR) add forEach method (Benjamin Gruenbaum) #41445
  * (SEMVER-MINOR) support some and every (Benjamin Gruenbaum) #41573
deps:
  * upgrade npm to 8.4.1 (npm team) [#41836](#41836)
ruyadorno added a commit that referenced this issue Feb 8, 2022
Notable changes:

lib:
  * (SEMVER-MINOR) add fetch (Michaël Zasso) #41749
module:
  * unflag esm json modules (Geoffrey Booth) #41736
node-api:
  * (SEMVER-MINOR) add node_api_symbol_for() (Darshan Sen) #41329
stream:
  * (SEMVER-MINOR) add iterator helper find (linkgoron) #41849
  * (SEMVER-MINOR) add toArray (Benjamin Gruenbaum) #41553
  * (SEMVER-MINOR) add forEach method (Benjamin Gruenbaum) #41445
  * (SEMVER-MINOR) support some and every (Benjamin Gruenbaum) #41573
deps:
  * upgrade npm to 8.4.1 (npm team) [#41836](#41836)
ruyadorno added a commit that referenced this issue Feb 8, 2022
Notable changes:

lib:
  * (SEMVER-MINOR) add fetch (Michaël Zasso) #41749
module:
  * unflag esm json modules (Geoffrey Booth) #41736
node-api:
  * (SEMVER-MINOR) add node_api_symbol_for() (Darshan Sen) #41329
stream:
  * (SEMVER-MINOR) add iterator helper find (linkgoron) #41849
  * (SEMVER-MINOR) add toArray (Benjamin Gruenbaum) #41553
  * (SEMVER-MINOR) add forEach method (Benjamin Gruenbaum) #41445
  * (SEMVER-MINOR) support some and every (Benjamin Gruenbaum) #41573
deps:
  * upgrade npm to 8.4.1 (npm team) [#41836](#41836)
ruyadorno added a commit that referenced this issue Feb 10, 2022
Notable changes:

lib:
  * (SEMVER-MINOR) add fetch (Michaël Zasso) #41749
module:
  * unflag esm json modules (Geoffrey Booth) #41736
node-api:
  * (SEMVER-MINOR) add node_api_symbol_for() (Darshan Sen) #41329
stream:
  * (SEMVER-MINOR) add iterator helper find (linkgoron) #41849
  * (SEMVER-MINOR) add toArray (Benjamin Gruenbaum) #41553
  * (SEMVER-MINOR) add forEach method (Benjamin Gruenbaum) #41445
  * (SEMVER-MINOR) support some and every (Benjamin Gruenbaum) #41573
deps:
  * upgrade npm to 8.4.1 (npm team) [#41836](#41836)

PR-URL: #41897
ruyadorno added a commit that referenced this issue Feb 10, 2022
Notable changes:

lib:
  * (SEMVER-MINOR) add fetch (Michaël Zasso) #41749
module:
  * unflag esm json modules (Geoffrey Booth) #41736
node-api:
  * (SEMVER-MINOR) add node_api_symbol_for() (Darshan Sen) #41329
stream:
  * (SEMVER-MINOR) add iterator helper find (linkgoron) #41849
  * (SEMVER-MINOR) add toArray (Benjamin Gruenbaum) #41553
  * (SEMVER-MINOR) add forEach method (Benjamin Gruenbaum) #41445
  * (SEMVER-MINOR) support some and every (Benjamin Gruenbaum) #41573
deps:
  * upgrade npm to 8.4.1 (npm team) [#41836](#41836)

PR-URL: #41897
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

7 participants