Skip to content

Commit 5f8b6f1

Browse files
Protocol Buffer TeamLogofile
authored andcommitted
This documentation change includes the following:
* Adds an overview to the 1-1-1 Best Practice topic * Adds a paragraph about explicit presence to the nullable-getters-setters.md topic * Updates the version-tables.css topic to reflect the current state of version support * Adds the release dates to all of the version-specific news topics * Clarifies some content and corrects a method name in the Editions.md topic * Clarifies some content in the encoding.md topic * Adds a topic about MIME types PiperOrigin-RevId: 766670574 Change-Id: I806dc5684bc1ee2807ea1bd3bc692befb2dcd067
1 parent 30abe78 commit 5f8b6f1

File tree

15 files changed

+109
-34
lines changed

15 files changed

+109
-34
lines changed

content/best-practices/1-1-1.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ type = "docs"
77
aliases = "/programming-guides/1-1-1"
88
+++
99

10+
The "1-1-1" best practice advocates structuring definitions with one top-level
11+
entity (message, enum, or extension) per `.proto` file, corresponding to a
12+
single `proto_library` build rule. This approach promotes small, modular proto
13+
definitions. Key benefits include simplified refactoring, potentially improved
14+
build times, and smaller binary sizes due to minimized transitive dependencies.
15+
16+
--------------------------------------------------------------------------------
17+
1018
The 1-1-1 best practice is to keep every proto_library and .proto file as small
1119
as is reasonable, with the ideal being:
1220

content/design-decisions/nullable-getters-setters.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ C#, and Rust). While this does seem to be a helpful feature for folks using
1212
those languages, the design choice has tradeoffs which have led to the Protobuf
1313
team choosing not to implement them.
1414

15+
Explicit presence is not a concept that directly maps to the traditional notion
16+
of nullability. It is subtle, but explicit presence philosophy is closer to "the
17+
fields are not nullable, but you can detect if the field was explicitly assigned
18+
a value or not. Normal access will see some default value if it is not assigned,
19+
but you can check if the field was actively written to or not, when needed."
20+
1521
The biggest reason not to have nullable fields is the intended behavior of
1622
default values specified in a `.proto` file. By design, calling a getter on an
1723
unset field will return the default value of that field.

content/includes/version-tables.css

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,36 +95,36 @@ table.version-chart td.active {
9595
/* latest release column */
9696
/*
9797
* How to advance the selection of the latest release:
98-
* Replace class 'y25q1' in the following selectors with 'y25q2' (the class
98+
* Replace class 'y25q2' in the following selectors with 'y25q3' (the class
9999
* referring to the quarter of the next release). Please also update this
100100
* instruction as a courtesy to the next maintainer.
101101
*/
102102

103103
/* visually replace 'yyQq' heading with string 'Latest' */
104-
table.version-chart th.y25q1 span {
104+
table.version-chart th.y25q2 span {
105105
display: none;
106106
}
107-
table.version-chart th.y25q1::after {
107+
table.version-chart th.y25q2::after {
108108
content: "Latest"
109109
}
110110

111111
/* draw a focus rectangle around the latest release column */
112-
table.version-chart th.y25q1 {
112+
table.version-chart th.y25q2 {
113113
border-top: 2px solid #e06666 !important;
114114
border-left: 2px solid #e06666 !important;
115115
border-right: 2px solid #e06666 !important;
116116
}
117-
table.version-chart td.y25q1 {
117+
table.version-chart td.y25q2 {
118118
font-weight: bold;
119119
border-left: 2px solid #e06666 !important;
120120
border-right: 2px solid #e06666 !important;
121121
}
122-
table.version-chart tr:last-child td.y25q1 {
122+
table.version-chart tr:last-child td.y25q2 {
123123
border-bottom: 2px solid #e06666 !important;
124124
}
125125

126126
/* future release columns */
127-
table.version-chart td:not(:has(~ .y25q1)):not(.y25q1) {
127+
table.version-chart td:not(:has(~ .y25q2)):not(.y25q2) {
128128
font-style: italic;
129129
}
130130

content/news/v21.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ description = "Changes announced for Protocol Buffers version 21.x."
66
type = "docs"
77
+++
88

9-
The following announcements are specific to Version 21.x. For information
10-
presented chronologically, see [News](/news).
9+
The following announcements are specific to Version 21.x, which was released May
10+
25, 2022. For information presented chronologically, see
11+
[News](/news).
1112

1213
## Python Updates {#python-updates}
1314

content/news/v22.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ description = "Changes announced for Protocol Buffers version 22.x."
66
type = "docs"
77
+++
88

9-
The following announcements are specific to Version 22.x. For information
10-
presented chronologically, see [News](/news).
9+
The following announcements are specific to Version 22.x, which was released
10+
February 16, 2023. For information presented chronologically, see
11+
[News](/news).
1112

1213
### Changing Maven Release Candidate Artifact Names to Be More Idiomatic {#idiomatic}
1314

content/news/v23.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ description = "Changes announced for Protocol Buffers version 23.x."
66
type = "docs"
77
+++
88

9-
The following announcements are specific to Version 23.x. For information
10-
presented chronologically, see [News](/news).
9+
The following announcements are specific to Version 23.x, which was released May
10+
8, 2023. For information presented chronologically, see
11+
[News](/news).
1112

1213
## Changes to Ruby Generator {#ruby}
1314

content/news/v24.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ description = "Changes announced for Protocol Buffers version 24.x."
66
type = "docs"
77
+++
88

9-
The following announcements are specific to Version 24.x. For information
10-
presented chronologically, see [News](/news).
9+
The following announcements are specific to Version 24.x, which was released
10+
August 8, 2023. For information presented chronologically, see
11+
[News](/news).
1112

1213
## Stricter validation for `json_name` {#json-name}
1314

content/news/v25.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ description = "Changes announced for Protocol Buffers version 25.x."
66
type = "docs"
77
+++
88

9-
The following announcements are specific to Version 25.x. For information
10-
presented chronologically, see [News](/news).
9+
The following announcements are specific to Version 25.x, which was released
10+
November 1, 2023. For information presented chronologically, see
11+
[News](/news).
1112

1213
## Python Breaking Change
1314

content/news/v26.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ description = "Changes announced for Protocol Buffers version 26.x."
66
type = "docs"
77
+++
88

9-
The following announcements are specific to Version 26.x. For information
10-
presented chronologically, see [News](/news).
9+
The following announcements are specific to Version 26.x, which was released
10+
March 13, 2024. For information presented chronologically, see
11+
[News](/news).
1112

1213
## General Changes
1314

content/news/v29.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ description = "Changes announced for Protocol Buffers version 29.x."
66
type = "docs"
77
+++
88

9-
The following announcements are specific to Version 29.x. For information
10-
presented chronologically, see [News](/news).
9+
The following announcements are specific to Version 29.x, which was released
10+
November 27, 2024. For information presented chronologically, see
11+
[News](/news).
1112

1213
## Bazel and Proto Rules
1314

0 commit comments

Comments
 (0)