-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
api-fetch: Add incremental type checking #29685
Conversation
Size Change: -1 kB (0%) Total Size: 1.4 MB
ℹ️ View Unchanged
|
url?: string; | ||
/** | ||
* @default true | ||
*/ |
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.
Are we sure to be covering all the available options here? As per its docs, we claim to support all fetch()
arguments. At first glance, I see we're missing method
and body
, but there are more for sure.
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.
Yes, as I said in the PR description:
We'll want to continue expanding the definition of ApiFetchRequestProps as we include new middlewares into the type checking
There are several other properties we're missing, the easiest way to cover them all is to add them as we use them (ultimately covering the whole gamut of them when we type the default fetch handler).
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 like a great start towards typing api-fetch
👍 Thanks @sarayourfriend!
Description
Adds incremental type checking to
api-fetch
. We'll want to continue expanding the definition ofApiFetchRequestProps
as we include new middlewares into the type checking. This PR starts with just the basicnonce
middleware.Part of #18838
How has this been tested?
Type checks pass. No runtime changes.
Types of changes
Non-breaking changes.
Checklist: