Skip to content

(persisted-fetch) Replace js-sha256 polyfill for Node with Node's Crypto API#807

Merged
kitten merged 6 commits intomasterfrom
fix/remove-polyfill-from-persisted
May 11, 2020
Merged

(persisted-fetch) Replace js-sha256 polyfill for Node with Node's Crypto API#807
kitten merged 6 commits intomasterfrom
fix/remove-polyfill-from-persisted

Conversation

@kitten
Copy link
Copy Markdown
Member

@kitten kitten commented May 11, 2020

Summary

We currently only require js-sha256 for Node.js, but instead we can rely on Node's Native Crypto API.
This is being exposed as the crypto global seemingly, which makes an import/require of crypto superfluous.

Set of changes

  • Remove js-sha256
  • Add Node.js check for Crypto API
  • Add Node.js Crypto API

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 11, 2020

🦋 Changeset is good to go

Latest commit: 3eef83a

We got this.

This PR includes changesets to release 1 package
Name Type
@urql/exchange-persisted-fetch Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@kitten kitten force-pushed the fix/remove-polyfill-from-persisted branch from 1acd6dd to 0104316 Compare May 11, 2020 13:44
As it turns out, the `crypto` global is only available in the REPL.
@kitten kitten force-pushed the fix/remove-polyfill-from-persisted branch from 0104316 to e5eb2f4 Compare May 11, 2020 13:57
Copy link
Copy Markdown
Collaborator

@JoviDeCroock JoviDeCroock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work!

@kitten kitten merged commit b118c2c into master May 11, 2020
@kitten kitten deleted the fix/remove-polyfill-from-persisted branch May 11, 2020 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants