Skip to content
New issue

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

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

Already on GitHub? # to your account

Replace fetchpolyfills with native fetch / undici #145

Open
talentlessguy opened this issue Jan 18, 2025 · 0 comments
Open

Replace fetchpolyfills with native fetch / undici #145

talentlessguy opened this issue Jan 18, 2025 · 0 comments
Labels
umbrella issue This issue contains a list of dependents of a package and tracks the progress in each

Comments

@talentlessguy
Copy link

talentlessguy commented Jan 18, 2025

fetch is available since node v18

Things to take into consideration

  • node.js fetch only supports proxies through env vars
  • node.js fetch doesn't support passing a custom http.Agent

for folks who need http agent or proxy support, node-fetch-native is available.

Total list of fetch polyfill packages

  • node-fetch
  • cross-fetch
  • @web-std/fetch
  • unfetch
  • isomorphic-unfetch
  • @whatwg-node/fetch
  • node-fetch-commonjs
  • whatwg-fetch
bunx github:Fuzzyma/e18e-tools node-fetch -n 100 -U https://npm.devminer.xyz/registry -q -o md
# Downloads Traffic Version Package PR Minimum Node version
1 69.72M 2211.51 GB ^2.6.12 cross-fetch
2 57.15M 1812.81 GB ^2.6.9 gaxios googleapis/gaxios#625
3 27.78M 881.11 GB ^2.6.7 @mapbox/node-pre-gyp
4 27.59M 875.22 GB ^2.6.9 teeny-request deprecated
5 24.64M 781.58 GB ^2.7.0 google-gax v14
6 21.62M 685.72 GB ^2.6.1 isomorphic-fetch
7 16.91M 536.43 GB ^2.6.7 @sentry/cli
8 14.25M 452.17 GB ^2.6.1 @nuxtjs/opencollective
9 11.72M 371.75 GB ^2.6.1 @ardatan/sync-fetch
10 9.98M 316.58 GB ^3.2.0 isomorphic-unfetch
11 9.98M 316.49 GB ^2.6.7 openai openai/openai-node#1237
12 7.30M 231.63 GB ^2.2.0 @react-native/community-cli-plugin
13 6.84M 216.87 GB ^2.6.7 @azure/core-http deprecated
14 6.11M 193.72 GB ^2.6.1 swagger2openapi
15 5.98M 189.60 GB ^2.6.7 apollo-server-env
16 5.46M 173.17 GB 2.6.7 lerna
17 5.38M 170.57 GB 2.6.7 @lerna/create
18 5.28M 167.43 GB ^2.6.1 @redocly/openapi-core
19 4.94M 156.82 GB ^2.6.11 @serverless/utils
20 4.55M 144.33 GB ^2.6.7 @apollo/server
21 4.48M 142.09 GB ^2.6.7 @storybook/manager-webpack4
22 4.28M 135.66 GB ^2.6.7 @azure/ms-rest-js
23 4.11M 130.46 GB ^2.2.0 metro-inspector-proxy
24 4.04M 128.10 GB ^2.6.8 @serverless/dashboard-plugin
25 3.74M 118.51 GB ^3.3.2 geckodriver
26 3.40M 107.89 GB ^2.6.7 @vue/cli-shared-utils
27 3.22M 102.15 GB ^2.6.7 npm-registry-utilities
28 2.91M 92.32 GB ^2.6.1 @expo/rudder-sdk-node
29 2.80M 88.68 GB ^2.6.7 @storybook/manager-webpack5
30 2.75M 87.36 GB 2.6.9 @vercel/node
31 2.68M 84.98 GB ^2.6.7 @microsoft/signalr
32 2.68M 84.92 GB ^2.6.7 @anthropic-ai/sdk anthropics/anthropic-sdk-typescript#645
33 2.66M 84.26 GB ^3.3.2 edgedriver v18
34 2.64M 83.77 GB ^2.6.0 @stoplight/json-ref-readers
35 2.55M 81.02 GB ^2.6.7 @stoplight/spectral-runtime
36 2.43M 77.08 GB ^2.6.1 jsforce v18
37 2.42M 76.65 GB ^3.3.2 sync-fetch v18
38 2.33M 73.89 GB ^2.6.7 @segment/analytics-next
39 2.32M 73.64 GB 2.6.7 @vercel/fun v16
40 2.25M 71.44 GB ^2.6.1 @redocly/cli Redocly/redocly-cli#1848
41 2.15M 68.16 GB ^2.6.7 danger v18
42 2.13M 67.44 GB ^3.3.2 serverless-offline
43 2.10M 66.76 GB ^2.6.7 firebase-tools
44 2.00M 63.43 GB ^2.6.7 @segment/analytics-node v18
45 1.99M 63.24 GB 2.6.7 @asyncapi/parser
46 1.98M 62.67 GB ^2.7.0 @solana/web3.js
47 1.86M 59.03 GB ^2.6.1 @lerna/gitlab-client
48 1.81M 57.53 GB ^2.3.0 @pulumi/kubernetes
49 1.79M 56.87 GB ^2.6.1 pusher
50 1.57M 49.84 GB ^2.6.1 @notionhq/client
51 1.47M 46.71 GB ^2.6.1 apollo-env
52 1.46M 46.40 GB ^2.6.0 @hubspot/api-client
53 1.41M 44.86 GB 2.6.7 @applitools/core
54 1.33M 42.23 GB ^1.7.3 slackup
55 1.32M 41.83 GB 3.3.1 @applitools/req
56 1.28M 40.71 GB ^2.5.0 @changesets/get-github-info
57 1.27M 40.13 GB ^2.6.7 @applitools/execution-grid-tunnel
58 1.25M 39.59 GB 2.6.7 @microsoft/rush-lib
59 1.23M 39.07 GB ^2.6.0 npm-api
60 1.17M 37.25 GB ^2.6.11 gatsby
61 1.16M 36.73 GB ^2.6.11 gatsby-cli
62 1.15M 36.41 GB ~2.6.1 @tensorflow/tfjs-core
63 1.14M 36.30 GB 2.7.0 elevenlabs elevenlabs/elevenlabs-js#134
64 1.12M 35.69 GB 2.6.7 @rushstack/rush-amazon-s3-build-cache-plugin
65 1.09M 34.44 GB 2.6.7 @rushstack/rush-http-build-cache-plugin
66 1.07M 34.03 GB ^2.6.7 cross-undici-fetch
67 1.03M 32.64 GB ^2.6.13 statsig-node
68 979.06k 31.06 GB ^2.6.1 ruhend-scraper
69 976.75k 30.98 GB ^2.6.1 @jsforce/jsforce-node
70 958.97k 30.42 GB ^2.7.0 @splitsoftware/splitio
71 927.32k 29.42 GB ~2.6.1 fetch-ponyfill
72 887.00k 28.14 GB ^2.7.0 @backstage/backend-common
73 844.76k 26.80 GB 2.6.8 verdaccio-audit
74 843.81k 26.77 GB 2.7.0 checkpoint-client
75 826.05k 26.20 GB ^2.6.7 @apollo/gateway v14.15
76 788.83k 25.02 GB ^3.3.2 ky-universal deprecated in favor of ky
77 755.35k 23.96 GB ^2.6.7 airtable
78 726.79k 23.06 GB ^2.6.6 pkg-fetch deprecated
79 716.09k 22.72 GB ^2.6.0 @expo/dev-server
80 711.38k 22.57 GB ^2.7.0 pubnub
81 681.81k 21.63 GB ^3.0.0 netlify
82 664.98k 21.09 GB ^3.3.1 @netlify/config
83 663.96k 21.06 GB ^2.6.7 cloudflare v18
84 660.48k 20.95 GB 2.6.7 @lerna/legacy-package-management
85 643.05k 20.40 GB ^2.6.7 vega-loader
86 642.34k 20.38 GB ^2.6.1 svix-fetch
87 642.04k 20.37 GB ^2.7.0 @backstage/plugin-auth-node
88 632.16k 20.05 GB ^2.6.0 image-to-base64
89 630.46k 20.00 GB ^2.6.7 @electron-forge/core
90 618.84k 19.63 GB ^3.3.2 @netlify/build
91 603.59k 19.15 GB 3.3.2 netlify-cli
92 597.50k 18.95 GB ^3.1.1 @netlify/edge-bundler
93 573.86k 18.20 GB ^2.6.1 auto-changelog v8.3
94 558.35k 17.71 GB ^2.7.0 @backstage/backend-app-api
95 554.75k 17.60 GB ^2.6.1 serverless-plugin-datadog
96 547.80k 17.38 GB ^2.6.0 expo-server-sdk
97 547.52k 17.37 GB ^2.6.7 @eth-optimism/core-utils
98 546.09k 17.32 GB ^3.3.1 gh-release-fetch v14.18
99 546.06k 17.32 GB ^2.6.7 @angular-architects/module-federation
100 545.46k 17.30 GB ^2.7.0 @renovatebot/osv-offline

cross-fetch:

# Downloads Traffic Version Package PR
1 30.76M 679.92 GB ^3.1.5 fbjs
2 5.57M 123.18 GB ^3.0.4 jest-fetch-mock
3 4.52M 99.93 GB 4.0.0 i18next-http-backend
4 3.45M 76.36 GB ^3.1.5 @datadog/datadog-api-client
5 2.36M 52.27 GB ^4.0.0 web3-providers-http
6 1.97M 43.51 GB ^3.1.5 @okta/okta-auth-js
7 1.24M 27.49 GB ^3.1.4 @walletconnect/jsonrpc-http-connection WalletConnect/walletconnect-utils#217
8 812.37k 17.96 GB ^4.0.0 @backstage/plugin-permission-common
9 749.99k 16.58 GB ^4.0.0 @metamask/sdk
10 716.48k 15.84 GB ^3.0.2 @cubejs-client/core
11 705.99k 15.61 GB ^4.0.0 quicktype-core
12 549.65k 12.15 GB ^3.1.5 @coral-xyz/anchor
13 548.61k 12.13 GB ^4.0.0 @backstage/integration
14 522.61k 11.55 GB ^3.0.6 @pagerduty/pdjs
15 511.63k 11.31 GB ^4.0.0 @backstage/catalog-client
16 506.34k 11.19 GB ^4.0.0 @simplewebauthn/server
17 498.70k 11.02 GB ^4.0.0 cypress-downloadfile
18 465.07k 10.28 GB ^3.1.5 @stoplight/json-schema-generator
19 462.28k 10.22 GB ^4.0.0 botframework-connector
20 447.37k 9.89 GB 3.1.5 link-preview-js OP-Engineering/link-preview-js#163

