-
Notifications
You must be signed in to change notification settings - Fork 17
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
Fix missing implicit types #211
Fix missing implicit types #211
Conversation
When trying to bundle up the generated code with `tsc --declaration=true`, ts couldn't figure out the disableQuery type and the BaseInfiniteQueryOptions. This is able to be resolved if the exported querys are explicitly typed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey Greg, I believe this is the correct fix, thanks for the contribution!
We did the same in protobuf-es in bufbuild/protobuf-es#398.
I'll defer to @paul-sachs regarding any implementation details.
@@ -74,13 +75,22 @@ const generateServiceFile = | |||
); | |||
f.print(); | |||
|
|||
|
|||
const unaryFunctionType = (method: DescMethod) => [f.import('UnaryFunctions', '@connectrpc/connect-query'), `<${method.input.name}, ${method.output.name}>`] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mckelveygreg This looks good, though I think we can simplify by using the helper type UnaryFunctionsWithHooks
instead of UnaryFunctions<...> & UnaryHooks<...>
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😅 Ha, yeah that is much more straight forward!
Thanks!
## What's Changed * Remove experimental plugin by @paul-sachs in #178 * Add ESM wrapper to avoid dual package hazard by @timostamm in #180 * Fix missing implicit types by @mckelveygreg in #211 ## New Contributors * @mckelveygreg made their first contribution in #211 **Full Changelog**: v0.5.1...v0.5.2
We have really appreciated this lib, and have been using it since it came out! I think I found a typing fix to make it even more usable.
When trying to bundle up the generated code with
tsc --declaration=true
, ts couldn't figure out thedisableQuery
type and theBaseInfiniteQueryOptions
type. This is able to be resolved if the exported queries are explicitly typed.This also will resolve #209 🎉
Let me know if there is anything else I can do to this PR!