Skip to content

Commit 577c0c6

Browse files
Protocol Buffer TeamLogofile
authored andcommitted
This change includes the following:
* Adds a link to the Enum Behavior topic from the Editions Features topic * Updates the "Use Well-Known Types and Common Types" section of the Dos and Don'ts topic to remove redundancy * Adds information about creating plugins to the "Other Languages" topic * Updates the Versions Supported topic for the v27 release PiperOrigin-RevId: 638289768 Change-Id: I4ce6d8fb42b2959ddd63ca450aced34a60efe307
1 parent 7ddb294 commit 577c0c6

File tree

4 files changed

+220
-87
lines changed

4 files changed

+220
-87
lines changed

content/editions/features.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ overrides the message-scope QUUX setting.
5757
### `features.enum_type` {#enum_type}
5858

5959
This feature sets the behavior for how enum values that aren't contained within
60-
the defined set are handled.
60+
the defined set are handled. See
61+
[Enum Behavior](/programming-guides/enum) for more
62+
information on open and closed enums.
6163

6264
This feature doesn't impact proto3 files, so this section doesn't have a before
6365
and after of a proto3 file.

content/programming-guides/dos-donts.md

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -109,52 +109,40 @@ using macro constants such as "`NULL`," "`NAN`," and "`DOMAIN`" as enum values.
109109

110110
## **Do** Use Well-Known Types and Common Types {#well-known-common}
111111

112-
Embedding the following common, shared types is strongly encouraged. Do not use
113-
`int32 timestamp_seconds_since_epoch` or `int64 timeout_millis` in your code
112+
Using the following common, shared types is strongly encouraged. E.g., do not
113+
use `int32 timestamp_seconds_since_epoch` or `int64 timeout_millis` in your code
114114
when a perfectly suitable common type already exists!
115115

116-
<a id="well-known-types"></a>
116+
<a id="well-known-types"></a><a id="common-types"></a>
117117

118-
### Well-Known Types {#well-known}
119-
120-
* [duration](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/duration.proto)
118+
* [`duration`](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/duration.proto)
121119
is a signed, fixed-length span of time (for example, 42s).
122-
* [timestamp](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/timestamp.proto)
120+
* [`timestamp`](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/timestamp.proto)
123121
is a point in time independent of any time zone or calendar (for example,
124122
2017-01-15T01:30:15.01Z).
125-
* [field_mask](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/field_mask.proto)
126-
is a set of symbolic field paths (for example, f.b.d).
127-
128-
<a id="common-types"></a>
129-
130-
### Common Types {#common}
131-
132-
* [`Duration`](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/duration.proto)
133-
is a signed, fixed-length span of time, such as 42s.
134-
* [`Timestamp`](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/timestamp.proto)
135-
is a point in time independent of any time zone or calendar, such as
136-
2017-01-15T01:30:15.01Z.
137123
* [`interval`](https://github.com/googleapis/googleapis/blob/master/google/type/interval.proto)
138124
is a time interval independent of time zone or calendar (for example,
139125
2017-01-15T01:30:15.01Z - 2017-01-16T02:30:15.01Z).
140126
* [`date`](https://github.com/googleapis/googleapis/blob/master/google/type/date.proto)
141127
is a whole calendar date (for example, 2005-09-19).
128+
* [`month`](https://github.com/googleapis/googleapis/blob/master/google/type/month.proto)
129+
is a month of year (for example, April).
142130
* [`dayofweek`](https://github.com/googleapis/googleapis/blob/master/google/type/dayofweek.proto)
143131
is a day of week (for example, Monday).
144132
* [`timeofday`](https://github.com/googleapis/googleapis/blob/master/google/type/timeofday.proto)
145133
is a time of day (for example, 10:42:23).
146-
* [`latlng`](https://github.com/googleapis/googleapis/blob/master/google/type/latlng.proto)
147-
is a latitude/longitude pair (for example, 37.386051 latitude and
148-
-122.083855 longitude).
149-
* [`money`](https://github.com/googleapis/googleapis/blob/master/google/type/money.proto)
150-
is an amount of money with its currency type (for example, 42 USD).
134+
* [`field_mask`](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/field_mask.proto)
135+
is a set of symbolic field paths (for example, f.b.d).
151136
* [`postal_address`](https://github.com/googleapis/googleapis/blob/master/google/type/postal_address.proto)
152137
is a postal address (for example, 1600 Amphitheatre Parkway Mountain View,
153138
CA 94043 USA).
139+
* [`money`](https://github.com/googleapis/googleapis/blob/master/google/type/money.proto)
140+
is an amount of money with its currency type (for example, 42 USD).
141+
* [`latlng`](https://github.com/googleapis/googleapis/blob/master/google/type/latlng.proto)
142+
is a latitude/longitude pair (for example, 37.386051 latitude and
143+
-122.083855 longitude).
154144
* [`color`](https://github.com/googleapis/googleapis/blob/master/google/type/color.proto)
155145
is a color in the RGBA color space.
156-
* [`month`](https://github.com/googleapis/googleapis/blob/master/google/type/month.proto)
157-
is a month of year (for example, April).
158146

159147
<a id="do-define-widely-used-message-types-in-separate-files"></a>
160148

content/reference/other.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ We recommend that all third-party code generators be written as plugins, as this
2525
allows all generators to provide a consistent interface and share a single
2626
parser implementation.
2727

28+
Plugins can be written in any programming language, but Google owned plugins are
29+
written in C++. If you are writing your own plugin you may find it easiest to
30+
use C++ for the plugin to be able to follow those examples and reuse utilities.
31+
2832
Additionally, plugins are able to insert code into the files generated by other
2933
code generators. See the comments about \"insertion points\" in `plugin.proto`
3034
for more on this. This could be used, for example, to write a plugin which

0 commit comments

Comments
 (0)