Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Named Specta types in select! and include! - Feature Request #216

Closed
JK2Kgit opened this issue Dec 2, 2022 · 4 comments · Fixed by #227
Closed

Named Specta types in select! and include! - Feature Request #216

JK2Kgit opened this issue Dec 2, 2022 · 4 comments · Fixed by #227

Comments

@JK2Kgit
Copy link

JK2Kgit commented Dec 2, 2022

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.

@Brendonovich
Copy link
Owner

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?

@Brendonovich
Copy link
Owner

Brendonovich commented Dec 17, 2022

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

@Brendonovich Brendonovich linked a pull request Dec 17, 2022 that will close this issue
@Brendonovich Brendonovich added this to the 0.6.4 milestone Dec 17, 2022
@JK2Kgit
Copy link
Author

JK2Kgit commented Dec 18, 2022

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.

@Brendonovich
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants