-
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
stream: do not use crypto.DEFAULT_ENCODING in lazy_transform.js #24396
Closed
Conversation
This file contains 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
The default encoding can be retrieved via `require('internal/crypto/util').getDefaultEncoding` instead of the deprecated crypto.DEFAULT_ENCODING which triggers a warning. Background: The require chain goes like this: ``` internal/streams/lazy_transform.js -> crypto.js -> internal/crypto/cipher.js (uses LazyTransform in the global scope) -> internal/streams/lazy_transform.js ``` So when `internal/streams/lazy_transform.js` is required before `lib/crypto.js`, we have a circular dependency and since `internal/crypto/cipher.js` uses destructuring to use LazyTransform we will get an error. And it can also trigger a warning if lazy_transform.js is the first file that touches crypto.DEFAULT_ENCODING.
4 tasks
CI: https://ci.nodejs.org/job/node-test-pull-request/18677/ This unblocks #24384 see #24384 (comment) |
On a side note, in general we should strive to avoid requiring non-internal modules in internal modules so that we can load fewer unnecessary modules, because non-internal modules then to have a bigger dependency graph so once you require one of them it could turn into a dominoes game |
refack
approved these changes
Nov 16, 2018
refack
added
lib / src
Issues and PRs related to general changes in the lib or src directory.
fast-track
PRs that do not need to wait for 48 hours to land.
and removed
stream
Issues and PRs related to the stream subsystem.
fast-track
PRs that do not need to wait for 48 hours to land.
labels
Nov 16, 2018
sam-github
approved these changes
Nov 16, 2018
addaleax
approved these changes
Nov 16, 2018
TimothyGu
approved these changes
Nov 16, 2018
cjihrig
approved these changes
Nov 16, 2018
joyeecheung
added
the
author ready
PRs that have at least one approval, no pending requests for changes, and a CI started.
label
Nov 16, 2018
4 tasks
Landed in 413fcad |
Trott
pushed a commit
to Trott/io.js
that referenced
this pull request
Nov 18, 2018
The default encoding can be retrieved via `require('internal/crypto/util').getDefaultEncoding` instead of the deprecated crypto.DEFAULT_ENCODING which triggers a warning. Background: The require chain goes like this: ``` internal/streams/lazy_transform.js -> crypto.js -> internal/crypto/cipher.js (uses LazyTransform in the global scope) -> internal/streams/lazy_transform.js ``` So when `internal/streams/lazy_transform.js` is required before `lib/crypto.js`, we have a circular dependency and since `internal/crypto/cipher.js` uses destructuring to use LazyTransform we will get an error. And it can also trigger a warning if lazy_transform.js is the first file that touches crypto.DEFAULT_ENCODING. PR-URL: nodejs#24396 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
targos
pushed a commit
that referenced
this pull request
Nov 19, 2018
The default encoding can be retrieved via `require('internal/crypto/util').getDefaultEncoding` instead of the deprecated crypto.DEFAULT_ENCODING which triggers a warning. Background: The require chain goes like this: ``` internal/streams/lazy_transform.js -> crypto.js -> internal/crypto/cipher.js (uses LazyTransform in the global scope) -> internal/streams/lazy_transform.js ``` So when `internal/streams/lazy_transform.js` is required before `lib/crypto.js`, we have a circular dependency and since `internal/crypto/cipher.js` uses destructuring to use LazyTransform we will get an error. And it can also trigger a warning if lazy_transform.js is the first file that touches crypto.DEFAULT_ENCODING. PR-URL: #24396 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
rvagg
pushed a commit
that referenced
this pull request
Nov 28, 2018
The default encoding can be retrieved via `require('internal/crypto/util').getDefaultEncoding` instead of the deprecated crypto.DEFAULT_ENCODING which triggers a warning. Background: The require chain goes like this: ``` internal/streams/lazy_transform.js -> crypto.js -> internal/crypto/cipher.js (uses LazyTransform in the global scope) -> internal/streams/lazy_transform.js ``` So when `internal/streams/lazy_transform.js` is required before `lib/crypto.js`, we have a circular dependency and since `internal/crypto/cipher.js` uses destructuring to use LazyTransform we will get an error. And it can also trigger a warning if lazy_transform.js is the first file that touches crypto.DEFAULT_ENCODING. PR-URL: #24396 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This was referenced Dec 7, 2018
codebytere
pushed a commit
that referenced
this pull request
Jan 13, 2019
The default encoding can be retrieved via `require('internal/crypto/util').getDefaultEncoding` instead of the deprecated crypto.DEFAULT_ENCODING which triggers a warning. Background: The require chain goes like this: ``` internal/streams/lazy_transform.js -> crypto.js -> internal/crypto/cipher.js (uses LazyTransform in the global scope) -> internal/streams/lazy_transform.js ``` So when `internal/streams/lazy_transform.js` is required before `lib/crypto.js`, we have a circular dependency and since `internal/crypto/cipher.js` uses destructuring to use LazyTransform we will get an error. And it can also trigger a warning if lazy_transform.js is the first file that touches crypto.DEFAULT_ENCODING. PR-URL: #24396 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
refack
pushed a commit
to refack/node
that referenced
this pull request
Jan 14, 2019
The default encoding can be retrieved via `require('internal/crypto/util').getDefaultEncoding` instead of the deprecated crypto.DEFAULT_ENCODING which triggers a warning. Background: The require chain goes like this: ``` internal/streams/lazy_transform.js -> crypto.js -> internal/crypto/cipher.js (uses LazyTransform in the global scope) -> internal/streams/lazy_transform.js ``` So when `internal/streams/lazy_transform.js` is required before `lib/crypto.js`, we have a circular dependency and since `internal/crypto/cipher.js` uses destructuring to use LazyTransform we will get an error. And it can also trigger a warning if lazy_transform.js is the first file that touches crypto.DEFAULT_ENCODING. PR-URL: nodejs#24396 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Merged
codebytere
pushed a commit
that referenced
this pull request
Jan 29, 2019
The default encoding can be retrieved via `require('internal/crypto/util').getDefaultEncoding` instead of the deprecated crypto.DEFAULT_ENCODING which triggers a warning. Background: The require chain goes like this: ``` internal/streams/lazy_transform.js -> crypto.js -> internal/crypto/cipher.js (uses LazyTransform in the global scope) -> internal/streams/lazy_transform.js ``` So when `internal/streams/lazy_transform.js` is required before `lib/crypto.js`, we have a circular dependency and since `internal/crypto/cipher.js` uses destructuring to use LazyTransform we will get an error. And it can also trigger a warning if lazy_transform.js is the first file that touches crypto.DEFAULT_ENCODING. PR-URL: #24396 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This was referenced Jan 29, 2019
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 pending requests for changes, and a CI started.
crypto
Issues and PRs related to the crypto subsystem.
lib / src
Issues and PRs related to general changes in the lib or src directory.
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.
The default encoding can be retrieved via
require('internal/crypto/util').getDefaultEncoding
instead ofthe deprecated crypto.DEFAULT_ENCODING which triggers a warning.
Background:
The require chain goes like this:
So when
internal/streams/lazy_transform.js
is required beforelib/crypto.js
, we have a circular dependency and sinceinternal/crypto/cipher.js
uses destructuring to use LazyTransformwe will get an error. And it can also trigger a warning if
lazy_transform.js is the first file that touches
crypto.DEFAULT_ENCODING.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes