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

Removed dom lib dependency. #100

Closed
wants to merge 3 commits into from
Closed

Conversation

kallaspriit
Copy link

Included the required type definitions along with the project.

@kallaspriit
Copy link
Author

Addresses #26.

@schmod
Copy link

schmod commented Mar 25, 2019

any updates on getting this merged?

@schickling
Copy link
Contributor

🎉 This issue has been resolved in version 2.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

jasonkuhrt added a commit that referenced this pull request May 29, 2020
closes #15
closes #26
Relates to #100
Relates to #108

This approach was originally implemented by @kallaspriit in #100.

This approach ships TypeScript types inline with this library rather
than relying on global fetch types in lib.dom.d.ts.

The benefits of this approach are:

1. It avoids consumers (direct or indirect) needing to add `dom` to
   their lib setting in tsconfig. This can be very confusing for Node
   projects and adds legitimate room for error since it allows any DOM
   globals to be used in the Node app which is almost certainly wrong.
2. The file-directive approach (see #108) fails in two ways:
    1. If consumers customize lib config but leave out `dom` things
       break just the same.
    2. It adds dom globals which is bad but now in a very
       unexpected/hidden way.
3. It aligns well with our ponyfill (not polyfill) approach.

The downsides of this approach are:

1. We aren't benefiting from improvements in the TS lib types. So
   improvements to fetch typing for example would not pass through to
   graphql-request users transparently. It would require a new release
   of graphql-request.
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

3 participants