This repository was archived by the owner on Apr 4, 2022. It is now read-only.
Remove JSDOM from tests and create polyfilled Node bundle #700
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR modifies the Rollup configuration to emit a Node bundle that replaces calls to browser-specific APIs with polyfilled versions. This is accomplished using
@rollup/plugin-inject
which replaces usage in the global scope with an import statement to the polyfill. This PR polyfillsfetch
,Headers
,FormData
,atob
, andBlob
. TheBlob
polyfill is provided by theblob.js
file included at the root of the repo.The third-party polyfills are marked as
external
, meaning they aren't included in the Node bundle, and need to be installed by consumers. They're marked as optionalpeerDependencies
, which allows consumers to use any version of the polyfills newer or equal to the latest version at the time of this PR. Instructions are included in the README.I've also bumped up the minimum Node version to v10. This enables us to ship ES2018 syntax and APIs to Node.
This PR also contains the changes originally included in #609
Fixes #683, fixes #526, fixes #470