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

[Discussion] Fetch #126

Closed
wants to merge 1 commit into from
Closed

[Discussion] Fetch #126

wants to merge 1 commit into from

Conversation

jbaxleyiii
Copy link
Contributor

Most modern browsers support fetch natively: link. However, a few of them don't and we want this to be easy for people.

Since fetch is a standard and the polyfill for browsers is pretty small, I think sticking with fetch is the right call.

The issue comes into play when running on the server. Since the primary target of this client is the browser, I'm fine with requiring the developer to add fetch on the server (e.g node-fetch or isomorphic-fetch).

Adding in whatwg-fetch adds 2kb to the compiled output but should make for a uniform usage in browsers and make it easy with one line import 'isomorphic-fetch' to add server support with no changes to the library.

Thoughts?

@stubailo
Copy link
Contributor

Hmm, the server is the place where it most makes sense to always include the polyfill, since nobody cares about loading extra code on the server. So if we are including a client polyfill it makes sense to do the server one too, no?

@jbaxleyiii
Copy link
Contributor Author

@stubailo yeah, I'm just not sure the best way to do that? Isn't that typically part of the tooling?

@stubailo
Copy link
Contributor

It doesn't matter so much to me - it's fine with me if you want to do it that way. I'm not opinionated about who should be including polyfills.

@jbaxleyiii
Copy link
Contributor Author

After further thought, I think polyfill's should be on the end developer instead of this library. They are only additive so we can't add and allow anyone to remove it. I'll add a section to the docs about needed polyfills.

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

Successfully merging this pull request may close these issues.

None yet

2 participants