Skip to content
This repository has been archived by the owner on Sep 16, 2021. It is now read-only.

Demonstrate usage of protocol buffers #61

Closed
alexeagle opened this issue Nov 9, 2017 · 6 comments
Closed

Demonstrate usage of protocol buffers #61

alexeagle opened this issue Nov 9, 2017 · 6 comments

Comments

@alexeagle
Copy link
Contributor

Should have type-safe access to generated protos.

We could use this in our own repo: currently proto objects are type any, eg

const workerpb = (function loadWorkerPb() {

https://github.com/dcodeIO/ProtoBuf.js/#usage-with-typescript seems like the obvious .d.ts code generator to use. This also implies that the library must use the protobuf.js generated runtime.

/cc @jart

@achew22
Copy link
Member

achew22 commented Nov 9, 2017

Having written a few protoc plugins, you might consider writing your own. It will provide you a lot more control and have relatively few downsides other than taking an afternoon. It also has the fun bootstrapping problem of writing a proto parser that uses its own output to parse the protos. What's more meta than that!

@pshields
Copy link
Contributor

Another option might be the closure_js_proto_library rule from rules_closure. I logged #116 since as far as I can tell it is already generating a Closure-annotated .js output, but I think the output may not be in the place that ts_library expects.

@alexeagle
Copy link
Contributor Author

As mentioned in the other thread - producing closure-annotated .js isn't useful for ts_library since we don't want to introduce the complexity of converting closure JS signatures to .d.ts files.

@alexeagle
Copy link
Contributor Author

@mrmeku made a prototype for this at ng-conf which was part of our workshop. I'll clean it up and merge that.

@SirVer
Copy link
Contributor

SirVer commented Apr 30, 2018

This is exciting progress!

alexeagle added a commit to alexeagle/rules_typescript that referenced this issue Apr 30, 2018
Add example that uses it under a karma test.

Fixes bazelbuild#61
@alexeagle
Copy link
Contributor Author

Documentation published at http://tsetse.info/api

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants