Skip to content
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

ui: Smooth out issues with generated protobuffer definitions. #6616

Closed
mrtracy opened this issue May 10, 2016 · 5 comments
Closed

ui: Smooth out issues with generated protobuffer definitions. #6616

mrtracy opened this issue May 10, 2016 · 5 comments
Assignees
Milestone

Comments

@mrtracy
Copy link
Contributor

mrtracy commented May 10, 2016

In the next version of our admin UI, we are now generating proto-buffer definitions directly from .proto files. This is accomplished using a couple of open-source tools (proto2js, Proto2Typescript). Unfortunately, there are incompatibilities between the output of Proto2Typescript and the systemjs typescript plugin (plugin-typescript), and we have worked around some of these issues with "hacks".

We should figure out the best way to improve the protobuffer generation process so that these hacks are not necessary.

@maxlang
Copy link
Contributor

maxlang commented Jun 28, 2016

@tamird @mrtracy can you enumerate the hacks?

@tamird
Copy link
Contributor

tamird commented Jun 28, 2016

I don't think it's necessary to enumerate the hacks. Looking ahead slightly, I have a branch in which I use protoc --js_out to generate CommonJS which includes JsDoc comments, instead of the current mix of tools.

It's also my understanding that typescript@next supports importing javascript without definition files, and also pulling type information from JsDoc comments. My current understanding of this is "tracked" upstream: microsoft/TypeScript#9317.

The next step here is to experiment with typescript@next on that branch.

@maxlang
Copy link
Contributor

maxlang commented Jun 28, 2016

Gotcha. I'll assign to you for now.

@tamird
Copy link
Contributor

tamird commented Jul 2, 2016

Quick update on this: the code produced by https://github.com/google/protobuf/tree/master/js is not yet suitable for use directly with the typescript compiler (even typescript@next).

tsc --allowjs works when all the imports are rewritten to point to the generated commonjs, but the JsDoc-based inference is not enough to make those files usable. In particular, Google's closure-style exports are not picked up by typescript. Progress on this front is tracked upstream in https://github.com/google/protobuf/issues/1231.

@tamird
Copy link
Contributor

tamird commented Jul 5, 2016

More update: filed microsoft/TypeScript#9509.

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

No branches or pull requests

3 participants