Open mikemaccana opened 11 months ago
I'm a huge fan of making Node LTS+ the requirement, I added this in few packages but seem to have missed some others.
"engine": {
"node": ">=17.4"
},
I don't know that there's much benefit at this point to churning everyone on the current web3.js. Might as well churn the API and the Node requirement all at once.
What about browsers though?
On the latest Chrome this is an error:
await window.crypto.subtle.generateKey('Ed25519', false, ['sign'])
Uncaught DOMException: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name
Seems to be behind a feature flag on Chrome: https://chromestatus.com/feature/4913922408710144
Caniuse doesn't seem to have this nuance, but from a quick check Firefox also doesn't work, Safari does.
When you try to use generateKeyPair()
in the new library, the error message tells you to install and import @solana/webcrypto-ed25519-polyfill
.
Motivation
node 16 is already end of life. Current web3.js includes polyfills for
fetch
and for Ed25519 inglobal.crypto
. Current supported versions of node have bothfetch
and (from SL on Twitter) Ed25519 support.Details
Downsides:
Upsides:
engines
in thepackage.json
can be used to specify minimum node versions.