Comments (15)
@avivbaron, see https://github.com/bufbuild/protocompile?tab=readme-ov-file#migrating-from-protoparse
from protoreflect.
@Shnitzelil, I'm afraid not. I've hit some snags in the way v2 of the repo wants to decorate instances of protoreflect.Descriptor
. While the v2 branch is close to ready for release as far as features and quality, these snags may mean I need to re-write parts of it to avoid future disasters regarding compatibility with future protobuf-go releases.
The main issue is whether the protobuf-go project will continue to allow external implementations of the descriptor interfaces in the future. While the v2 branch works just fine today, the current maintainers of protobuf-go are considering changing that -- having their internal code be able to type-assert to their internal concrete implementations. That means nothing outside the package would be able to implement the interface (without risk of type-assertion panics); that would break stuff in my v2 branch, which provides wrappers/decorators that embed their instances. I'm still working with them to see the direction they'll take. But, unfortunately, chances are good that the direction will mean I need to make a good bit of changes to the v2 branch. Once that all settles, only then can I provide a release. Sorry for the delays.
from protoreflect.
Do you have any suggestions on how to replace it correctly or maybe you already working on adapting it to V2 ? :)
The README has a blurb at the top talking about this. I am working on a v2, and it's nearly done (https://github.com/jhump/protoreflect/tree/v2).
But, also, as of v1.15, interop between this repo and the protobuf API v2 should work fine. So it should be easy to continue using this repo and also use the new protobuf API v1 support for reflection, descriptors, and dynamic messages.
from protoreflect.
Do you have any suggestions on how to replace it correctly or maybe you already working on adapting it to V2 ? :)
The README has a blurb at the top talking about this. I am working on a v2, and it's nearly done (https://github.com/jhump/protoreflect/tree/v2).
But, also, as of v1.15, interop between this repo and the protobuf API v2 should work fine. So it should be easy to continue using this repo and also use the new protobuf API v1 support for reflection, descriptors, and dynamic messages.
I have an issue with the conversion between V1 message and V2. but i'll try to find a way to fix it.
Do you have an estimate of when the new version will be released?
Thanks :)
from protoreflect.
Do you have an estimate of when the new version will be released?
I had hoped to cut an initial release candidate in 2023 😞
I think the repo is really close. There may be some recent-ish changes on the main
branch that I need to cherry-pick or port to the v2 branch, but the functionality and the API and main code I think are all pretty much done. But it needs more test coverage (and inevitably fixes for whatever the new tests uncover). I would like to get it done soon.
from protoreflect.
Hi,
Thank you for your detailed answer.
Any chance you will be able to provide a kind of early access?
Would be very helpful for both of us.
I can provide some input about what working and what is not.
Thanks
from protoreflect.
@avivbaron, sure, you can already try it out. There have been no tagged releases on that work-in-progress branch, so you have to pull it in using a commit sha. This would pull in the current head of that branch:
go get github.com/jhump/protoreflect/v2@c9ae7caed596cda2e3c4a90f5973a46081a371a
The package structure is a little different. There is no longer any desc
, dynamic
, or desc/protoparse
at all. (The former two are replaced by functionality in the protobuf API v2; the latter replaced by github.com/bufbuild/protocompile
.) All of the other functionality is still present, but moved around a little. For example, desc/protoprint
and desc/builder
are now protoprint
and protobuilder
. And dynamic/msgregistry
functionality is now a part of the new protoresolve
package.
from protoreflect.
Thank you very much :)
from protoreflect.
Hey, I'm using the protoparse.Parser function in my project and I saw that there isn't parser package or function in your new version. can you help me with replacing it correctly?
Thanks :)
from protoreflect.
Thanks again for helping me a lot :)
After I did those changes I left with "*descriptorpb.FileDescriptorProto" object. How do I get "protoreflect.FileDescriptor" from it?
from protoreflect.
@avivbaron, sorry, I don't have enough context. What exactly are you doing? Most of the protocompile API is in terms of protoreflect.Descriptor
.
from protoreflect.
U r right. it was my mistake.
The last thing I got left to do is to find out how to fill "dependencies" in linker.Link() while the result object the i get from "parser.ResultFromAST()", result.FileDescriptorProto().Dependency returns []string instead of []linker.Files
from protoreflect.
@avivbaron, why are you calling the linker directly? What is it you are doing that prevents you from using the main protocompile.Compiler
? The root compiler package handles all of the steps. The sub-packages are only meant to be used if you are doing something custom, such as parsing without linking.
from protoreflect.
Thanks a lot! I'm done with the migration to the new protobuf modules all thanks to you :)
from protoreflect.
Hi,
Any official release for V2?
from protoreflect.
Related Issues (20)
- EnumBuilder panics if it contains EnumValue with explicitly set Number HOT 1
- might not be bug: false duplication report due to use of relative path instead of absolute path HOT 6
- SIGSEGV: panic: runtime error: invalid memory address or nil pointer dereference in v1.15.2 HOT 8
- Protoreflect doesn't fall back to to v1alpha when a gRPC unimplemented response is returned HOT 1
- String escaping in protoprint is wrong HOT 1
- First enum value must be 0 in proto3 [protoprint] HOT 2
- missing `{}` after printing option HOT 5
- Upgrade protocompile to v0.7.0 HOT 3
- go build error HOT 3
- Regression upgrading from v1.14.1 to v1.15.4: extensions are resolved recursively instead of non-recursively HOT 1
- Regression upgrading from v1.14.1 to v1.15.4: absolute paths no longer accepted by parser.ParseFilesButDoNotLink HOT 3
- Regression upgrading from v1.14.1 to v1.15.4: new mustBeSource constraint/check HOT 5
- Fail to compile proto file HOT 2
- Tests broken with google.golang.org/protobuf v1.33.0
- If there are messages nested in the proto file, the numbers will be recognised as strings HOT 2
- invalid memory address or nil pointer dereference HOT 5
- will return Symbol not found when the proto file has enum definition HOT 1
- Is there a way to UseProtoNames? HOT 2
- desc/builder: feature request: auto-de-duplicate builders and already-built descriptors in transitive graph HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from protoreflect.