chore: expose `globalThis.crypto` when not available (#48941)
### What? Exposing `globalThis.crypto`, based on [Node.js' WebCrypto API](https://nodejs.org/api/globals.html#crypto_1) ### Why? Similar to `fetch`, `crypto` is a popular API that is currently not available on `globalThis` in all active Node.js versions yet. This can help library authors to create runtime-agnostic packages. ### How? Node.js already has the WebCrypto API that can be imported, we just expose it on `globalThis` in Node.js versions where this is not available. Closes NEXT-1063 [Slack thread](https://vercel.slack.com/archives/C03KAR5DCKC/p1681821510191059)
Showing
| ... | @@ -249,7 +249,7 @@ | ... | @@ -249,7 +249,7 @@ |
| "@types/react-dom": "18.0.11" | "@types/react-dom": "18.0.11" | ||
| }, | }, | ||
| "engines": { | "engines": { | ||
| "node": ">=16" | "node": ">=16.8.0" | ||
| }, | }, | ||
| "packageManager": "pnpm@7.24.3" | "packageManager": "pnpm@7.24.3" | ||
| } | } |
Please
register
or
sign in
to comment