Skip to content

Remove attempt to require "node:crypto" on Node 18 #348

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

Merged
merged 3 commits into from
Mar 26, 2025
Merged

Conversation

aron
Copy link
Contributor

@aron aron commented Mar 26, 2025

Fixes #273 & #345

The original code was intended to shim in support for the webcrypto interface in Node 18, which was included indirectly as webcrypto in the "node:crypto" module or globally via the --no-experimental-global-webcrypto flag.

This change has caused many issues with bundlers and static analyzers which do not like the obfuscated call to require() see the above tickets.

Node 18 will no longer receive security support as of 30 April 20251 and as such it feels like we can now drop this workaround in favor of documenting the alternative approaches.

The test suite has also been updated to use webcrypto on Node 18.

The original code was intended to shim in support for the webcrypto
interface in Node 18, which was included indirectly as `webcrypto`
in the "node:crypto" module or globally via the
`--no-experimental-global-webcrypto` flag.

This change has caused many issues with bundlers and static analyzers
which do not like the obfuscated call to `require()`.

Node 18 will no longer receive security support as of 30 April 2025[1]
and as such it feels like we can now drop this workaround in favor of
documenting alternative approaches.

[1]: https://endoflife.date/nodejs
@aron aron changed the title remove node crypto Remove attempt to require "node:crypto" on Node 18 Mar 26, 2025
@aron aron force-pushed the remove-node-crypto branch 2 times, most recently from 937058e to 162f294 Compare March 26, 2025 13:22
@aron aron marked this pull request as ready for review March 26, 2025 13:27
@aron aron force-pushed the remove-node-crypto branch from 162f294 to ffbf4fa Compare March 26, 2025 17:02
@aron aron merged commit 37aa363 into main Mar 26, 2025
19 checks passed
@aron aron deleted the remove-node-crypto branch March 26, 2025 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants