Valibot return types slow down TS check #754
gynekolog
started this conversation in
Show and tell
Replies: 1 comment
-
I've been investigating the performance issue because ts check increased from 7s to 24s on the @tanstack/react-router 0.0.1-beta.194. The 0.0.1-beta.193 is fine in my private app but not in the stackblitz example. There's something weird with the types. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I use valibot (validation library, similiar like zod) for search params validation.
Since @tanstack/react-router 0.0.1-beta.188 the valibot infer types of validation schema hit the typescript performance. Not immediately but each set of search values with function decreases TS speed.
Workaround is to define the return type manually 😞
You can check the issue on stackblitz.
Take a look at the
validateSearch
inaboutRoute
. Try uncommenting prepared variants with handwritten types or zod.You can use
pnpm run typecheck
to compare check times.Beta Was this translation helpful? Give feedback.
All reactions