-
Notifications
You must be signed in to change notification settings - Fork 2k
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
apollo-server-env: do less #5515
Conversation
@abernix Thoughts? After this PR, |
And for example, see #5514 which tries to make a change to the Request type... to make it more like node-fetch. Yeah, increasingly convinced that after merging this PR we should just stop using apollo-server-env. One thing that might make this PR or the potential follow-up PR awkward is that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes LGTM.
No strong feelings on the direction you take after this though, but I'm personally somewhat satisfied with requiring a bundler take on the burden of providing a global Fetch-API and WHATWG URL
.
We might want to understand precisely what that burden looks like for, e.g., Deno and Cloudflare though, sure. (And probably document it?)
Deno is an interesting point. I wonder if there is a way to keep the package separate for providing JS implementation, but not have to maintain our own copy of the TypeScript though. I tried half-heartedly to delete all the |
Node 6 support meant we needed to polyfill util.promisify, Object.values, and Object.entries. But we now only support Node 12+. Fixes #5478.
These are both exported from apollo-server-types as well, and almost all of the usages use that package (which doesn't have the special build script setup that apollo-server-env has).
I'm not really sure why this was needed before (probably for Node 6 support?) but tests pass without it now.
592bc2a
to
85a115a
Compare
I thought our types were intentionally a subset of what That was meant to offer compatibility with other fetch implementations like Using the types from the TypeScript |
apollo-server-env is already less useful in Apollo Server 3 because we don't try to support Node 6 and we don't use the global type definitions (https://www.apollographql.com/docs/apollo-server/migration/#apollo-server-envs-global-type-definitions). Turns out we can remove even more from it without much ill effect.