-
-
Notifications
You must be signed in to change notification settings - Fork 805
Better typed fetch/$fetch and routes #2758
Copy link
Copy link
Open
Labels
Description
Context, work, and explanation by @danielroe: #1532
We are thinking of improving (auto-generated) typed fetch. This requires adopting a new standard/reusable type utility for fetch, which @danielroe is working on. By using the new layer, we can improve performance and consistency and adopt it in several places instead of directly being in nitro core (benefiting nuxt, and in the next steps ofetch and h3 typed fetch support.)
Update: unjs/fetchdts is WIP project for better basis replacement.
Relevant linked issues: (some might be doable in next steps)
$fetchreturn type isanyif generics are passed to event handler #3507- Expose a type infered from route response based on route name (NitroFetchRequest) and http method #3355
$fetchinfered type forDateis wrong #2689- NitroRoute Serialize Type #2583
- Typescript shows
serveroption doesn't exist for generic form of $fetch #1937 - Type inference and code execution interrupted by undocumented SerializeObject #1138
- $fetch type safety for query and body parameters #938
- Types for route inputs #841
- TS error
Excessive stack depth comparing typeswhen trying to wrap$fetch#470 - PUT, PATCH, and DELETE requests nuxt/nuxt#19077 (comment)
Reactions are currently unavailable