Coder Social home page Coder Social logo

protoc-gen-twirp_js's Introduction

protoc-gen-twirp_js

Creates javascript bindings compatible with both the browser and node.js as common-js modules. This means that you should run your protoc with options for the --js-out as --js-out=import_style=commonjs;binary:<path>.

The resulting javascript files <service>_pb.js and <service>_pb_twirp.js will be compatible with all commonjs aware module systems, for example, nodejs, browserify, webpack, rollup, etc...

Caveats

  1. I am not completely happy with the JSON support, I do not believe that the serialisation the Google PB JS output provides matches the protocol buffers JSON serialisation definition. Nor does the other prominent alternative dcodeIO/protobuf.js, which leaves implementing it myself, and then probably the entire generator, or not bothering. Given there is little incentive to actually use JSON on the wire, I lean towards removing/ignoring the JSON interop - this library deals with plain objects either way, only the wire format changes.
  2. Twirp is adding Streaming support. I don't really want to implement that. The simplicity of the RPC (in contrast to grpc for example) was a major selling point to me.

protoc-gen-twirp_js's People

Contributors

juntaki avatar thechriswalker avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.