matthew-andrews / isomorphic-fetch

Isomorphic WHATWG Fetch API, for Node & Browserify
MIT License
6.95k stars 288 forks source link

Add React Native support #80

Closed jou closed 4 years ago

jou commented 8 years ago

Specify a separate entry point for React Native that export React Native's fetch() polyfill. Would that be a more acceptable fix for #63?

lucasfeliciano commented 8 years ago

:+1:

billinghamj commented 8 years ago

Should probably also support this as a fallback to self.

matthew-andrews commented 8 years ago

I believe they're planning to fix this in react native itself

billinghamj commented 8 years ago

@matthew-andrews Could you provide a link to an issue in RN mentioning that? My understanding is that the efficiency of the packager at runtime makes this difficult/impossible.

danginirav commented 8 years ago

Thanks @jou !

thessem commented 8 years ago

Thanks for this

julienvincent commented 8 years ago

👍

Gedzis commented 8 years ago

👍

blackxored commented 8 years ago

What happened to this? I don't see a fix on the RN side (0.32.x) and this is still a present bug.

cybergrind commented 7 years ago

Hey @matthew-andrews could you please merge it, no matter that that is RN issue ... they aren't going fix it in near future

Small example: https://github.com/facebook/react-native/pull/9942

They just **** up their community, so please don't do the same things, it just save time and brain for all your users. Thank you in advance

Connorelsea commented 7 years ago

I really do not think they will be fixing this in React Native any time soon. Can this just be merged? I am still having this issue

cybergrind commented 7 years ago

This project had last commit 10 months ago, so basically it's dead project without any active persons here and a lot of PR and issues. Don't waste your time and just switch to any similar project that contains one line fix for react-native, like: https://github.com/lucasfeliciano/fetch-everywhere / https://www.npmjs.com/package/fetch-everywhere

And has an active maintainer.

paulmelnikow commented 7 years ago

Another good option is fetch-ponyfill. I added the Node support to it last year. It's actively maintained, and has been around for a few years. It doesn't have the React Native one-liner yet but I imagine @qubyte would be down to include it.

It's a ponyfill which means it's safer / more contained. It loads like a well-behaved CommonJS module, without side effects. It doesn't set or replace window.fetch.

sethdenner commented 7 years ago

For those who are interested I forked this project and merged in this PR here: https://github.com/Knotis/portable-fetch. With some minor changes I got this working in my company's react-native app.

Install with NPM via: npm install portable-fetch

madyankin commented 7 years ago

@matthew-andrews please merge this

bherila commented 7 years ago

Please merge... I have switched to @sethdenner 's fork in the meantime. Thank you Seth!!

lquixada commented 7 years ago

For all those seeking for an isomorphic-fetch with React Native support alternative, see cross-fetch. It is updated and also brings optional polyfill.

graphql-request and VulcanJS are already using it.

rajatrawataku1 commented 6 years ago

@sethdenner how do I use portable-fetch in my project. I am using react-navigator which in turn uses isomorhic-fetch?

jou commented 4 years ago

This PR is old enough to speak in full sentences now and still shows up when I check on the statuses of my pull requests at work…

Since the project I needed this for originally has been out of my hands a long time ago and it won't be likely to get any action, I'm closing this.