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.
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.
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).
tyxla
left a comment
There was a problem hiding this comment.
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 ofApiFetchRequestPropsas we include new middlewares into the type checking. This PR starts with just the basicnoncemiddleware.Part of #18838
How has this been tested?
Type checks pass. No runtime changes.
Types of changes
Non-breaking changes.
Checklist: