Skip to content

How to use Protocol Buffers from JavaScript #201

Closed

Description

@prestonvanloon

Any plans for this? I haven't been able to find a build rule from bazel that provides static code generation for nodejs with protobufs.

https://github.com/grpc/grpc/tree/v1.11.x/examples/node/static_codegen

I have seen the example from https://github.com/pubref/rules_protobuf, but that depends on a different set of rules for node.

Activity

  1. alexeagle commented on May 12, 2018

    @alexeagle
    Collaborator

    See the comment on your linked issue - there is ts_proto_library now, does this do what you need?

    If not can you help me understand what you'd expect a node_proto_library to do? Just to yield generated JS files containing client-side library for working with protos?

    I think it would be useful for the grpc team to own more of the TypeScript story...

    Also, I think we are juggling a few different related issues between here and rules_typescript - it would be easier for me to follow the thread if you could close some as duplicates...

  2. prestonvanloon commented on May 12, 2018

    @prestonvanloon
    Author

    Sorry about that. I did open a few since I was trying to build a nodejs service that used grpc and was written in typescript.

    ts_proto_library might allow me to use the proto for typescript libraries, but I expect there is still a use case for javascript libraries to want to depend on the generated JS for protobufs.

    This issue is opened to support the latter case of js libraries.

  3. changed the title [-]node_proto_library?[/-] [+]How to use Protocol Buffers from JavaScript[/+] on May 12, 2018
  4. alexeagle commented on May 12, 2018

    @alexeagle
    Collaborator

    One possibility is just to use ts_proto_library and throw away the .d.ts outputs.
    Another option is to hook up the same dcodeio/protobuf.js library in this repo, but only wire up the .js outputs.
    Or maybe we should just wrap the grpc library as a bazel rule.

    I think @mrmeku is the lead on this.

  5. github-actions commented on Nov 19, 2020

    @github-actions
    Contributor

    This issue has been automatically marked as stale because it has not had any activity for 90 days. It will be closed if no further activity occurs in two weeks. Collaborators can add a "cleanup" or "need: discussion" label to keep it open indefinitely. Thanks for your contributions to rules_nodejs!

  6. added
    Can Close?
    on Nov 19, 2020
  7. github-actions commented on Dec 3, 2020

    @github-actions
    Contributor

    This issue was automatically closed because it went two weeks without a reply since it was labeled "Can Close?"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Can Close?enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions