You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+2
Original file line number
Diff line number
Diff line change
@@ -578,6 +578,8 @@ Other notes:
578
578
* Default values must be specified as arguments to the decorator instead of using a property initializer for proper prototype behavior.
579
579
* Property names on decorated classes must not be renamed on compile time (i.e. by a minifier) because decorators just receive the original field name as a string.
580
580
581
+
**ProTip!** Not as pretty, but you can [use decorators in plain JavaScript](https://github.com/dcodeIO/protobuf.js/blob/master/examples/js-decorators.js) as well.
Copy file name to clipboardExpand all lines: ext/descriptor/README.md
+6-6
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
protobufjs/ext/descriptor
2
2
=========================
3
3
4
-
Experimental extension for interoperability with descriptor.proto types.
4
+
Experimental extension for interoperability with [descriptor.proto](https://github.com/google/protobuf/blob/master/src/google/protobuf/descriptor.proto) types.
The extension adds `.fromDescriptor(descriptor[, syntax])` and `#toDescriptor([syntax])` methods to reflection objects and exports the `.google.protobuf` namespace of the internally used `Root` instance containing the following types present in descriptor.proto.
34
+
The extension adds `.fromDescriptor(descriptor[, syntax])` and `#toDescriptor([syntax])` methods to reflection objects and exports the `.google.protobuf` namespace of the internally used `Root` instance containing the following types present in descriptor.proto, including sub-types:
| FieldDescriptorProto | Field | not supported: defaultValue, jsonValue
44
-
| FieldOptions | Field | only packed
43
+
| FieldDescriptorProto | Field | except defaultValue
44
+
| FieldOptions | Field |
45
45
| OneofDescriptorProto | OneOf |
46
46
| OneofOptions | OneOf | not supported
47
47
| EnumDescriptorProto | Enum |
@@ -56,4 +56,4 @@ The extension adds `.fromDescriptor(descriptor[, syntax])` and `#toDescriptor([s
56
56
| SourceCodeInfo | | not supported
57
57
| GeneratedCodeInfo | | not supported
58
58
59
-
Additionally, not all features of descriptor.proto translate perfectly to a protobuf.js root instance. A root instance has only limited knowlege of packages or individual files for example, which is then compensated by guessing.
59
+
Note that not all features of descriptor.proto translate perfectly to a protobuf.js root instance. A root instance has only limited knowlege of packages or individual files for example, which is then compensated by guessing and generating fictional file names.
0 commit comments