Skip to content

Conversation

@lukfugl
Copy link
Member

@lukfugl lukfugl commented Dec 9, 2024

Builds on protocolbuffers#150, adding:

  • support for library option with ES6
  • .d.ts generation when requested (generate_dts flag) and compatible (library option set and import_style set to es6)

Tested compilation of Derivita's omaha/base/ast.proto and inspecting the generated omaha/base/ast_proto.js and omaha/base/ast_proto.d.ts files.

@lukfugl lukfugl requested a review from ribrdb December 9, 2024 18:26
Copy link

@ribrdb ribrdb left a 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;
Copy link

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.

Copy link

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.

ribrdb and others added 5 commits July 28, 2025 19:21
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
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

Successfully merging this pull request may close these issues.

4 participants