Skip to content

Commit 52f3c74

Browse files
authored
Merge pull request #162 from Logofile/sync
Documentation update
2 parents 9b7f755 + 7eef20d commit 52f3c74

File tree

9 files changed

+504
-5
lines changed

9 files changed

+504
-5
lines changed

content/editions/_index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ type = "docs"
77

88
* [Protocol Buffers Overview](/editions/overview)
99
* [Feature Settings for Editions](/editions/features)
10+
* [Implementing Editions Support](/editions/implementation)

content/editions/implementation.md

Lines changed: 443 additions & 0 deletions
Large diffs are not rendered by default.

content/editions/overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ option features.enum_type = CLOSED;
244244
245245
message Person {
246246
string name = 1;
247-
int32 id = 2 [features.presence = IMPLICIT];
247+
int32 id = 2 [features.field_presence = IMPLICIT];
248248
249249
enum Pay_Type {
250250
PAY_TYPE_UNSPECIFIED = 1;

content/news/2024-06-26.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
+++
2+
title = "Changes Announced on June 26, 2024"
3+
linkTitle = "June 26, 2024"
4+
toc_hide = "true"
5+
description = "Changes announced for Protocol Buffers on June 26, 2024."
6+
type = "docs"
7+
+++
8+
9+
## Dropping Support for Building Protobuf Java from Source with Maven
10+
11+
We are planning to drop support for building Protobuf Java OSS from source with
12+
the Maven build system in the Protobuf Java 4.28 release. This has been marked
13+
deprecated in the 4.27 release.
14+
15+
After this point, you can continue to use Bazel, or another build system, to
16+
build Protobuf. You can read more about building from source in
17+
[the Protobuf Java README](https://github.com/protocolbuffers/protobuf/tree/main/java).
18+
19+
This change may impact Protobuf Java contributors that build protobuf from
20+
source. It does not impact the majority of users that uses the precompiled
21+
protobuf-java or protobuf-javalite artifacts from a repository. Note
22+
specifically that we do not plan to stop supporting the ability to compile
23+
gencode with Maven, and we plan to continue to make prebuilt artifacts available
24+
in the Maven Central repository.

content/news/_index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ New news topics will also be published to the
2020
The following news topics provide information in the reverse order in which it
2121
was released.
2222

23+
* [June 26, 2024](/news/2024-06-26) - Dropping support
24+
for building Protobuf Java from source with Maven
2325
* [February 27, 2024](/news/2024-02-27) - Dropping
2426
support for older versions of Ruby
2527
* [February 5, 2024](/news/2024-02-05) - Breaking

content/programming-guides/proto3.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,31 @@ parser will accept the input, but only uses the last field. So, the "bytes" may
151151
not be "well-formed" but the resulting message would have only one and would be
152152
"well-formed" (but would not roundtrip the same).
153153

154+
#### Message Type Fields Have Field Presence {#field-presence}
155+
156+
In proto3, message-type fields already have field presence. Because of this,
157+
adding the `optional` modifier doesn't change the field presence for the field.
158+
159+
The definitions for `Message2` and `Message3` in the following code sample
160+
generate the same code for all languages, and there is no difference in
161+
representation in binary, JSON, and TextFormat:
162+
163+
```proto
164+
syntax="proto3";
165+
166+
package foo.bar;
167+
168+
message Message1 {}
169+
170+
message Message2 {
171+
Message1 foo = 1;
172+
}
173+
174+
message Message3 {
175+
optional Message1 bar = 1;
176+
}
177+
```
178+
154179
### Adding More Message Types {#adding-types}
155180

156181
Multiple message types can be defined in a single `.proto` file. This is useful

content/reference/go/go-generated.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,15 @@ Where in the output directory the generated `.pb.go` file is placed depends on
3838
the compiler flags. There are several output modes:
3939

4040
- If the `paths=import` flag is specified, the output file is placed in a
41-
directory named after the Go package's import path. For example, an input
41+
directory named after the Go package's import path (such as one provided by
42+
the `go_package` option within the `.proto` file). For example, an input
4243
file `protos/buzz.proto` with a Go import path of
4344
`example.com/project/protos/fizz` results in an output file at
4445
`example.com/project/protos/fizz/buzz.pb.go`. This is the default output
4546
mode if a `paths` flag is not specified.
4647
- If the `module=$PREFIX` flag is specified, the output file is placed in a
47-
directory named after the Go package's import path, but with the specified
48+
directory named after the Go package's import path (such as one provided by
49+
the `go_package` option within the `.proto` file), but with the specified
4850
directory prefix removed from the output filename. For example, an input
4951
file `protos/buzz.proto` with a Go import path of
5052
`example.com/project/protos/fizz` and `example.com/project` specified as the

content/reference/protobuf/proto2-spec.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@ language guide.
148148

149149
```
150150
option = "option" optionName "=" constant ";"
151-
optionName = ( ident | "(" ["."] fullIdent ")" )
151+
optionName = ( ident | bracedFullIdent ) { "." ( ident | bracedFullIdent ) }
152+
bracedFullIdent = "(" ["."] fullIdent ")"
152153
```
153154

154155
For examples:

content/reference/protobuf/proto3-spec.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,8 @@ language guide.
151151

152152
```
153153
option = "option" optionName "=" constant ";"
154-
optionName = optionNamePart { "." optionNamePart }
154+
optionName = ( ident | bracedFullIdent ) { "." ( ident | bracedFullIdent ) }
155+
bracedFullIdent = "(" ["."] fullIdent ")"
155156
optionNamePart = { ident | "(" ["."] fullIdent ")" }
156157
```
157158

0 commit comments

Comments
 (0)