@web-std/fetch:

# Downloads Traffic Version Package
1 32.85k 2.19 GB ^4.2.1 @modern-js/server-core
2 26.74k 1.78 GB ^4.1.2 nft.storage
3 15.28k 1.02 GB ^4.1.0 w3name
4 11.46k 763.40 MB ^4.1.2 web3.storage
5 6.63k 441.66 MB ^3.0.3 @filebase/client

unfetch:

# Downloads Traffic Version Package
1 9.98M 87.48 GB ^5.0.0 isomorphic-unfetch
2 2.33M 20.42 GB ^4.1.0 @segment/analytics-next
3 2.29M 20.04 GB ^3.1.1 @segment/analytics.js-video-plugins
4 958.97k 8.41 GB ^4.2.0 @splitsoftware/splitio
5 836.48k 7.33 GB ^4.2.0 idtoken-verifier
6 805.44k 7.06 GB ^5.0.0 @nuxt/vue-app
7 551.52k 4.83 GB 4.1.0 @amplitude/experiment-js-client
8 105.48k 924.62 MB ^4.2.0 @splitsoftware/splitio-browserjs
9 96.06k 842.05 MB ^4.2.0 @amplitude/experiment-react-native-client
10 71.19k 624.02 MB ^4.2.0 @plasmicapp/isomorphic-unfetch

isomorphic-unfetch

