-
Notifications
You must be signed in to change notification settings - Fork 32
Use fetch-ponyfill instead of isomorphic-fetch #23
Conversation
4cf4103
to
7636af3
Compare
@ctavan another potential option here is to assume |
@jbaxleyiii assuming fetch is present (plus the already existing option of being able to pass I would even prefer that variant since I think it's more future-proof and would allow to keep the library code of I guess it's up to you to decide whether this breaking change can be forced upon the I think the major argument against it was, that people could not notice this during development because they typically use a modern browser and not IE11. However I would argue that it is rather the duty of the developer who uses After all people who can afford to build their projects only for modern browsers would even benefit from not having a fetch polyfill or ponyfill strictly bundled into So from my side: big 👍 for simply expecting |
@ctavan I think with the 2.0 we may be able to make that the case since we are moving to links fully. Lets think on this a bit before closing in that favor though |
@jbaxleyiii since apollographql/apollo-client#1941 looks like it's getting more and more mature, I wanted to warm up the discussion here again. Has there been more discussion on the apollo-team side w.r.t. dropping the fetch polyfill in 2.0? The more I think about it the more I believe this should really be done. For those who want the old behavior we could simply provide an additional Given that anyone who upgrades to apollo-client 2.0 will have to upgrade the initialization code to use |
7636af3
to
19258bb
Compare
@jbaxleyiii FYI I gave it a try in #30. Let me know what you think. |
Use a fetch ponyfill instead of modifying the global scope and polyfilling the fetch API. Closes apollographql#22.
19258bb
to
6ab610a
Compare
I believe that bundling a ponyfill doesn't make any sense. I think it makes much more sense to require See #30 |
Use a fetch ponyfill instead of modifying the global scope and
polyfilling the fetch API.
Closes #22.
I believe that the current state where
apollo-fetch
imports aisomorphic-fetch
and thus modifies the global scope is a behavior that a library should not have. I would like to useapollo-client
within another library myself and I do not want to pollute the globale scope of they sites who will use my library.The most straightforward change I can think is to use
fetch-ponyfill
internally by default which should have essentially the same effect thanisomorphic-fetch
since it also uses eithernode-fetch
on the server orwhatwg-fetch
on the browser under the hood, just likeisomorphic-fetch
does.TODO:
If this PR is a new feature, reference an issue where a consensus about the design was reached (not necessary for small changes)If this was a change that affects the external API, update the docs and post a link to the PR in the discussionReferences: