Skip to content

Commit

Permalink
Support proto2 groups (#640)
Browse files Browse the repository at this point in the history
  • Loading branch information
timostamm authored Dec 5, 2023
1 parent b331196 commit ce54cf1
Show file tree
Hide file tree
Showing 27 changed files with 909 additions and 133 deletions.
2 changes: 1 addition & 1 deletion packages/protobuf-bench/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ server would usually do.

| code generator | bundle size | minified | compressed |
|---------------------|------------------------:|-----------------------:|-------------------:|
| protobuf-es | 90,449 b | 38,193 b | 9,801 b |
| protobuf-es | 91,410 b | 38,462 b | 9,870 b |
| protobuf-javascript | 394,384 b | 288,654 b | 45,122 b |

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 20 additions & 1 deletion packages/protobuf-test/extra/proto2.proto
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,23 @@ enum Proto2Enum {

message Proto2ChildMessage {
optional string string_field = 1;
}
}

message Proto2GroupsMessage {
optional group Group = 1 {
optional int32 int32_field = 1;
optional group NestedGroup = 2 {
optional string string_field = 1;
}
}
repeated group RepeatedGroup = 2 {
optional int32 int32_field = 1;
}
oneof oneof_with_group {
group OneofGroup = 3 {
optional bool bool_field = 1;
}
}
optional Group message_field_using_group = 4;
optional Group.NestedGroup message_field_using_nested_group = 5;
}
151 changes: 151 additions & 0 deletions packages/protobuf-test/src/gen/js/extra/proto2_pb.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

59 changes: 59 additions & 0 deletions packages/protobuf-test/src/gen/js/extra/proto2_pb.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ce54cf1

Please sign in to comment.