Skip to content

Commit e7df8fa

Browse files
robhoganmeta-codesync[bot]
authored andcommitted
Vendor whatwg-fetch@3.6.20 (#56370)
Summary: Pull Request resolved: #56370 Vendor `whatwg-fetch` v3.6.20 directly into `Libraries/Network/`, replacing the npm dependency with a local copy. `whatwg-fetch` has not had a release since December 2023 and appears to be [unmaintained](JakeChampion/fetch#1482), by download numbers `react-native` is the dominant consumer (all this is unsurprising, since `fetch` is natively implemented in every browser). It has several shortcomings we (with the OSS community) could improve on - one important one being that `whatwg-fetch`'s `fetch()` does not resolve immediately on receipt of headers, only on completion. This takes the single source file from the `whatwg-fetch` npm package as `Libraries/Network/whatwg-fetch.js`, and its accompanying types, marking as originally vendored from whatwg-fetch v3.6.20 (Copyright (c) 2014-2023 GitHub, Inc., MIT license). Changelog: [Internal] Reviewed By: huntie Differential Revision: D99854694 fbshipit-source-id: 6e742c47c43d69012841671608cc8b359d20ea91
1 parent 7ee893d commit e7df8fa

File tree

5 files changed

+785
-7
lines changed

5 files changed

+785
-7
lines changed

packages/react-native/Libraries/Network/fetch.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
// side-effectful require() to put fetch,
1414
// Headers, Request, Response in global scope
15-
require('whatwg-fetch');
15+
require('./whatwg-fetch');
1616

1717
export const fetch = global.fetch;
1818
export const Headers = global.Headers;

0 commit comments

Comments
 (0)