Changes made on May 6, 2022

Versioning

We changed our versioning scheme to enable more-nimble updates to language-specific parts of Protocol Buffers. In the new scheme, each language has its own major version that can be incremented independently of other languages, as covered later in this topic with the Python release. The minor and patch versions, however, will remain coupled. This allows us to introduce breaking changes into some languages without requiring a bump of the major version in languages that do not experience a breaking change.

The first instance of this new versioning scheme is the new version of the Python API, 4.21.0, which follows the preceding version, 3.20.1. Other language APIs will be released as 3.21.0.

Python Updates

We made some changes in Python language support in Protocol Buffers. Version 4.21.0 is a new major version, following 3.20.1. The new version is based on the upb library, and offers significantly better parsing performance than previous releases, especially for large payloads. It also includes prebuilt binary modules for Apple silicon for increased performance without a manual build.

The new release does contain some breaking changes. Specifically:

  • The UnknownFields() method, which relied on an implicitly created class, is replaced with the explicitly-created UnknownFieldSet class.
  • Some non-core characteristics may have changed, such as the specific format of certain strings or error messages. These are not considered breaking changes, but may still impact your existing code base.
  • Applications that rely on sharing messages between Python and C++ break in the new version. Most developers won't be affected by this, but users of Nucleus and possibly other libraries may be. As a workaround, you can set an environment variable that forces the library to preserve compatibility.
  • Python upb requires generated code that has been generated from protoc 3.19.0 or newer.

JavaScript Support

We moved some things around for Protocol Buffer support of JavaScript to allow JavaScript to evolve and release independently of the main repo. Specifically, we decoupled the language support from the main project (https://github.com/protocolbuffers/protobuf) and moved it into its own repository (https://github.com/protocolbuffers/protobuf-javascript).

If you have created any pull requests related to JavaScript support in Protocol Buffers that you'd still like to merge, feel free to replicate those against the JavaScript repository. We will transfer GitHub issues automatically.