Closed mcintyre94 closed 2 days ago
Latest commit: bfc86aa1e75380d040828bd1f347131f3ab62ce4
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
Nice!
nit: Since that's all we're exporting, how would feel about exporting the install
function as the default export?
Actually that's probably a nice idea because in the case of Steve's example in the issue, another library has a named install
export. Letting callers name ours themselves probably makes it a bit nicer to use.
This PR refactors the webcrypto polyfill so that all its functionality is in an
install
function. This must be called to enable the polyfill and it is no longer automatically installed by just importing. This gives apps more control over when the polyfill is called.Example:
This will first log "unable to create keypair first time", as the polyfill is not yet installed. It will then log an Ed25519 keypair object created after installing the polyfill.
Fixes #2898