Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

BruceMacD
Copy link
Collaborator

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
Copy link

kwaa commented Aug 25, 2024

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