Skip to content

fix(gateway): Address typings issue for getDefaultFetcher #585

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

Merged
merged 3 commits into from
Mar 18, 2021

Conversation

trevor-scheer
Copy link
Contributor

The Fetcher type isn't quite right here (it's augmented with .defaults() later in its exported life, which is more applicable to our use case.

More importantly, the compiled types lose the following important line in index.d.ts
/// <reference path="../src/make-fetch-happen.d.ts" />
...when the Fetcher type (or typeof fetcher) is used to declare the return type of getDefaultFetcher.

For now, leaving this off is more correct and inferrable by TS anyhow.

@trevor-scheer trevor-scheer requested a review from glasser March 18, 2021 21:12
@trevor-scheer trevor-scheer added the 🧬 typings Updates to type system types label Mar 18, 2021
@trevor-scheer trevor-scheer self-assigned this Mar 18, 2021
Copy link
Member

@glasser glasser left a comment

Choose a reason for hiding this comment

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

The code change is fine (I looked at the CI-produced tarballs and the output looks like it used to in dist/index.d.ts).

I think that you either want to separate the changelog into explicit alpha.1 and alpha.0 sections, or just want to leave out the new changelog entry entirely and perhaps add a reference to this PR #585 to the end of the existing line (since basically this is just a fix for that PR)

@trevor-scheer trevor-scheer merged commit 2716ba1 into release-gateway-0.25.0 Mar 18, 2021
@trevor-scheer trevor-scheer deleted the trevor/fix-fetcher-typings branch March 18, 2021 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧬 typings Updates to type system types
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants