| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
I am reluctant to introduce new APIs for a legacy feature; this is really just here to support old applications (pre-2012!). Like, I’m totally 👍 on the deprecation. But if you want to retrieve a string in a specific encoding, you should pass that option explicitly when calling then function anyway. |
Sorry, something went wrong.
|
So I know, is that -1 reluctant or -0 reluctant? |
Sorry, something went wrong.
|
@jasnell That is -1 unless there’s a good reason that I don’t see, which is totally possible. |
Sorry, something went wrong.
|
Ok. Fwiw, these methods already exist as the getter/setter. The only additional cost is the overhead of introducing new public API. Let's see how others feel about it, ok? |
Sorry, something went wrong.
There was a problem hiding this comment.
#crypto_crypto_defaultencoding -> #crypto_crypto_default_encoding?
Sorry, something went wrong.
There was a problem hiding this comment.
@jasnell This wasn't fixed in the «nits»-fix commit ;-)
https://nodejs.org/api/crypto.html#crypto_crypto_default_encoding is the actual link, so it indeed should be crypto.html#crypto_crypto_default_encoding .
Sorry, something went wrong.
There was a problem hiding this comment.
Can we keep this wording consistent with other messages by changing it to this?:
The [`crypto.DEFAULT_ENCODING`][] property is deprecated. Please use `crypto.getDefaultEncoding()` and `crypto.setDefaultEncoding()` instead.
Sorry, something went wrong.
There was a problem hiding this comment.
Just marking this with the red X so my objection doesn’t get lost
Sorry, something went wrong.
|
I would prefer we deprecate this and remove it in 11. Unless this feature is needed by some very popular module, in which case we might have to do what you propose. |
Sorry, something went wrong.
|
fwiw if its needed by some very popular module we can just ping the author and ask them to refactor the calls |
Sorry, something went wrong.
|
Ok, so that brings up the next question: instead of docs-deprecation-with-replacement, should we just go with a full runtime deprecation of the property and not worry about replacing it? |
Sorry, something went wrong.
There was a problem hiding this comment.
This property was added 5 years ago as a temporary measure, documented for future deprecation in 2015 (in 6.0 release). I'm pretty sure we don't want to introduce a new API around it, unless there is some valid usecase that we would want to support and are missing.
+1 to doc or runtime deprecation.
Sorry, something went wrong.
|
The usage seems to be really low, I'm for runtime-deprecation. |
Sorry, something went wrong.
|
Updated to use a runtime deprecation with no new API exposed. |
Sorry, something went wrong.
There was a problem hiding this comment.
avoided
Sorry, something went wrong.
There was a problem hiding this comment.
ditto
Sorry, something went wrong.
There was a problem hiding this comment.
remove this line?
Sorry, something went wrong.
There was a problem hiding this comment.
this change does not seem to be directly related to the deprecation
Sorry, something went wrong.
There was a problem hiding this comment.
This should probably go into a separate PR if still wanted.
Sorry, something went wrong.
There was a problem hiding this comment.
Ah, right, yeah. missed this.
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM with already mentioned nits and undoing (or explaining) changes in util.js.
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
|
CI: https://ci.nodejs.org/job/node-test-pull-request/12758/ |
Sorry, something went wrong.
Sorry, something went wrong.
|
CI looks good, although there is an issue with the arm build bots |
Sorry, something went wrong.
Runtime deprecate the crypto.DEFAULT_ENCODING property. This is specifically in preparation for eventual ESM support Refs: nodejs#18131
|
New CI, just to be safe: https://ci.nodejs.org/job/node-test-pull-request/12863/ |
Sorry, something went wrong.
|
Build bot failures on multiple CI bots but otherwise ok. |
Sorry, something went wrong.
Runtime deprecate the crypto.DEFAULT_ENCODING property. This is specifically in preparation for eventual ESM support Refs: #18131 PR-URL: #18333 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Minwoo Jung <minwoo@nodesource.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Missed when landing nodejs#18333
Runtime deprecate the crypto.DEFAULT_ENCODING property. This is specifically in preparation for eventual ESM support Refs: nodejs#18131 PR-URL: nodejs#18333 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Minwoo Jung <minwoo@nodesource.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Citing 76b0bdf from 2012, "only use this as a temporary measure." Getting or setting DEFAULT_ENCODING has emitted a warning ever since Node.js 10, so it seems appropriate to remove it in Node.js 20 five years later. The last Node.js version that did not emit a warning reached its end-of-life status at the end of 2019. This commit only removes the public API so that the change can land in time for Node.js 20. Refs: nodejs/node-v0.x-archive#4179 Refs: nodejs#18333
Citing 76b0bdf from 2012, "only use this as a temporary measure." Getting or setting DEFAULT_ENCODING has emitted a warning ever since Node.js 10, so it seems appropriate to remove it in Node.js 20 five years later. The last Node.js version that did not emit a warning reached its end-of-life status at the end of 2019. This commit only removes the public API so that the change can land in time for Node.js 20. Refs: nodejs/node-v0.x-archive#4179 Refs: #18333 PR-URL: #47182 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Beth Griggs <bethanyngriggs@gmail.com> Reviewed-By: Erick Wendel <erick.workspace@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
| Back | FazBrowse Home | New Git URL |
Docs-only Runtime deprecate the crypto.DEFAULT_ENCODING and replace by directly exposing the getDefaultEncoding/setDefaultEncoding functions that are used as it's getter and setter.
This is specifically in preparation for eventual ESM support
Refs: #18131
Checklist
Affected core subsystem(s)
crypto