lib: enable global WebCrypto by default#42083
Merged
aduh95 merged 2 commits intonodejs:mainfrom Sep 17, 2022
Merged
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Enables
--experimental-global-webcryptoby default, and ensures that the classicnode:cryptocore module is still available in--evalor--printcontexts.Currently this PR takes the route of breaking how the REPL can access the
node:cryptomodule β currently the globalcryptoin REPL refers tonode:crypto, with this PR it now refers to the Web Crypto API.This PR takes the route of keeping
node:cryptoavailable when evaluating a string from a CLI flag (e.g.node -p 'crypto.randomBytes(16).toString("hex")') to avoid breaking the ecosystem (see #41779 (comment)).IMO it makes sense to keep the REPL global
cryptosame as when parsing files, but I don't have a strong opinion and it's easy to change if the consensus disagrees with me.