-
Notifications
You must be signed in to change notification settings - Fork 30k
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
lib: use destructuring for constants on the top-level module scope #16063
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but be prepared to rebase if it becomes necessary :)
The commit message exceeds the 50 character maximum though. It would be nice if this could be fixed before landing. |
993bbee
to
49f469e
Compare
@BridgeAR I've just shortened the commit message : ) |
Seems reasonable to me. |
lib/_http_client.js
Outdated
parsers, | ||
freeParser, | ||
debug | ||
} = common; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose you can add _checkIsHttpToken: checkIsHttpToken
too here, which would get rid of the only reference to common
in the file other than this one. Also would you mind sorting these in alphabetical order?
lib/_http_server.js
Outdated
CRLF, | ||
continueExpression, | ||
chunkExpression, | ||
httpSocketSetup |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto, but with _checkInvalidHeaderChar
instead.
lib/child_process.js
Outdated
const { | ||
_validateStdio, | ||
setupChannel | ||
} = child_process; | ||
const ChildProcess = exports.ChildProcess = child_process.ChildProcess; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be refactored as well.
49f469e
to
6c53ee8
Compare
Pushed commit to address comments. |
This change is to unify the declaration for constants into using destructuring on the top-level-module scope, reducing some redundant code.
6c53ee8
to
4fa9357
Compare
Landed in 212de3c, thanks! 😃 |
This change is to unify the declaration for constants into using destructuring on the top-level-module scope, reducing some redundant code. PR-URL: #16063 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
This change is to unify the declaration for constants into using destructuring on the top-level-module scope, reducing some redundant code. PR-URL: nodejs/node#16063 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Does this change offer any performance improvements? These kind of large changes are going to create backporting conflicts that will be hard to manage for LTS With that being said this does not land cleanly on 8.x. Would someone be willing to manually backport |
@MylesBorins just submitted backport PR: #16494. The main conflicts that arose had to do with the |
This change is to unify the declaration for constants into using destructuring on the top-level-module scope, reducing some redundant code. PR-URL: #16063 Backport-PR-URL: #16494 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
This change is to unify the declaration for constants into using destructuring on the top-level-module scope, reducing some redundant code. PR-URL: #16063 Backport-PR-URL: #16494 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
I'm not landing this on v6.x But want to once again urge collaborators that would should consider holding off on larger changes like this until v6.x goes into maintenance, this has the potential to cause a bunch of conflicts |
This change is to unify the declaration for constants into using destructuring on the top-level-module scope, reducing some redundant code.
By the way, what about adding
"prefer-destructuring"
into the.eslintrc
?Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
lib