From 6bba0ee514e76d71f0c911e93fb24d52f276db48 Mon Sep 17 00:00:00 2001 From: Eli Perkins Date: Thu, 25 May 2017 13:22:12 -0400 Subject: [PATCH] Prefer use of a ponyfill for fetch instead of a polyfill This was causing issues on projects targeting React Native, as the isomorphic-fetch polyfill did not support the correct lookup in the packager when determining what `fetch` module to use. See https://github.com/github/fetch/issues/125#issuecomment-169118755, https://github.com/matthew-andrews/isomorphic-fetch/pull/63 --- package.json | 2 +- src/index.js | 2 +- yarn.lock | 25 ++++++++----------------- 3 files changed, 10 insertions(+), 19 deletions(-) diff --git a/package.json b/package.json index 2b790f6..218940d 100644 --- a/package.json +++ b/package.json @@ -53,6 +53,6 @@ }, "dependencies": { "es6-promise": "^4.1.0", - "isomorphic-fetch": "^2.2.1" + "fetch-ponyfill": "^4.0.0" } } diff --git a/src/index.js b/src/index.js index 0a37d66..27287f6 100644 --- a/src/index.js +++ b/src/index.js @@ -1,6 +1,6 @@ /* @flow */ -import 'isomorphic-fetch'; +import { fetch } from 'fetch-ponyfill'; import ClientError from './client_error'; import type { diff --git a/yarn.lock b/yarn.lock index c732c01..845d233 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1662,6 +1662,12 @@ fb-watchman@^2.0.0: dependencies: bser "^2.0.0" +fetch-ponyfill@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/fetch-ponyfill/-/fetch-ponyfill-4.0.0.tgz#18cfe38d69cde42aec71cb3ace79e1f2276293da" + dependencies: + node-fetch "~1.6.0" + figures@^1.3.5: version "1.7.0" resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e" @@ -1979,14 +1985,10 @@ http-signature@~1.1.0: jsprim "^1.2.2" sshpk "^1.7.0" -iconv-lite@0.4.13: +iconv-lite@0.4.13, iconv-lite@~0.4.13: version "0.4.13" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.13.tgz#1f88aba4ab0b1508e8312acc39345f36e992e2f2" -iconv-lite@~0.4.13: - version "0.4.15" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.15.tgz#fe265a218ac6a57cfe854927e9d04c19825eddeb" - ignore@^3.2.0: version "3.2.4" resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.2.4.tgz#4055e03596729a8fabe45a43c100ad5ed815c4e8" @@ -2201,13 +2203,6 @@ isobject@^2.0.0: dependencies: isarray "1.0.0" -isomorphic-fetch@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz#611ae1acf14f5e81f729507472819fe9733558a9" - dependencies: - node-fetch "^1.0.1" - whatwg-fetch ">=0.10.0" - isstream@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" @@ -2760,7 +2755,7 @@ natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" -node-fetch@^1.0.1: +node-fetch@~1.6.0: version "1.6.3" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.6.3.tgz#dc234edd6489982d58e8f0db4f695029abcd8c04" dependencies: @@ -3665,10 +3660,6 @@ whatwg-encoding@^1.0.1: dependencies: iconv-lite "0.4.13" -whatwg-fetch@>=0.10.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.3.tgz#9c84ec2dcf68187ff00bc64e1274b442176e1c84" - whatwg-url@^4.3.0: version "4.5.1" resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-4.5.1.tgz#ba634f630ff0778212c52ea9055d2d061380b1bb"