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

Request for add new option to support ignore import and do not generate its related code #1020

Open
kakuiho opened this issue Nov 25, 2024 · 1 comment
Labels
Feature New feature or request

Comments

@kakuiho
Copy link

kakuiho commented Nov 25, 2024

see also #1018

You can generate code for the (dependency) imports with this option:

# buf.gen.yaml
inputs:
  - directory: proto
plugins:
  - remote: buf.build/bufbuild/es:v2.2.0
    out: proto
    opt: target=js+dts
+   include_imports: true

Request for add new option to support ignore import and do not generate its related code.

Is it a good idea do not generate its related code with option include_imports: false?

We don't need to generate code for import module in some cases:
https://github.com/tbonesoft/protoc-gen-go-gorm2/blob/v24.12/examples/bookstore/proto/bookstore/v1/bookstore.proto#L26

Originally posted by @kakuiho in #1018 (comment)

@timostamm timostamm added the Feature New feature or request label Nov 25, 2024
@timostamm
Copy link
Member

Thanks for filing the issue. I think the underlying problem here is that you want to use the options in one language, but not in another language. Ideally, it would be possible to only use the option for one language.

Option retention is a potential solution, but it isn't fully supported everywhere, and it means the option would only ever be available during code generation, which might be too limiting.

We don't have a solution for this problem right now, but I think it's a relevant feature. Let's keep this issue open to track it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants