Closed LiamMartens closed 5 months ago
I also saw yarn.lock
was updated - but also I saw their are 2 conflicting lockfiles - npm and yarn - wasn't sure which one was the right one - might be worth setting a packageManager
in the package.json
So I love trying to get inference on route params, but not at the price of a breaking change. v4.x is new enough that yet another [breaking] change in the TS signatures this soon would probably be a sign of general instability in the platform.
So unless we can get this in without impacting (in a breaking manner) the existing types, I'm leaning towards closing this for now... 😞
Closing this for now... there are more heavily typed approaches to solving this, but itty aims to be the lightweight version of all the heavy approaches.
Mostly non breaking
Description
Created a new proposal for Itty Router v4 to support route param type inferrence. The only breaking change would be for users who are passing generics to their route handlers I believe (ie:
Router().get<>
) because the path now has toextends string
for type inference to work.Feedback welcome of course
Related Issue
https://github.com/kwhitley/itty-router/pull/150
Type of Change (select one and follow subtasks)