Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use fetch-everywhere #8

Closed
roman01la opened this issue Jun 21, 2016 · 9 comments
Closed

Use fetch-everywhere #8

roman01la opened this issue Jun 21, 2016 · 9 comments

Comments

@roman01la
Copy link

Hello. I'd like to use this module in React Native. But it's not possible at the moment, because of whatwg-fetch. I've replaced it with fetch-everywhere in my fork. The module supports all kind of environments. I could prepare a PR, what do you think?

@nodkz
Copy link
Collaborator

nodkz commented Jun 21, 2016

fetch-everywhere is not popular, may be exists more common used alternatives?
Anyway whatwg-fetch should die ;)

@nodkz
Copy link
Collaborator

nodkz commented Jun 21, 2016

Please try this popular module https://www.npmjs.com/package/isomorphic-fetch

@roman01la
Copy link
Author

roman01la commented Jun 21, 2016

@nodkz Unfortunately author of that library rejected to adapt it to React Native. It only works in browser and Node. That's why fetch-everywhere was created.

fetch-everywhere is not popular, may be exists more common used alternatives?

I guess fetch-everywhere is not popular because there are not much projects which use React and Relay and share fetching logic between mobile and browser platforms. But since Relay is specific to React, I think it would be fair to include React Native support.

@nodkz
Copy link
Collaborator

nodkz commented Jun 21, 2016

Good. Open PR please with fetch-everywhere. I'll test it on my project, and if all ok I'll bump new version today.

Thanks!!!

@edvinerikson
Copy link
Member

Isn't it better to let the user provide their own polyfill if they need it?

@nodkz
Copy link
Collaborator

nodkz commented Jun 21, 2016

@edvinerikson just remove import 'whatwg-fetch';? Good idea!

For browser whatwg-fetch
For node (server-side rendering) node-fetch
And what people use for react-native - ???

Needs for readme.

@roman01la
Copy link
Author

That's great idea! React Native already includes fetch polyfill.

@nodkz
Copy link
Collaborator

nodkz commented Jun 21, 2016

bumped 1.2.0

@nodkz nodkz closed this as completed Jun 21, 2016
@edvinerikson
Copy link
Member

@nodkz exactly, this is what Relay does with the default network layer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants