-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
node.js and typescript #98
Comments
Yes, that would be very welcome. @mprobst suggested to me that we could use http://github.com/angular/clutz to generate TypeScript interfaces from our Closure-annotated source code. |
@haberman IMHO it might be a bit too much effort for a project that's not already using Closure to set up the infrastructure to run clutz (java, Closure, build system deps). I think it might still be worth having a compiler (mode) that produces |
@mprobst 👍 - we're currently generating |
@myitcv are there any public pointers to how we could do something like that? |
@LoungeFlyZ - nothing public yet. Not for lack of want or trying... just that other things are getting in the way at the moment. |
+1 for typescript |
If there are any clutz + protobuf experts out there, I'm currently slogging through setting that up for CockroachDB. Your help would be appreciated over in angular/clutz#334! |
Any progress on this so far? |
Would it be possible for the Protocol Buffers team to share their plans for adding typescript support?
The base case for the above request is that of using protobufs in Angular typescript. In case the team wants me to open separate tracking bugs for typescript for points 2) and 3) above, please let me know. |
@mprobst does your team have a vision for how this should work? It seems like the strategy for generating TypeScript protobuf code and consuming it client-side projects is still not really documented or implemented yet. Could someone with a grasp of what effort remains explain what still needs to be done? I'm trying to consume generated protobuf code for an Angular/Bazel/Closure app written in TypeScript, and I think protobuf support is one of the last missing pieces. I noted in https://github.com/bazelbuild/rules_typescript/issues/116 that adding a |
@pshields we don't have a good open source answer. Internally, we use the proto->JS generator, and then use https://github.com/angular/clutz to convert that to TypeScript definitions. But you're right, that hasn't been open sourced, so it doesn't work with I also suspect that if you're not using that generator for other reasons, you might be better off with a different solution. If I remember correctly, /CC @alexeagle who might have something cooking here. |
I'd rather not use Closure codegen if we want TypeScript types. Clutz is complex, and I don't want to ever introduce it under Bazel, because I don't know of any Bazel users who continue development of Closure JS code along with their TypeScript. bazelbuild/rules_typescript#61 is what I intend to do, which would generate .d.ts from .proto. Bazel users should adopt the best of the existing open source tools to solve a given problem, not adopt the Google-authored tool by default. |
Any progress on this in 2k18? |
Under Bazel, we have a This uses https://github.com/dcodeIO/protobuf.js#pbts-for-typescript under the covers. If you don't use Bazel, you could use that library directly to generate This is not the only way to do protocol buffers, but it's the one we are supporting under the Angular toolchain for now. |
For what it's worth I have a typescript generator here: https://godoc.org/github.com/tmc/grpcutil/protoc-gen-tstypes |
Considering Google has mentioned NestJS and is building Angular in Typescript I think it'd only make sense for protobuf to support some form of Typescript natively? Has there been any change since last year about the stance this project has on Typescript? |
We have a plugin that is maintained by me and people from the community; |
This is a reasonable, but substantial FR that we are unlikely to get to soon. |
Great to see you have JS support for browsers and node.js. However, for those of us writing with typescript (for either browser or node.js) it would be very helpful to have a typescript definition file (.d.ts file).
Possible?
The text was updated successfully, but these errors were encountered: