@y_nk@tannerlinsley@schanuelmiller@tan_stack@vite_js Yes satisfies keeps the inference but there are also context sensitive functions like `beforeLoad` return is piped into the parameter of `loader` which complicates things and also means the options have to be in a specific order
@tannerlinsley@y_nk@schanuelmiller@tan_stack@vite_js We cannot use explicit types for the whole route definition because it needs to be an inference site. You need to infer from the route definition options users put there. I also prefer explicit types being totally optional for users and not required
@y_nk@tannerlinsley@b_dammylolah@tan_stack This is a context sensitive function so the inference only works in a route definition. Seperate components would need explicit typing
@eliseumds@tannerlinsley@letstri@tan_stack Parsing string literal can be quick and not really a concern here. The challenge with route definitions is they infer from validators and return types. Using a schema validator with good TS perf helps a lot
@eliseumds@tannerlinsley@letstri@tan_stack We basically generate a route tree which is easy for TypeScript to consume but nothing in the route definitions is precompiled. The point is that what you write is fully inferred. The route tree generation sprinkles explicit types to link routes together
@colinhacks@schanuelmiller@tan_stack We have a fast path for empty objects because ` & {}` has a cost. Which for route parent merging happens in TSR. Might not for other libraries
Always bet on TypeScript! Just ran a perf check on the Go implementation in a massive @tan_stack Router project.
Even without JSX (not supported yet), it’s already 3.3× faster than TS 5.8. Promising results! 🚀
@schanuelmiller@stevebeauge@someguys2nd@GabrielVergnaud There are different considerations with larger types and it comes down to how the types are used but this example is quite small, its not going to be slow either way
@AdamRackis@c_horobin He’s a genius. I may have designed a lot of the initial architecture, but he’s the one making things crazy fast and bulletproof. I am now the student of my own library.