Skip to content

Commit

Permalink
Prefer use of a ponyfill for fetch instead of a polyfill
Browse files Browse the repository at this point in the history
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 JakeChampion/fetch#125 (comment), matthew-andrews/isomorphic-fetch#63
  • Loading branch information
eliperkins committed May 25, 2017
1 parent e91546d commit 6bba0ee
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 19 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,6 @@
},
"dependencies": {
"es6-promise": "^4.1.0",
"isomorphic-fetch": "^2.2.1"
"fetch-ponyfill": "^4.0.0"
}
}
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @flow */

import 'isomorphic-fetch';
import { fetch } from 'fetch-ponyfill';
import ClientError from './client_error';

import type {
Expand Down
25 changes: 8 additions & 17 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 6bba0ee

Please sign in to comment.