Skip to content

dynamic import of whatwg-fetch to allow environments without it#134

Open
BruceMacD wants to merge 1 commit into
mainfrom
brucemacd/whatwg
Open

dynamic import of whatwg-fetch to allow environments without it#134
BruceMacD wants to merge 1 commit into
mainfrom
brucemacd/whatwg

Conversation

@BruceMacD

Copy link
Copy Markdown
Member

Got over-zealous on the last change to make fetch a dynamic import. This change allows for the same functionality as #125 but it keeps whatwg-fetch rather than replacing it with node-fetch. This preserves current behavior.

@kwaa

kwaa commented Aug 25, 2024

Copy link
Copy Markdown

Maybe also make whatwg-fetch an optional dependency to prevent users who don't need it from installing it?

# package.json
{
- "dependencies": {
-   "whatwg-fetch": "^3.6.20"
- }
+ "peerDependencies": {
+   "whatwg-fetch": "^3.6.20"
+ },
+ "peerDependenciesMeta": {
+   "whatwg-fetch": {
+     "optional": true
+   }
+ }
}

https://caniuse.com/fetch

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