Skip to content

Commit 9e0d9fc

Browse files
authored
Merge pull request #122 from Logofile/sync
Documentation update
2 parents 79ce229 + 025f350 commit 9e0d9fc

File tree

11 files changed

+665
-5
lines changed

11 files changed

+665
-5
lines changed

content/news/_index.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,14 @@ no_list = "true"
77
+++
88

99
News topics provide information about past events and changes with Protocol
10-
Buffers, and plans for upcoming changes.
10+
Buffers, and plans for upcoming changes. The information is available both
11+
chronologically and per-release. Note that not everything is included in the
12+
per-release topics, as some content is not tied to a version.
13+
14+
## Chronological {#chronological}
15+
16+
The following news topics provide information in the reverse order in which it
17+
was released.
1118

1219
* [February 5, 2024](/news/2024-02-05) - Breaking
1320
changes in Java, C++, and Python in the 26.x line.
@@ -48,3 +55,26 @@ Buffers, and plans for upcoming changes.
4855
Change Policy
4956
* [May 6, 2022](/news/2022-05-06) - Versioning, Python
5057
Updates, and JavaScript Support
58+
59+
## Per Release {#per-release}
60+
61+
<!-- Protobuf team: Add individual sections to a topic below when the section is
62+
specific to a particular release, rather than a general update. -->
63+
64+
The following new topics provide per-release information. All News entries
65+
appear in the chronological listing in the previous section, but only entries
66+
that are specific to a particular version appear in the pages listed in this
67+
section.
68+
69+
These pages do not replace the
70+
[release notes](https://github.com/protocolbuffers/protobuf/releases), as the
71+
release notes will be more complete. Also, not everything from the chronological
72+
listing will be in these topics, as some content is not specific to a particular
73+
release.
74+
75+
* [Version 26.x](/news/v26)
76+
* [Version 25.x](/news/v25)
77+
* [Version 24.x](/news/v24)
78+
* [Version 23.x](/news/v23)
79+
* [Version 22.x](/news/v22)
80+
* [Version 21.x](/news/v21)

content/news/v21.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
+++
2+
title = "News Announcements for Version 21.x"
3+
linkTitle = "Version 21.x"
4+
toc_hide = "true"
5+
description = "Changes announced for Protocol Buffers version 21.x."
6+
type = "docs"
7+
+++
8+
9+
The following announcements are specific to Version 21.x. For information
10+
presented chronologically, see [News](/news).
11+
12+
## Python Updates {#python-updates}
13+
14+
We made some changes in Python language support in Protocol Buffers. Version
15+
4.21.0 is a new major version, following 3.20.1. The new version is based on the
16+
[upb library](https://github.com/protocolbuffers/upb), and offers
17+
significantly better parsing performance than previous releases, especially for
18+
large payloads. It also includes prebuilt binary modules for Apple silicon for
19+
increased performance without a manual build.
20+
21+
The new release does contain some breaking changes. Specifically:
22+
23+
* The
24+
[`UnknownFields()`](https://googleapis.dev/python/protobuf/3.17.0/google/protobuf/message.html#google.protobuf.message.Message.UnknownFields)
25+
method, which relied on an implicitly created class, is replaced with the
26+
explicitly-created `UnknownFieldSet` class.
27+
* Some non-core characteristics may have changed, such as the specific format
28+
of certain strings or error messages. These are not considered breaking
29+
changes, but may still impact your existing code base.
30+
* Applications that rely on sharing messages between Python and C++ break in
31+
the new version. Most developers won't be affected by this, but users of
32+
[Nucleus](https://github.com/google/nucleus) and possibly other
33+
libraries may be. As a workaround, you can
34+
[set an environment variable](/reference/python/python-generated#sharing-messages)
35+
that forces the library to preserve compatibility.
36+
* Python upb requires generated code that has been generated from protoc
37+
3.19.0 or newer.

content/news/v22.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
+++
2+
title = "News Announcements for Version 22.x"
3+
linkTitle = "Version 22.x"
4+
toc_hide = "true"
5+
description = "Changes announced for Protocol Buffers version 22.x."
6+
type = "docs"
7+
+++
8+
9+
The following announcements are specific to Version 22.x. For information
10+
presented chronologically, see [News](/news).
11+
12+
### Changing Maven Release Candidate Artifact Names to Be More Idiomatic {#idiomatic}
13+
14+
In 22.0 we plan to rename Maven artifacts to use “RC” instead of “rc-” as the
15+
release candidate prefix.
16+
17+
### Adding an Abseil Dependency {#abseil-dep}
18+
19+
In order to reduce the Google vs. OSS differences between protobuf and to
20+
simplify our own project, we plan to take a formal dependency on Abseil. In
21+
time, we plan to start using Abseil types in our public APIs, but simply adding
22+
the dependency is a breaking change.
23+
24+
### Dropping Support for PHP <7.4 {#php-74}
25+
26+
Per our
27+
[PHP support policy](https://cloud.google.com/php/getting-started/supported-php-versions),
28+
we plan to drop support for EOL versions of PHP. This is not considered a
29+
breaking change since these versions are already EOL in the broader ecosystem.
30+
31+
### Dropping Autotools Support {#autotools}
32+
33+
Per our
34+
[build systems support policy](https://opensource.google/documentation/policies/cplusplus-support#3_build_systems),
35+
we plan to drop autotools support. This is a breaking change. After autotools
36+
support is dropped, protobuf will support only CMake and Bazel.
37+
38+
### Dropping C++11 Support {#c11-support}
39+
40+
Per our
41+
[C++ support policy](https://opensource.google/documentation/policies/cplusplus-support#4_c_language_standard),
42+
we plan to drop C++11 support. This is a breaking change.
43+
44+
### Adding C++20 Support {#c20-support}
45+
46+
Because of the addition of new keywords to the C++ language, adding support for
47+
C++20 is a breaking change for users even if they do not currently use C++20.
48+
49+
Mitigations for this to conditionally change names only in certain compiler
50+
modes would break projects that support multiple language standards.
51+
52+
## C++ Changes {#cpp-changes}
53+
54+
Following the announcement of our
55+
[new major version and breaking changes policy](/news/2022-07-06),
56+
we are planning a major version bump for C++. We plan to make some changes to
57+
the assets that we release starting with our 22.x release line.
58+
59+
The following sections outline the set of breaking changes that we plan to
60+
include in the 22.0 release of protocol buffers. Note that plans can and do
61+
change. These are potential breaking changes to be aware of, but they may not
62+
happen in this particular release, or they may not happen at all.

content/news/v23.md

Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
+++
2+
title = "News Announcements for Version 23.x"
3+
linkTitle = "Version 23.x"
4+
toc_hide = "true"
5+
description = "Changes announced for Protocol Buffers version 23.x."
6+
type = "docs"
7+
+++
8+
9+
The following announcements are specific to Version 23.x. For information
10+
presented chronologically, see [News](/news).
11+
12+
## Changes to Ruby Generator {#ruby}
13+
14+
[This GitHub PR](https://github.com/protocolbuffers/protobuf/pull/12319), which
15+
will appear in the 23.x release, changes the Ruby code generator to emit a
16+
serialized proto instead of the DSL.
17+
18+
It removes the DSL from the code generator in anticipation of splitting the DSL
19+
out into a separate package.
20+
21+
Given a .proto file like:
22+
23+
```proto
24+
syntax = "proto3";
25+
26+
package pkg;
27+
28+
message TestMessage {
29+
optional int32 i32 = 1;
30+
optional TestMessage msg = 2;
31+
}
32+
```
33+
34+
Generated code before:
35+
36+
```ruby
37+
# Generated by the protocol buffer compiler. DO NOT EDIT!
38+
# source: protoc_explorer/main.proto
39+
40+
require 'google/protobuf'
41+
42+
Google::Protobuf::DescriptorPool.generated_pool.build do
43+
add_file("test.proto", :syntax => :proto3) do
44+
add_message "pkg.TestMessage" do
45+
proto3_optional :i32, :int32, 1
46+
proto3_optional :msg, :message, 2, "pkg.TestMessage"
47+
end
48+
end
49+
end
50+
51+
module Pkg
52+
TestMessage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("pkg.TestMessage").msgclass
53+
end
54+
```
55+
56+
Generated code after:
57+
58+
```ruby
59+
# frozen_string_literal: true
60+
# Generated by the protocol buffer compiler. DO NOT EDIT!
61+
# source: test.proto
62+
63+
require 'google/protobuf'
64+
65+
descriptor_data = "\n\ntest.proto\x12\x03pkg\"S\n\x0bTestMessage\x12\x10\n\x03i32\x18\x01 \x01(\x05H\x00\x88\x01\x01\x12\"\n\x03msg\x18\x02 \x01(\x0b\x32\x10.pkg.TestMessageH\x01\x88\x01\x01\x42\x06\n\x04_i32B\x06\n\x04_msgb\x06proto3"
66+
begin
67+
Google::Protobuf::DescriptorPool.generated_pool.add_serialized_file(descriptor_data)
68+
rescue TypeError => e
69+
# <compatibility code, see below>
70+
end
71+
72+
module Pkg
73+
TestMessage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("pkg.TestMessage").msgclass
74+
end
75+
```
76+
77+
This change fixes nearly all remaining conformance problems that existed
78+
previously. This is a side effect of moving from the DSL (which is lossy) to a
79+
serialized descriptor (which preserves all information).
80+
81+
### Backward Compatibility {#backward}
82+
83+
This change should be 100% compatible with Ruby Protobuf >= 3.18.0, released in
84+
Sept 2021. Additionally, it should be compatible with all existing users and
85+
deployments.
86+
87+
There **is** some special compatibility code inserted to achieve this level of
88+
backward compatibility that you should be aware of. Without the compatibility
89+
code, there is an edge case that could break backward compatibility. The
90+
previous code is lax in a way that the new code will be more strict.
91+
92+
When using a full serialized descriptor, it contains a list of all `.proto`
93+
files imported by this file (whereas the DSL never added dependencies properly).
94+
See the code in
95+
[`descriptor.proto`](https://github.com/protocolbuffers/protobuf/blob/dfb71558a2226718dc3bcf5df27cbc11c1f72382/src/google/protobuf/descriptor.proto#L65-L66).
96+
97+
`add_serialized_file` verifies that all dependencies listed in the descriptor
98+
were previously added with `add_serialized_file`. Generally that should be fine,
99+
because the generated code will contain Ruby `require` statements for all
100+
dependencies, and the descriptor will fail to load anyway if the types depended
101+
on were not previously defined in the `DescriptorPool`.
102+
103+
But there is a potential for problems if there are ambiguities around file
104+
paths. For example, consider the following scenario:
105+
106+
```proto
107+
// foo/bar.proto
108+
109+
syntax = "proto2";
110+
111+
message Bar {}
112+
```
113+
114+
```proto
115+
// foo/baz.proto
116+
117+
syntax = "proto2";
118+
119+
import "bar.proto";
120+
121+
message Baz {
122+
optional Bar bar = 1;
123+
}
124+
```
125+
126+
If you invoke `protoc` like so, it will work correctly:
127+
128+
```
129+
$ protoc --ruby_out=. -Ifoo foo/bar.proto foo/baz.proto
130+
$ RUBYLIB=. ruby baz_pb.rb
131+
```
132+
133+
However if you invoke `protoc` like so, and didn't have any compatibility code,
134+
it would fail to load:
135+
136+
```
137+
$ protoc --ruby_out=. -I. -Ifoo foo/baz.proto
138+
$ protoc --ruby_out=. -I. -Ifoo foo/bar.proto
139+
$ RUBYLIB=foo ruby foo/baz_pb.rb
140+
foo/baz_pb.rb:10:in `add_serialized_file': Unable to build file to DescriptorPool: Depends on file 'bar.proto', but it has not been loaded (Google::Protobuf::TypeError)
141+
from foo/baz_pb.rb:10:in `<main>'
142+
```
143+
144+
The problem is that `bar.proto` is being referred to by two different canonical
145+
names: `bar.proto` and `foo/bar.proto`. This is a user error: each import should
146+
always be referred to by a consistent full path. Hopefully user errors of this
147+
sort will be rare, but it is hard to know without trying.
148+
149+
The code in this change prints a warning using `warn` if we detect that this
150+
edge case has occurred:
151+
152+
```
153+
$ RUBYLIB=foo ruby foo/baz_pb.rb
154+
Warning: Protobuf detected an import path issue while loading generated file foo/baz_pb.rb
155+
- foo/baz.proto imports bar.proto, but that import was loaded as foo/bar.proto
156+
Each proto file must use a consistent fully-qualified name.
157+
This will become an error in the next major version.
158+
```
159+
160+
There are two possible fixes in this case. One is to consistently use the name
161+
`bar.proto` for the import (removing `-I.`). The other is to consistently use
162+
the name `foo/bar.proto` for the import (changing the import line to `import
163+
"foo/bar.proto"` and removing `-Ifoo`).
164+
165+
We plan to remove this compatibility code in the next major version.
166+
167+
## Dropping Support for Bazel <5.3 {#bazel}
168+
169+
v23 will drop support for Bazel 4. Protobuf will continue to support the Bazel 5
170+
LTS with Bazel 5.3 as the minimum required version. This is per the build
171+
support policy described in
172+
[Foundational C++ Support Policy](https://opensource.google/documentation/policies/cplusplus-support#build_systems)
173+
and as reflected in the versions in
174+
[Foundational C++ Support](https://github.com/google/oss-policies-info/blob/main/foundational-cxx-support-matrix.md).
175+
176+
## Syntax Reflection Deprecation {#deprecation}
177+
178+
v23 will deprecate the ability to check syntax version using reflection. The
179+
deprecation will be included as warnings at build time. The capability will be
180+
removed in a future release.

content/news/v24.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
+++
2+
title = "News Announcements for Version 24.x"
3+
linkTitle = "Version 24.x"
4+
toc_hide = "true"
5+
description = "Changes announced for Protocol Buffers version 24.x."
6+
type = "docs"
7+
+++
8+
9+
The following announcements are specific to Version 24.x. For information
10+
presented chronologically, see [News](/news).
11+
12+
## Stricter validation for `json_name` {#json-name}
13+
14+
v24 will forbid embedded null characters in the
15+
[`json_name` field option](/programming-guides/proto3/#json).
16+
Going forward, any valid Unicode characters will be accepted, **except**
17+
`\u0000`. Null will still be allowed in field values.
18+
19+
Previously, the proto compiler allowed null characters, but support for this was
20+
inconsistent across languages and implementations. To fix this, we are
21+
clarifying the spec to say that null is not allowed in `json_name`, and will be
22+
rejected by the compiler.

content/news/v25.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
+++
2+
title = "News Announcements for Version 25.x"
3+
linkTitle = "Version 25.x"
4+
toc_hide = "true"
5+
description = "Changes announced for Protocol Buffers version 25.x."
6+
type = "docs"
7+
+++
8+
9+
The following announcements are specific to Version 25.x. For information
10+
presented chronologically, see [News](/news).
11+
12+
## Python Breaking Change
13+
14+
In v25
15+
[`message.UnknownFields()`](https://googleapis.dev/python/protobuf/latest/google/protobuf/message.html#google.protobuf.message.Message.UnknownFields)
16+
will be deprecated in pure Python and C++ extensions. It will be removed in v26.
17+
Use the new
18+
[`UnknownFieldSet(message)`](https://googleapis.dev/python/protobuf/latest/google/protobuf/unknown_fields.html)
19+
support in `unknown_fields.py` as a replacement.
20+
21+
## μpb Moving to the Protobuf Git Repository
22+
23+
Starting with the v25 release, μpb now lives in the
24+
[protobuf repo](https://github.com/protocolbuffers/protobuf) instead
25+
of in its [former location](https://github.com/protocolbuffers/upb)
26+
in a separate repo. All μpb development going forward will take place only in
27+
the new location.
28+
29+
The merger of the two repos will simplify and speed up our development process
30+
by removing the need to update pinned version dependencies between protobuf and
31+
μpb. Changes to μpb now take effect immediately in protobuf code and vice versa,
32+
without the need for a manual upgrade step.
33+
34+
We expect that most users will not need to take much, if any, action to
35+
accommodate the change. μpb is the engine behind our Ruby, PHP, and Python
36+
implementations, but you will most likely not notice the change unless you have
37+
code that refers to μpb directly.
38+
39+
If you refer to μpb from a Bazel project, you will need to update μpb references
40+
to point to protobuf instead (for example, replace `@upb` with
41+
`@com_google_protobuf`). We are keeping μpb file paths and Bazel targets the
42+
same to minimize the need for additional changes, but there are two exceptions:
43+
44+
- The `upbc` directory has been renamed `upb_generator`.
45+
- The top-level `BUILD` file for μpb has moved into the `upb` directory. So,
46+
for example, references to `@upb//:reflection` should now be written
47+
`@com_google_protobuf//upb:reflection`.

0 commit comments

Comments
 (0)