github.com/jhump/protoreflect
v1.18.0
#1490 most downloaded on Go modules
jhump/protoreflect
What this package is like to depend on
Last release 7 months ago
20 Jan 2026
Ships unpredictably
gaps range from 2 weeks to 1.4 years
Rarely documented
notes for 8 of 37 stable releases
Nothing withdrawn
no release was ever pulled
10 years old
331 releases · first in 2017
1 release in the last 12 months
see the full history below
Release timeline
331 releases · Feb 2017 to Jan 2026Releases
latest 60 of 331-
v1.18.020 Jan 2026Release notes
Open source →This is expected to be the final release of this module with a v1.x version. (All subsequent releases are expected to be v2.x.)
The main change here is to insulate users from any future backwards-incompatible changes in
bufbuild/protocompile. Previous releases (between 1.15 and 1.17, inclusive) depended on this module, but it hasn't yet released a stable v1.0 version, so it has occasionally been a turbulent dependency. More breaking changes are expected since it is expected to get a totally new compiler and API before it reaches v1.0. So anyone still using v1 of this repo should update to this new release before then to avoid being broken when that happens."github.com/jhump/protoreflect/desc/builder"
Changes/fixes:
- If resolving custom options and extensions resulted in a generated extension description created by the older v1 of
protoc-gen-go, a nil-dereference panic could occur. This has been fixed. Instead, the legacy extension that would otherwise have caused a panic will now either be ignored or, ifBuilderOptions.RequireInterpretedOptionsis set to true, result in an error that not all options could be interpreted.- The older v1 has import path
"github.com/golang/protobuf/protoc-gen-go". It was replaced in 2020 by the v2, which is at path"google.golang.org/protobuf/cmd/protoc-gen-go".
- The older v1 has import path
"github.com/jhump/protoreflect/desc/protoparse"
Changes/fixes:
- The internal compiler no longer comes from a separate Go module. Instead, this module now contains a fork of
bufbuild/protocompile, which will maintain stability even when the upstream repo diverges with unstable/breaking changes. The only user-visible changes would be related to Editions support, thanks to unreleased changes in upstream that were included in this repo's fork. (See more below.)
Additions:
- This adds a field named
AllowExperimentalEditionsto theprotoparse.Parserstruct. When set to true, the parser will accept and return descriptors for files that use Edition 2024 (the only experimental edition at this time). It is experimental because it does not implement all of the rules and semantics of Edition 2024. But it does provide the ability to parse and compile files that include new language features in Edition 2024, such as visibility modifiers (exportandlocal) as well as theoptionimport modifier.
"github.com/jhump/protoreflect/desc/protoprint"
Changes/fixes:
- If resolving custom options and extensions resulted in a generated extension description created by the older v1 of
protoc-gen-go, a nil-dereference panic could occur. This has been fixed. Instead, the legacy extension that would otherwise have caused a panic is ignored and will not be included in the printed output (since it would result in an invalid source file that could not be compiled).
- If resolving custom options and extensions resulted in a generated extension description created by the older v1 of
-
v1.17.1-0.20240913204751-8f5fd1dcb3c513 Sep 2024 pre-releaseNothing published for this version
-
v1.17.004 Sep 2024Release notes
Open source →This release deprecates some packages that have newer alternatives in the Protobuf runtime. It also includes some small additions to the
grpcreflectanddesc/sourceinfopackages. The rest of the changes are bug fixes."github.com/jhump/protoreflect/desc"
Changes:
- This package is now deprecated. Though use of this package is still needed in order to use a handful of other packages in this repo, many usages should instead prefer the
"google.golang.org/protobuf/reflect/protoreflect"package in the Protobuf runtime. In a v2 of this repo, this package will no longer be present. - A performance improvement was contributed that speeds up the
MessageDescriptor.FindFieldByNamemethod.
"github.com/jhump/protoreflect/desc/protoparse"
Changes and bugfixes:
- This package is now deprecated. Most usages should instead prefer the
"github.com/bufbuild/protocompile"package. There are some behavioral differences that we hope to address with additional API and enhancements toprotocompile. But theprotoparsepackage here is just a veneer on top ofprotocompileand we plan to do as little maintenance as possible here. In a v2 of this repo, this package will no longer be present. - The
protocompiledependency has been updated to use a more recent version of that package. This addresses potential panics when callingParser.ParseButDontLink.
"github.com/jhump/protoreflect/desc/sourceinfo"
Changes and bugfixes:
- A possible panic when calling
sourceinfo.GlobalFiles.FindDescriptorByNamehas been fixed. - Descriptors returned from the
sourceinfo.GlobalFilesregistry or from the variousWrap*functions could induce panics in user code if querying for non-existent elements. For example, callingmessageDescriptor.Fields().ByNumber(123)could return a typed-nil value on failure, instead of a nil interface. This would result in nil-dereference panics if methods were called on this later. These have been fixed. - Descriptors returned from the
sourceinfo.GlobalFilesregistry and from the variousWrap*functions had concrete types defined in this package, not in the Protobuf runtime. But theprotoreflect.Descriptorinterface has a "do not implement" marker, indicating that concrete types implementing the interface should not be implemented outside of that module. To avoid future issues with the Protobuf runtime, there are no more implementations in this repo. Instead of wrapping other descriptor implementations (via embedding, and then overriding some methods), this package now builds new descriptors, using theprotodescpackage in the Protobuf runtime module. - The various
Wrap*functions are now deprecated. The name is no longer accurate since they no longer return wrapper values. Also the new implementation, which builds new descriptors, can fail (though unlikely), but the existing signature of these functions did not allow for returning an error. So these functions could possibly panic in the face of malformed input descriptors. Users should use the newAddSourceInfoTo*versions of these functions instead.
Additions:
- Adds
AddSourceInfoTo*functions to replace theWrap*functions. These functions augment the input descriptors by adding source code information to them.
"github.com/jhump/protoreflect/dynamic"
Changes:
- This package is now deprecated. Most usages should instead prefer the
"google.golang.org/protobuf/types/dynamicpb"package in the Protobuf runtime. In a v2 of this repo, this package will no longer be present.
"github.com/jhump/protoreflect/grpcreflect"
Additions:
- Adds a new
NewClientV1function to return a client that uses v1 of the server reflection service. This fills the gap in the existing factory functions,NewClientV1AlphaandNewClientAuto. - Adds a new
AllowFallbackResolvermethod to the*grpcreflect.Clienttype. This allows the client to be configured with an alternate resolver that can be used as a backup when trying to satisfy dependencies, for cases where the remote server is non-authoritative and unable to provide all of them.
- This package is now deprecated. Though use of this package is still needed in order to use a handful of other packages in this repo, many usages should instead prefer the
-
v1.16.1-0.20240904192601-06e5c080c18204 Sep 2024 pre-releaseNothing published for this version
-
v1.16.1-0.20240830175618-645b9ddf9fa030 Aug 2024 pre-releaseNothing published for this version
-
v1.16.1-0.20240613192404-9b68e7bc512b13 Jun 2024 pre-releaseNothing published for this version
-
v1.16.1-0.20240604182304-9fdd9425124b04 Jun 2024 pre-releaseNothing published for this version
-
v1.16.1-0.20240530224051-baac311255d930 May 2024 pre-releaseNothing published for this version
-
v1.16.1-0.20240529155441-bed9136cc4f229 May 2024 pre-releaseNothing published for this version
-
v1.16.1-0.20240507144338-cb1d268a68e807 May 2024 pre-releaseNothing published for this version
-
v1.16.1-0.20240409213050-1ba1524ad02609 Apr 2024 pre-releaseNothing published for this version
-
v1.16.009 Apr 2024Release notes
Open source →This release adds support for Protobuf Editions to many of the packages. Note, however, that the
desc/protoparsepackage does not yet work to parse Protobuf Editions source files. This release also includes a handful of bug-fixes."github.com/jhump/protoreflect/desc"
Additions:
- Adds an
Editionmethod to*desc.FileDescriptor, which returns non-zero for files that use Protobuf Editions (instead of syntax "proto2" or "proto3").
Changes/fixes:
- Fixes an issue in the various
Wrap*functions, that could result in a descriptor hierarchy where the same descriptors were incorrectly present multiple times. This could happen if a file in the transitive dependency graph being wrapped had more than one incoming edge (e.g. same file appearing in import statements from two or more other files).
"github.com/jhump/protoreflect/desc/builder"
Additions:
- Adds an
Editionsfield andSetEditionsmethod to*builder.FileBuilder, for creating files that use Protobuf Editions.
"github.com/jhump/protoreflect/desc/protoprint"
Changes/fixes:
- Now correctly prints the contents for files that use Protobuf Editions. Previously, if given a descriptor for a file used Protobuf Editions, it could generate invalid source output.
- Fixed a bug when
Printer.CustomSortFunctionwas set wherein enum values could be printed in incorrect order, resulting in invalid source output. In syntax "proto3" and in open enums in Protobuf Editions, the first value must be the one with a zero numeric value.
"github.com/jhump/protoreflect/grpcreflect"
Additions:
- Adds a new
AllowMissingFileDescriptorsmethod to*grpcreflect.Clientthat allows users to opt-in to a lenient mode that will try to return schemas even when some files are unavailable. This will only be successful in cases where the missing files only provide custom options or are unused imports. This restores some lenience that was inadvertently provided (due to bugs and missing validation checks) when versions of this repo prior to v1.15 were combined with versions of thegoogle.golang.org/grpcmodule prior to v1.61.
- Adds an
-
v1.15.7-0.20240406124403-8d1f661155e006 Apr 2024 pre-releaseNothing published for this version
-
v1.15.7-0.20240404002955-a41e823f5c4e04 Apr 2024 pre-releaseNothing published for this version
-
v1.15.7-0.20240404001333-0935deb57b6204 Apr 2024 pre-releaseNothing published for this version
-
v1.15.7-0.20240307171101-7624c3ad1e5907 Mar 2024 pre-releaseNothing published for this version
-
v1.15.7-0.20240207011949-7195054027de07 Feb 2024 pre-releaseNothing published for this version
-
v1.15.622 Jan 2024Release notes
Open source →This is a bugfix release to address recently identified regressions in the
desc/protoparsepackage -- things that worked in v1.14.1 but did not work in v1.15.x."github.com/jhump/protoreflect/desc/protoparse"
Changes/fixes:
- The documentation for the
Parser.ImportPathsfield specifies that the field is not used for calls to theParser.ParseFilesButDoNotLinkmethod. This is because import paths do not need to be resolved if not linking. But as of v1.15.0, theImportPathsfield was being used for that method, and the difference in behavior could break existing programs. This has been fixed, and the behavior once again matches the spec. - As of v1.15.0, if a path provided to
Parser.ParseFileswere resolved as descriptors (via theParser.LookupImportorParser.LookupImportProtofunctions) instead of as source code (via theParser.Accessorfunction or the default action ofos.Open), the parse operation would fail with a "no such file" error. This would succeed with v1.14.1, with the descriptor being used as the input for the file instead of the file being parsed from source. So working programs could have been broken by an upgrade to v1.15.x. The package has been changed back to the v1.14.1 behavior.
- The documentation for the
-
v1.15.6-0.20240122203203-e6d8c426800422 Jan 2024 pre-releaseNothing published for this version
-
v1.15.522 Jan 2024Release notes
Open source →This is a bugfix release to address bugs in the
desc/builder,desc/protoparse, andgrpcreflectpackages and a compatibility issue with the most recent version ofgithub.com/bufbuild/protocompile."github.com/jhump/protoreflect/desc/builder"
Changes/fixes:
- A regression was introduced in v1.15.0 of this package that could cause it to fail to include some imports in a file for custom options. If the custom option in question was in a known transitive dependency, the builder could fail to add the necessary import. This has been fixed.
"github.com/jhump/protoreflect/desc/protoparse"
Changes/fixes:
- As of v1.15.0, this package uses the
github.com/bufbuild/protocompilepackage under the hood as the parser. But that package is still using major version zero, since it's API has not completely stabilized. A recent release (v0.8.0) included backwards-incompatible changes that caused this repo to no longer compile. This release addresses the compile errors: this repo now uses that latest release ofprotocompileand correctly compiles against it. - The use of v0.8.0 of protocompile fixes some issues in the
desc/protoparsepackage that could cause it to incorrectly accept or reject some Protobuf source files. See the release notes for protocompile v0.8.0 for more details.
"github.com/jhump/protoreflect/grpcreflect"
Changes/fixes:
- The
grpcreflect.NewClientAutofunction (added in v1.14.0) returns a client that automatically falls back to using v1alpha of the reflection protocol if the server does not support v1. However, it relied on the server returning an "unimplemented" error to decide to fall back, but this condition has been observed to sometimes instead manifest as an "unavailable" error (in proxies that fail to write a 404 error before closing the connection). In those cases, the client was not correctly falling back to v1alpha. This release remedies that, so it can fallback to v1alpha when this category of error occurs.
-
v1.15.5-0.20240110151556-bf8a7d83614510 Jan 2024 pre-releaseNothing published for this version
-
v1.15.407 Dec 2023Release notes
Open source →This is a bugfix release to address bugs in the
desc/protoprintpackage and a compatibility issue with the most recent version ofgithub.com/bufbuild/protocompile."github.com/jhump/protoreflect/desc/protoparse"
Changes/fixes:
- As of v1.15.0, this package uses the
github.com/bufbuild/protocompilepackage under the hood as the parser. But that package is still using major version zero, since it's API has not completely stabilized. A recent release (v0.7.0) included backwards-incompatible changes that caused this repo to no longer compile. This release addresses the compile errors: this repo now uses that latest release ofprotocompileand correctly compiles against it.
"github.com/jhump/protoreflect/desc/protoprint"
Changes/fixes:
- When a string literal included a double-quote character (
"), it would get printed incorrectly leading to either an incorrect string literal in some cases or an invalid and uncompilable source file in others. This has been fixed. - When sorting elements in the file, if the file used proto3 syntax and had an enum with negative numeric values, the result would include the negative values first, before the zero value. This is not allowed in proto3 syntax, which requires that the zero value be the first value, so the result would be an invalid and uncompilable source file. This has been fixed.
- When a source file is parsed into a
FileDescriptorProtobut never linked, the descriptor may be missing thetypefield of aFieldDescriptorProto(since it is not known whether a named type refers to a message, group, or enum), and it may have options left in theuninterpreted_optionsfield of the various options messages, which has a peculiar representation for aggregate values. When printing a descriptor that had these characteristics, they were not correctly handled, so the output of the printer would be an invalid and uncompilable source file. Both of these cases have been fixed.
- As of v1.15.0, this package uses the
-
v1.15.4-0.20231103125430-dd8b73728bbd03 Nov 2023 pre-releaseNothing published for this version
-
v1.15.4-0.20231102172117-5d002922aeac02 Nov 2023 pre-releaseNothing published for this version
-
v1.15.4-0.20231031171801-e429ee6b353731 Oct 2023 pre-releaseNothing published for this version
-
v1.15.4-0.20231026214332-3839451e167726 Oct 2023 pre-releaseNothing published for this version
-
v1.15.4-0.20231012193750-937385c353f312 Oct 2023 pre-releaseNothing published for this version
-
v1.15.4-0.20231011193459-a4984b210beb11 Oct 2023 pre-releaseNothing published for this version
-
v1.15.302 Oct 2023Release notes
Open source →This is a bugfix release to address a panics in the
desc/builderanddesc/protoparsepackages."github.com/jhump/protoreflect/desc/builder"
Changes/fixes:
- When building an enum where some values in an
EnumBuilderhad numbers explicitly assigned and others did not, a panic could occur. This panic has now been fixed. When there is a mix of explicit value numbers and implicit numbers, the implicit values will be auto-assigned available numbers (starting at zero) while the explicit values will use the configured number.
"github.com/jhump/protoreflect/desc/protoparse"
Changes/fixes:
- When the
protoparsepackage was overhauled in v1.15.0, a bug was inadvertently introduced to the functionality related to theParser.InferImportPathsflag. If the files being processed imported a file for which an AST was not available (which is actually quite common, since they may import a standard file such as "google/protobuf/empty.proto"), a panic would occur. This panic has been fixed. - This release includes some other improvements related to the same
Parser.InferImportPathsflag which now allow it to better detect file layouts and remedy import mismatches in more scenarios.
- When building an enum where some values in an
-
v1.15.3-0.20231002200128-35c59573d6b102 Oct 2023 pre-releaseNothing published for this version
-
v1.15.3-0.20230906125729-63b3dc80de1706 Sep 2023 pre-releaseNothing published for this version
-
v1.15.223 Aug 2023Release notes
Open source →This is a bugfix release to address issues found in the
desc/protoparsepackage."github.com/jhump/protoreflect/desc/protoparse"
Changes/fixes:
- A fix was added to v1.15.1 so that descriptors returned from this package would use statically known extension types for custom options, and custom options in the source that were not statically known would be represented as unrecognized fields. However, the fix was incomplete: only the files whose names were explicitly given to the
Parserwere updated in this fashion. Other files in the transitive dependency (i.e. imports) did not have options represented this way. As of this release, the fix is complete and all descriptors returned by this package should have the same representation for custom options as in v1.14 and earlier. - As of v1.15.0, this package uses the
github.com/bufbuild/protocompilepackage under the hood as the parser. But that package is still using major version zero, since it's API has not completely stabilized. A recent release (v0.6.0) included backwards-incompatible changes that caused this repo to no longer compile. This release addresses the compile errors: this repo now uses that latest release ofprotocompileand correctly compiles against it.
- A fix was added to v1.15.1 so that descriptors returned from this package would use statically known extension types for custom options, and custom options in the source that were not statically known would be represented as unrecognized fields. However, the fix was incomplete: only the files whose names were explicitly given to the
-
v1.15.2-0.20230823173643-8baa4530a00423 Aug 2023 pre-releaseNothing published for this version
-
v1.15.2-0.20230823164322-00716cdf2e9c23 Aug 2023 pre-releaseNothing published for this version
-
v1.15.2-0.20230823163948-f770609c42a623 Aug 2023 pre-releaseNothing published for this version
-
v1.15.2-0.20230712171414-4f8401b7cc9a12 Jul 2023 pre-releaseNothing published for this version
-
v1.15.2-0.20230705224131-0880b178bdd805 Jul 2023 pre-releaseNothing published for this version
-
v1.15.2-0.20230531130918-5e6d88e1024531 May 2023 pre-releaseNothing published for this version
-
v1.15.2-0.20230304131404-5556ec8c531a04 Mar 2023 pre-releaseNothing published for this version
-
v1.15.103 Mar 2023Nothing published for this version
-
v1.15.1-0.20230302220232-7923b758f8db02 Mar 2023 pre-releaseNothing published for this version
-
v1.15.026 Feb 2023Nothing published for this version
-
v1.15.0-rc2.0.20230226203944-bc601aed79cb26 Feb 2023 pre-releaseNothing published for this version
-
v1.15.0-rc2.0.20230224145514-7fcc3b0970e424 Feb 2023 pre-releaseNothing published for this version
-
v1.15.0-rc223 Feb 2023 pre-releaseNothing published for this version
-
v1.15.0-rc1.0.20230223210348-1d6372858f8123 Feb 2023 pre-releaseNothing published for this version
-
v1.15.0-rc1.0.20230125205337-220303e08f2b25 Jan 2023 pre-releaseNothing published for this version
-
v1.15.0-rc1.0.20230119152317-fea8ba400f7f19 Jan 2023 pre-releaseNothing published for this version
-
v1.15.0-rc113 Jan 2023 pre-releaseNothing published for this version
-
v1.14.2-0.20230113171923-d2a36df33c3113 Jan 2023 pre-releaseNothing published for this version
-
v1.14.2-0.20230111171104-0400f4d4f92211 Jan 2023 pre-releaseNothing published for this version
-
v1.14.2-0.20230111151903-746ed7b7fe3911 Jan 2023 pre-releaseNothing published for this version
-
v1.14.117 Nov 2022Nothing published for this version
-
v1.14.1-0.20221117133015-0facb742c9dc17 Nov 2022 pre-releaseNothing published for this version
-
v1.14.006 Oct 2022Nothing published for this version
-
v1.13.1-0.20221006134134-3b27be23ad5206 Oct 2022 pre-releaseNothing published for this version
-
v1.13.1-0.20221003170304-ac1361ca295403 Oct 2022 pre-releaseNothing published for this version
-
v1.13.1-0.20220928232736-101791cb1b4c28 Sep 2022 pre-releaseNothing published for this version
-
v1.13.1-0.20220928191405-901e73ef089228 Sep 2022 pre-releaseNothing published for this version
-
v1.13.022 Aug 2022Nothing published for this version