protobuf-ts icon indicating copy to clipboard operation
protobuf-ts copied to clipboard

Web stubs not generated if option `client_grpc1` is set

Open Janaka-Steph opened this issue 3 years ago • 1 comments

I would like to generate both web and nodeJS stubs.

This is my config

version: v1
plugins:
  - remote: buf.build/timostamm/plugins/protobuf-ts
    out: src/api-spec/protobuf/gen/js
    opt:
      - client_grpc1
      - add_pb_suffix
      - eslint_disable
      - ts_nocheck

Is it a bug or am I missing something?

Janaka-Steph avatar May 02 '22 17:05 Janaka-Steph

The plugin comes with own custom options that let you specify multiple client styles (see example).

The idea behind this design was to avoid the need for plugin options. Turns out different plugins for the different RPC styles may have been a better choice. Either way, the plugin options we have right now were not intended as the primary mechanism and they do in fact not let you generate multiple styles at the same time.

The available workarounds are the custom options, and simply generating twice.

Thanks for raising this issue! Changing the plugin options to support this use case seems like a good idea.

timostamm avatar May 07 '22 18:05 timostamm