question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add `disable_servicetype` option?

See original GitHub issue

I recently upgraded to the latest version of the @protobuf-ts/* packages and updated the option names passed to protoc to their new ones, for instance disable_service_client was renamed to force_client_none; however, I am no longer able to prevent protobuf-ts from generating services in my typescript files.

I have tried to dig into the source code for this package and understand how options for service generation are used, but I can’t seem to find anything that is standing out. I have also tried to remove all other options I was using and only specified force_client_none but to no avail. I have also tried using the client_none option, but again, services are still generated.

I was wondering if anyone else was experiencing this issue, or if anyone else could try to reproduce this.

The full command I am running is:

npx protoc \
    --proto_path="${MY_PATH}" \
    --plugin="protoc-gen-ts=${PROTOC_PATH}" \
    --ts_out="${PROTOC_OUT_DIR}" \
    --ts_opt force_client_none \
    --ts_opt generate_dependencies \
    --ts_opt long_type_string \
    --experimental_allow_proto3_optional \
   ${FILES}

While my protos are generated fine, again, the services are being generated and this is problematic for the project I am working on.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
timostammcommented, Jan 24, 2022

That would be much appreciated.

I think the new option can simply disable the following line with an if-statement:

https://github.com/timostamm/protobuf-ts/blob/e231157836cd03df54d8c4a7a20217fd261fba0e/packages/plugin/src/protobufts-plugin.ts#L301

The new option should be added somewhere here: https://github.com/timostamm/protobuf-ts/blob/e231157836cd03df54d8c4a7a20217fd261fba0e/packages/plugin/src/protobufts-plugin.ts#L82

And then be parsed into the internal options object (which needs a new property) here: https://github.com/timostamm/protobuf-ts/blob/e231157836cd03df54d8c4a7a20217fd261fba0e/packages/plugin/src/our-options.ts#L205

Then it will be available via options.xxx for the if-statement.

The new option probably belongs into the “misc” category (since it is independent of client and server). “disable_servicetype” seems like a fitting name.

1reaction
timostammcommented, Jan 24, 2022

Got it, that’s a good point. If we appended Metadata, it might break existing code for other users.

I wonder if it would have been better to only generate the service metadata if the user opts in with a plugin option - and automatically enable it if the user sets an option that requires it. However, that too is a breaking change, so it would probably be best to do that in v3.

In the meantime, what do you think about an option to disable the generation explicitly? The downside is that it would really only be a temporary option, and be removed in v3.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cisco IOS IP Addressing Services Command Reference
To configure a service-type enumeration period, use the service-type-enumeration period command in multicast Domain Name System (mDNS) ...
Read more >
Configuring AirGroup - Aruba Networks
Enable/Disable service-type of framed-user. In the CLI. To configure the ClearPass Policy Manager server options using the CLI: (host) [mynode] #cd / ...
Read more >
PDF - Oracle Utilities Meter Data Management
Install the Oracle Utilities Service and Measurement Data Foundation ... There are several security configuration options within WebSphere.
Read more >
nsd | Flutter Package - Pub.dev
A Flutter plugin for network service discovery and registration (aka NSD / DNS-SD / Bonjour / mDNS).
Read more >
What Are System Hardening Standards? - RSI Security
Create groups, assign rights to those groups and add users based on ... This testing option usually relies on an automated vulnerability ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found