FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

stream: refactor streams by VoltrexKeyva · Pull Request #41871 · nodejs/node · GitHub

/ node Public

stream: refactor streams - #41871

Closed
VoltrexKeyva wants to merge 3 commits into
nodejs:masterfrom
VoltrexKeyva:refactor-streams
Closed

stream: refactor streams#41871
VoltrexKeyva wants to merge 3 commits into
nodejs:masterfrom
VoltrexKeyva:refactor-streams

Conversation

VoltrexKeyva commented Feb 6, 2022
edited
Loading

Copy link
Copy Markdown
Contributor
  • Use the standard for loop style instead of for..of for consistency.
  • Refactor to use more validators.
  • Avoid using deprecated APIs.

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/streams

nodejs-github-bot added the needs-ci PRs that need a full CI run. label Feb 6, 2022
VoltrexKeyva added the stream Issues and PRs related to the stream subsystem. label Feb 6, 2022

mcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

lgtm

Comment thread lib/internal/streams/readable.js Outdated

This comment was marked as outdated.

This comment was marked as outdated.

aduh95 commented Feb 6, 2022

Copy link
Copy Markdown
Contributor

Can we use a less scary commit message? 😅

VoltrexKeyva commented Feb 6, 2022
edited
Loading

Copy link
Copy Markdown
Contributor Author

Can we use a less scary commit message? 😅

I'm unsure what you mean by that, do you mean the commit message title? If so, what do you suggest we use instead? (Or if that was a joke :^))

Copy link
Copy Markdown
Collaborator

aduh95 commented Feb 6, 2022

Copy link
Copy Markdown
Contributor

If so, what do you suggest we use instead?

Regarding the commit title, I suggest: stream: refactor to use more validators and avoid using deprecated APIs.

refactor streams is a bit too broad, and could imply the commit is doing a complete refactor of the stream API.

Comment thread lib/internal/streams/duplex.js Outdated

Copy link
Copy Markdown
Contributor Author

If so, what do you suggest we use instead?

Regarding the commit title, I suggest: stream: refactor to use more validators and avoid using deprecated APIs.

refactor streams is a bit too broad, and could imply the commit is doing a complete refactor of the stream API.

That exceeds the 50 character limit for commit message titles (because of our linters), and these changes touch upon multiple files, which is why I chose to use refactor streams, I don't think there's a replacement for the current commit message title that explains the changes without exceeding the character limit?

aduh95 commented Feb 6, 2022

Copy link
Copy Markdown
Contributor

That exceeds the 50 character limit for commit message titles (because of our linters)

It doesn't exceed our 72 character limit so we're good. Another (better?) solution would be to split this into three separate commits.

Mesteery commented Feb 6, 2022
edited
Loading

Copy link
Copy Markdown
Contributor

Maybe you can split this commit into 3 commits (+ commit-queue-rebase), for example:

  • stream: refactor to use more validators
  • stream: use for loop instead of for-of loop (including the block statement removal and aduh's suggestion)
  • stream: replace the use of static listenerCount

(I'm too slow 👀😄)

Comment thread lib/internal/streams/operators.js Outdated
VoltrexKeyva force-pushed the refactor-streams branch 2 times, most recently from 1251528 to 57e292d Compare February 7, 2022 07:41
nodejs-github-bot pushed a commit that referenced this pull request Feb 11, 2022
Use the standard `for` loop style instead of `for..of` for
consistency.

PR-URL: #41871
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
nodejs-github-bot pushed a commit that referenced this pull request Feb 11, 2022
Use more validators where appropriate for consistency.

PR-URL: #41871
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
nodejs-github-bot pushed a commit that referenced this pull request Feb 11, 2022
Avoid usage of the `events.listenerCount()` method as it is
deprecated.

PR-URL: #41871
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
VoltrexKeyva deleted the refactor-streams branch February 11, 2022 11:52
bengl pushed a commit to bengl/node that referenced this pull request Feb 21, 2022
Use the standard `for` loop style instead of `for..of` for
consistency.

PR-URL: nodejs#41871
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
bengl pushed a commit to bengl/node that referenced this pull request Feb 21, 2022
Use more validators where appropriate for consistency.

PR-URL: nodejs#41871
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
bengl pushed a commit to bengl/node that referenced this pull request Feb 21, 2022
Avoid usage of the `events.listenerCount()` method as it is
deprecated.

PR-URL: nodejs#41871
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
bengl pushed a commit to bengl/node that referenced this pull request Feb 21, 2022
Use the standard `for` loop style instead of `for..of` for
consistency.

PR-URL: nodejs#41871
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
bengl pushed a commit to bengl/node that referenced this pull request Feb 21, 2022
Use more validators where appropriate for consistency.

PR-URL: nodejs#41871
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
bengl pushed a commit to bengl/node that referenced this pull request Feb 21, 2022
Avoid usage of the `events.listenerCount()` method as it is
deprecated.

PR-URL: nodejs#41871
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
bengl mentioned this pull request Feb 21, 2022
bengl pushed a commit that referenced this pull request Feb 22, 2022
Use the standard `for` loop style instead of `for..of` for
consistency.

PR-URL: #41871
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
bengl pushed a commit that referenced this pull request Feb 22, 2022
Use more validators where appropriate for consistency.

PR-URL: #41871
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
bengl pushed a commit that referenced this pull request Feb 22, 2022
Avoid usage of the `events.listenerCount()` method as it is
deprecated.

PR-URL: #41871
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>

Copy link
Copy Markdown
Contributor

@VoltrexMaster this doesn't land cleanly in 16.x - do you mind making a backport PR?

Copy link
Copy Markdown
Contributor Author

@VoltrexMaster this doesn't land cleanly in 16.x - do you mind making a backport PR?

What's blocking it from landing cleanly? I don't see anything that should be changed to land on v16.x

targos pushed a commit that referenced this pull request Jul 12, 2022
Use the standard `for` loop style instead of `for..of` for
consistency.

PR-URL: #41871
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
targos pushed a commit that referenced this pull request Jul 12, 2022
Use more validators where appropriate for consistency.

PR-URL: #41871
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
targos pushed a commit that referenced this pull request Jul 12, 2022
Avoid usage of the `events.listenerCount()` method as it is
deprecated.

PR-URL: #41871
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
targos pushed a commit that referenced this pull request Jul 31, 2022
Use the standard `for` loop style instead of `for..of` for
consistency.

PR-URL: #41871
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
targos pushed a commit that referenced this pull request Jul 31, 2022
Use more validators where appropriate for consistency.

PR-URL: #41871
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
targos pushed a commit that referenced this pull request Jul 31, 2022
Avoid usage of the `events.listenerCount()` method as it is
deprecated.

PR-URL: #41871
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
guangwong pushed a commit to noslate-project/node that referenced this pull request Oct 10, 2022
Use the standard `for` loop style instead of `for..of` for
consistency.

PR-URL: nodejs/node#41871
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
guangwong pushed a commit to noslate-project/node that referenced this pull request Oct 10, 2022
Use more validators where appropriate for consistency.

PR-URL: nodejs/node#41871
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
guangwong pushed a commit to noslate-project/node that referenced this pull request Oct 10, 2022
Avoid usage of the `events.listenerCount()` method as it is
deprecated.

PR-URL: nodejs/node#41871
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
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

Labels

author ready PRs that have at least one approval, no outstanding review comments, and a CI started. commit-queue-rebase Add this label to allow the Commit Queue to land a PR in several commits. stream Issues and PRs related to the stream subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.


Back | FazBrowse Home | New Git URL