-
Notifications
You must be signed in to change notification settings - Fork 468
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
Make apollo-env
a standard TS package
#1611
Conversation
This commit removes all of the extraneous work being done for compiling apollo-env's global `fetch` types. To accomplish this, `apollo-env` was converted to a standard TS project using references, just as the other packages are implemented within this repo.
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.
This looks excellent! Thanks for working on this! No need to make any changes, but I've just left some notes just the same.
// ): Promise<Response>; | ||
// } | ||
|
||
export type RequestAgent = HttpAgent | HttpsAgent; |
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.
I'm not sure we use this anywhere, but I think it's okay to leave it for now.
|
||
// export type RequestRedirect = "follow" | "error" | "manual"; | ||
|
||
export type ReferrerPolicy = |
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.
I also don't think we use this anywhere, but let's leave it for now.
|
||
// export type BodyInit = ArrayBuffer | ArrayBufferView | string; | ||
|
||
export { |
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.
We could alternatively just import these directly from node-fetch
, but this is a great improvement right now.
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.
🎉🎉
I'm not sure what is going on with the azure pipelines fail here... all the jobs pass. Feel free to ignore that |
I think earlier node versions may need the apollo-env polyfill. It works on my machine with node v8 but this is a CI test.
* Make apollo-env a standard TS project This commit removes all of the extraneous work being done for compiling apollo-env's global `fetch` types. To accomplish this, `apollo-env` was converted to a standard TS project using references, just as the other packages are implemented within this repo. * Cleanup extraneous env-ci at the top-level * Add polyfill setup step for jest * Remove unused script I think earlier node versions may need the apollo-env polyfill. It works on my machine with node v8 but this is a CI test. * Add apollo-env as a setup file for packages that use the polyfill * Remove apollo-env from swift codegen dependencies
The purpose of this PR is to simplify the build step of the tooling monorepo by implementing
apollo-env
as another project reference just as the others are.apollo-env
has been a notoriously bad citizen of this monorepo, especially for developers who aren't familiar with the quirks of this particular setup. It's removed hours of productivity even for those who are well acquainted with said quirks. For example, the need for frequentnpm run clean && npm ci
is really a requirement for development, but is an unexpected quirk and serious time sink - and this really just marks the simplest case.This cleans up all things
apollo-env
to the best of my ability:apollo-env
as a project dependency when it is unusedapollo-env
before everything elsefetch
typesThe last bullet is a major question mark to me - as my understanding of this whole workaround is for the sake of these handwritten types. I don't see the value that they add, but I'll defer to those with more knowledge of the history here @martijnwalraven and possibly @abernix.
TODO:
*Make sure changelog entries note which project(s) has been affected. See older entries for examples on what this looks like.