-
Notifications
You must be signed in to change notification settings - Fork 0
support for generating es6 imports and .d.ts files #1
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you temporarily add the output of running this on test.proto so I can see the output?
example/test.js
Outdated
| // @ts-nocheck | ||
|
|
||
| import * as jspb from 'google-protobuf'; | ||
| var goog = jspb; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably wiill need to be something like import { goog } from 'closure-library/goog.js.
But that may be fine to figure out later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the correct import for goog is import * as goog from 'closure-library/closure/goog';
We still need to figure out how the jspb stuff should be imported.
Don't use class properties
* replace most uses of GetQualifiedMessagePath with either LocalMessageRef (when dealing with a top-level message for the file) or SubmessageTypeRef (when dealing with a message field) * similar for GetQualifiedEnumPath, but MaybeCrossFileEnumPath as the analogue for SubmessageTypeRef * update uses of LocalMessageRef for message fields to SubmessageTypeRef * update most uses of MaybeCrossFileMessageRef to SubmessageTypeRef
Builds on protocolbuffers#150, adding:
libraryoption with ES6generate_dtsflag) and compatible (libraryoption set andimport_styleset toes6)Tested compilation of Derivita's omaha/base/ast.proto and inspecting the generated
omaha/base/ast_proto.jsandomaha/base/ast_proto.d.tsfiles.