Skip to content

Commit 0ec1dfc

Browse files
committed
updated README.
1 parent d278ed6 commit 0ec1dfc

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Universal WHATWG Fetch API for Node, Browsers and React Native. The scenario tha
1010
- **Optional polyfill**: it's up to you if something is going to be added to the global object or not
1111
- **Simple import**: no configuration required
1212
- **WHATWG compliant**: it should be working the same way wherever your code runs
13+
- **Updated**: lastest version of whatwg-fetch and node-fetch used
1314
- **Small**: 2.5kb gzipped
1415

1516

@@ -120,12 +121,17 @@ I did a lot of research in order to find a fetch library that could be simple, c
120121

121122
#### Why not isomorphic-fetch?
122123

123-
My preferred library used to be [isomorphic-fetch](https://github.com/matthew-andrews/isomorphic-fetch) but it has this [bug](https://github.com/matthew-andrews/isomorphic-fetch/issues/125) that prevents it from running in a react native environment. It seems it will never be fixed since the author hasn't been commiting for a year. Also, polyfilling is mandatory.
124+
My preferred library used to be [isomorphic-fetch](https://github.com/matthew-andrews/isomorphic-fetch) but it has this [bug](https://github.com/matthew-andrews/isomorphic-fetch/issues/125) that prevents it from running in a react native environment. It seems it will never be fixed since the author hasn't been commiting for more than a year. That means dependencies are outdated as well.
124125

125126

126-
#### How does it work?
127+
### Why polyfill might not be a good ideia?
127128

128-
cross-fetch (like isomorphic-fetch) is just a proxy. If you're in node, it delivers you the [node-fetch](https://www.npmjs.com/package/node-fetch) library, if you're in a browser ou React Native, it delivers you the github's [whatwg-fetch](https://github.com/github/fetch/). The same strategy applies whether you're using polyfill or ponyfill.
129+
In a word? Risk. If the spec changes in the future, it might be problematic to debug. Read more about it on [sindresorhus's ponyfill](https://github.com/sindresorhus/ponyfill#how-are-ponyfills-better-than-polyfills) page. It's up to you if you're fine with it or not.
130+
131+
132+
#### How does cross-fetch work?
133+
134+
Just like isomorphic-fetch, it is just a proxy. If you're in node, it delivers you the [node-fetch](https://www.npmjs.com/package/node-fetch) library, if you're in a browser ou React Native, it delivers you the github's [whatwg-fetch](https://github.com/github/fetch/). The same strategy applies whether you're using polyfill or ponyfill.
129135

130136

131137
## Supported environments

0 commit comments

Comments
 (0)