# Downloads Traffic Version Package PR Minimum Node Version
1 3.78M 5.57 GB ^3.0.0 amazon-cognito-identity-js
2 687.25k 1.01 GB ^3.1.0 @linear/sdk
3 291.18k 428.91 MB ^3.1.0 @near-js/providers near/near-api-js#1450 v20.15
4 211.51k 311.55 MB ^3.1.0 @near-js/accounts near/near-api-js#1450 v20.15
5 136.57k 201.16 MB 4.0.2 @umijs/test
6 127.05k 187.14 MB ^3.1.0 @walletconnect/auth-client
7 78.55k 115.71 MB ^3.1.0 mailersend
8 65.75k 96.84 MB ^3.0.0 next-with-apollo
9 62.26k 91.70 MB ^3.1.0 @prismicio/vue

@whatwg-node/fetch:

# Downloads Traffic Version Package
1 15.83M 168.86 GB ^0.10.0 @graphql-tools/url-loader
2 13.08M 139.47 GB ^0.10.0 @graphql-tools/executor-http
3 11.53M 122.91 GB ^0.10.0 @graphql-tools/github-loader
4 11.48M 122.41 GB ^0.9.20 @graphql-codegen/cli
5 11.31M 120.59 GB ^0.10.0 @graphql-tools/apollo-engine-loader
6 11.05M 117.86 GB ^0.10.0 @graphql-tools/prisma-loader
7 1.96M 20.87 GB ^0.10.0 @whatwg-node/server
8 1.79M 19.10 GB ^0.10.1 graphql-yoga
9 241.86k 2.58 GB ^0.10.0 @graphql-mesh/utils
10 216.94k 2.31 GB 0.9.21 @graphql-hive/core
11 147.60k 1.57 GB ^0.10.0 @graphql-mesh/runtime
12 105.67k 1.13 GB ^0.10.0 @graphql-mesh/config
13 101.28k 1.08 GB ^0.10.0 fets
14 87.24k 930.37 MB ^0.10.0 @omnigraph/json-schema
15 85.84k 915.41 MB ^0.10.0 @graphql-tools/federation
16 83.96k 895.38 MB ^0.8.4 @graphprotocol/graph-cli
17 63.55k 677.70 MB ^0.9.0 @envelop/response-cache
18 55.53k 592.17 MB 0.9.21 @redwoodjs/api
19 55.00k 586.48 MB 0.9.21 @redwoodjs/telemetry
20 53.76k 573.30 MB 0.9.21 @redwoodjs/web

node-fetch-commonjs

# Downloads Traffic Version Package
1 2.39M 152.10 GB ^3.3.2 swagger-client
2 96.98k 6.18 GB ^3.3.2 live-plugin-manager
3 21.66k 1.38 GB ^3.2.4 @apideck/node
4 6.91k 440.26 MB ^3.1.1 semantic-release-ms-teams
5 2.06k 131.10 MB ^3.3.2 @expressen/tallahassee

whatwg-fetch

# Downloads Traffic Version Package
1 21.62M 291.09 GB ^3.4.1 isomorphic-fetch
2 13.22M 178.01 GB ^3.6.2 react-app-polyfill
3 11.48M 154.63 GB ^3.0.0 react-native
4 2.62M 35.24 GB ^3.6.2 @vue/cli-service
5 1.50M 20.14 GB 2.0.4 @firebase/polyfill
6 699.12k 9.41 GB ^3.6.19 storybook-addon-mock
7 642.34k 8.65 GB ^3.4.1 svix-fetch
8 315.81k 4.25 GB ^3.6.20 ollama
9 308.73k 4.16 GB ^3.6.2 ember-fetch
10 252.98k 3.41 GB ^3.0.0 react-native-windows
@Fuzzyma Fuzzyma added the umbrella issue This issue contains a list of dependents of a package and tracks the progress in each label Jan 18, 2025
@talentlessguy talentlessguy changed the title Replace node-fetch with native fetch / undici Replace fetchpolyfills (node-fetch, cross-fetch, @web-std/fetch) with native fetch / undici Jan 19, 2025
@talentlessguy talentlessguy changed the title Replace fetchpolyfills (node-fetch, cross-fetch, @web-std/fetch) with native fetch / undici Replace fetchpolyfills with native fetch / undici Jan 19, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
umbrella issue This issue contains a list of dependents of a package and tracks the progress in each
Projects
None yet
Development

No branches or pull requests

3 participants
@Fuzzyma @talentlessguy and others