Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions javascript/net/grpc/web/generator/grpc_generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -821,6 +821,9 @@ void PrintProtoDtsMessage(Printer* printer, const Descriptor* desc,

printer->Print(vars, "export class $class_name$ extends jspb.Message {\n");
printer->Indent();

printer->Print(vars, "constructor(opt_data?: $class_name$.AsObject);\n");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Vuhag123 Thanks! for the change!

One request: Can you provide an example output in the PR description, and try verifying this change works (via a typescript example)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have verified with typescript example it is working, i am attaching the images here too
Below is existing one:
Before_1097
After fix,
After_1097

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh nice! This is great! Thanks for showing the change in action! This would be helpful indeed! Thanks Vuha :)


Copy link

Copilot AI Oct 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing whitespace on line 826 should be removed to maintain code cleanliness and comply with most style guides.

Suggested change

Copilot uses AI. Check for mistakes.
for (int i = 0; i < desc->field_count(); i++) {
const FieldDescriptor* field = desc->field(i);
vars["js_field_name"] = JSFieldName(field);
Expand Down