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

feat: drop cross-fetch polyfill dep #127

Merged
merged 2 commits into from
May 28, 2020

Conversation

ilearnio
Copy link
Contributor

It's better if polyfill will be included on the application level rather than having it included by each similar to this vendor package (each may include different polyfill, which turns into bloated app). In my case "cross-fetch" doesn't make sense because I use @babel/polyfill

@gfx
Copy link

gfx commented Feb 26, 2019

+1

It is the application that is responsible for polyfills; libraries should not depend on polyfills.

Copy link
Owner

@jasonkuhrt jasonkuhrt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ilearnio!

@jasonkuhrt jasonkuhrt changed the title Get rid of cross-fetch feat: drop cross-fetch polyfill dep May 28, 2020
@jasonkuhrt jasonkuhrt merged commit c22d4b0 into jasonkuhrt:master May 28, 2020
@schickling
Copy link
Contributor

🎉 This PR is included in version 2.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@tw00
Copy link

tw00 commented May 29, 2020

This breaks out of the box support for Node... ☹️

If you still want to use this library with Node.js you have to do something like this:

const fetch = require('node-fetch');

/* global globalThis */
if (!globalThis.fetch) {
  globalThis.fetch = fetch;
}

...maybe something to mention in the docs.

@SimenB
Copy link
Contributor

SimenB commented May 29, 2020

Ideally it should be possible to pass in a fetch-compliant function rather than having to modify the global environment

@SlothFriend
Copy link

SlothFriend commented Jul 16, 2020

Breaking out of the box Node support isn't good. Would be great if either:

  1. graphql-request worked natively without dependencies out of the box
  2. graphql-request worked out of the box with dependencies
  3. At the very least made it VERY clear in the README that a dependency is needed for use in Node

EDIT:
Ah, I see the note that this will be fixed - thank you!

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

Successfully merging this pull request may close these issues.

None yet

7 participants