Skip to content

Commit

Permalink
refactor(community-cli-plugin): use node builtin fetch (#47397)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jbroma authored and facebook-github-bot committed Nov 27, 2024
1 parent 1d909ef commit 881d8a7
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 3 deletions.
1 change: 0 additions & 1 deletion packages/community-cli-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
"metro": "^0.81.0",
"metro-config": "^0.81.0",
"metro-core": "^0.81.0",
"node-fetch": "^2.2.0",
"readline": "^1.3.0",
"semver": "^7.1.3"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import type TerminalReporter from 'metro/src/lib/TerminalReporter';

import chalk from 'chalk';
import fetch from 'node-fetch';

type PageDescription = $ReadOnly<{
id: string,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
*/

import net from 'net';
import fetch from 'node-fetch';

/**
* Determine whether we can run the dev server.
Expand Down

0 comments on commit 881d8a7

Please sign in to comment.