-
Notifications
You must be signed in to change notification settings - Fork 349
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
feat: Allow simultaneous services and generic service definitions #512
Conversation
src/main.ts
Outdated
: isRepeated(field) | ||
? '[]' | ||
: defaultValue(ctx, field); | ||
? '{}' |
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.
prettier did this, not sure if you want to pick it up cause it does make sense.
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.
Ah yeah, not sure, but if prettier did it then yeah let's leave it in.
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.
Nice, using about using an array of options, but otherwise looks great, and thanks for the PR
src/main.ts
Outdated
: isRepeated(field) | ||
? '[]' | ||
: defaultValue(ctx, field); | ||
? '{}' |
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.
Ah yeah, not sure, but if prettier did it then yeah let's leave it in.
src/options.ts
Outdated
@@ -25,6 +25,7 @@ export enum ServiceOption { | |||
GRPC = 'grpc-js', | |||
GENERIC = 'generic-definitions', | |||
DEFAULT = 'default', | |||
GENERIC_AND_SERVICES = 'generic-definitions-and-services', |
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.
Hm, kinda think, let's maybe not add a new definition and instead change options.outServices
to ServiceOption[]
?
I was thinking like outputServices=generic,default
, but ,
is already taken as a separator.
We could list options twice, like outputServices=generic-definitions,outputServices=default
... I just made a fix to snakeToCamel
that provides a precedent for how to support this "nudged to an array" pattern for options:
Does that seem okay?
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.
Great!
Still working on the PR right now ... |
Question about anticipated behavior when someone does a conflicting option with serviceOption=false,serviceOption=default. I'm leaving it as undefined, but open to alternatives. |
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.
Looks great @fizx , thanks!
# [1.107.0](v1.106.2...v1.107.0) (2022-03-04) ### Features * Allow simultaneous services and generic service definitions ([#512](#512)) ([680831e](680831e))
🎉 This PR is included in version 1.107.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Hi, we have this as a use case at my company because we use the basic service interfaces yet need runtime reflection, and have been running for a while.
This patch is backwards compatible and covered by an integration test.
I'm hoping to upstream. Please let me know how I can make it easier to accept the patch!