Uh oh!
There was an error while loading. Please reload this page.
refactor(dev-middleware): drop node-fetch in favor of Node built-in fetch - #45227
refactor(dev-middleware): drop node-fetch in favor of Node built-in fetch#45227byCedric wants to merge 1 commit into
node-fetch in favor of Node built-in fetch#45227Conversation
node-fetch in favor of Node fetchnode-fetch in favor of Node built-in fetchbyCedric
commented
Jun 30, 2024
Why would it fail on |
analysis-bot
commented
Jun 30, 2024
Base commit: c7988c9 |
facebook-github-bot
commented
Jun 30, 2024
@robhogan has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
NickGerleman
commented
Jul 2, 2024
@byCedric if we use this with Node 18, or Node 20, do we get experimental API warnings? |
@NickGerleman No, there should not be any experimental warnings around
That warning was removed in Node 18.13.0, through PR 45287 |
facebook-github-bot
commented
Jul 3, 2024
This pull request was successfully merged by @byCedric in 30a3e6e. When will my fix make it into a release? | How to file a pick request? |
Summary: Removed `node-fetch` in favour of node builtin fetch to get rid of the deprecated `punycode` warning when using Node 22. `react-native/community-cli-plugin` already requires Node >= 18 where it was made available by default (without `--experimental-fetch` flag). This change is similar to the one made in #45227 ## Changelog: [GENERAL] [CHANGED] - Drop node-fetch in favor of Node's built-in fetch from undici in `react-native/community-cli-plugin` Pull Request resolved: #47397 Test Plan: tests pass Reviewed By: blakef Differential Revision: D66512595 Pulled By: NickGerleman fbshipit-source-id: c4e01baf388f9fae8cea7b4bfe25034bff28b461
Summary: Removed `node-fetch` in favour of node builtin fetch to get rid of the deprecated `punycode` warning when using Node 22. `react-native/community-cli-plugin` already requires Node >= 18 where it was made available by default (without `--experimental-fetch` flag). This change is similar to the one made in #45227 ## Changelog: [GENERAL] [CHANGED] - Drop node-fetch in favor of Node's built-in fetch from undici in `react-native/community-cli-plugin` Pull Request resolved: #47397 Test Plan: tests pass Reviewed By: blakef Differential Revision: D66512595 Pulled By: NickGerleman fbshipit-source-id: c4e01baf388f9fae8cea7b4bfe25034bff28b461



Summary:
Node 22 doesn't work well with
node-fetch@2, as one of their polyfills is using the deprecatedpunycodemodule. This causes unnecessary warnings like:Instead of upgrading to the much larger
node-fetch@3, this change dropsnode-fetchin favor of Node's own built-infetchimplementation (using undici).Changelog:
[GENERAL] [CHANGED] - Drop
node-fetchin favor of Node's built-in fetch fromundiciin@react-native/dev-middlewareTest Plan:
See CI for passing tests