Closed JK2Kgit closed 1 year ago
Interesting idea but I'm not sure I'm onboard. At Spacedrive we've found that defining component prop types in a way that is decoupled from selection types is more flexible and a better dx, but I'm curious what your use case is?
am gonna just implement this since it's not that hard and doesn't really change much
actually this might be tricky, we'll see how it goes
Hi i Noticed update now My friend (who is responsible for front-end) complained that he needs to copy types for mocking and to functions or alias them outside of file. Mostly dx. Happy to see it done thanks.
I assume you're talking about Erudio, so I checked how you're doing tests and noticed that you're mocking rspc responses. That makes sense, but rather than pass in the types to getData manually I'd suggest using rspc's inferProcedureResult helpers. That way you wouldn't need to use the generated types for include/select, and could also be a lot more certain about the data your tests need.
While using named select and include bindings.ts still generate inline type instead of reference one which leads to less readable/ mockable types.
I suggest that when there is type name provided to select! or include! macro we should use it for generating specta reference type instead of inline type.