-
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
Plugin output scheme #4
Comments
We're looking at buf/alpha/registry/v1alpha1/organization.proto, right? The current scheme is:
With the plugin option The proposed scheme is:
Typically, plugins generate one file per Protobuf input file. Generating multiple output files from one input file can be problematic because names cannot be predicted for bazel. We decided to prefer short import symbol names over support for bazel. The new scheme doesn't seem to change anything in this regard, but if it improves DX with more legible file paths, it can still be a worthwhile change. IMO lower_snake_case is a better fit for file names. I wonder:
|
@timostamm All fair questions. I'm not convinced that the slightly simpler structure is worth a great deal of additional breaking changes. With the incoming v2, it also might be relatively moot anyways, since connect-query APIs will be compatible with generated code from connect so we might not even need anything special. |
Do you mean that the plugin becomes less important because it will be possible to use @bufbuild/protoc-gen-es generated descriptors? For example: import { ElizaService } from "./gen/eliza_pb.ts";
useQuery(ElizaService.method.say); And that it therefore may not be worth it to put much effort into it? I think we should either remove the plugin or continue to improve it. But I'd be fine with waiting for user feedback regarding the new option to reference descriptors, and postpone the decision for after v2. |
Less an issue and more of a discussion point. I've noticed the scheme for our generated file structure looks like:
I love that we can just import the specific methods we use, which can reduce bundle size, but I wonder about the scheme of
{service}-{serviceName}_connectquery
. Since this is effectively an api surface, maybe it makes sense to instead do:This way we can stay consistent with our existing plugins which generate one file/folder for each protofile. And we can just nest the multiple services inside.
The text was updated successfully, but these errors were encountered: