-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Import Protobuf types from other packages #295
Comments
No, I don't think we support such a thing currently. Are you in control of both A and B? maybe you could gather all the proto files in a shared package C? |
For us, |
No unfortunately we do not have a thing like that. How would such an option work? Would it be an option in the .proto file or on the protoc invocation? |
I'd expect there to be a file-level Protobuf option. Something like option dart_package = 'helpful_library'; Now when generating code, a protoc compiler has access to the descriptor of imported types (through Maybe, you'll have a better idea. The main disadvantage of this solution is that it'd require changing the standard library types (or hardcoding them). In general, this works only if the upstream types are declared with the option. |
This is similar to other options such as |
That would work I think - but would have to go into package A. |
Ah - I read again - you control package A. Then this is the right thing to do. |
@dmdashenkov would #298 work for your use case? |
Yes, that PR should solve my problem, as far as I can see. Thanks. |
Hi. Any updates on the feature status? |
Sorry for the silence. |
@sigurdm, thanks for the update. |
Sorry - this is currently only tracked on an internal PR. |
Hi. Are there any updates on this issue? |
No unfortunately I had some trouble landing this in the google internal protobuf library, and got swept away with other priorities. |
Hey is this going to be back on your radar any time soon? I've been trying to find a workaround for a couple of days now, and without this fix it seems my only option is to bundle all my code together in one package instead of splitting it up. It sounds like we're waiting for an internal google change, but if there's anything I can help with to get it moving, let me know - I'm happy to help... |
Just another quick ping on this issue... It would be really great to get it resolved. There's no convenient work-around unfortunately... |
any updates on this? |
Are there any news on this? |
highly needed |
Assuming we have 2 Dart packages.
Package
A
is a library. It defines Protobuf types and Dart utilities to work with them.Package
B
depends onA
. It also defines Protobuf types, which depend on types fromA
.When trying to build
B
, we cannot avoid re-generating Dart code for Protobuf types isA
. If we don't generateA
types again,B
types are generated with relative imports forB
types and do not compile.Is there a way to make the plugin use absolute imports and configure the mapping of imported types to the Dart packages which contain them?
The text was updated successfully, but these errors were encountered: