feat: add unpack/2 to Protobuf.Any#429
Open
yordis wants to merge 1 commit intoelixir-protobuf:mainfrom
Open
Conversation
0266859 to
0011b05
Compare
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
0011b05 to
ce577e9
Compare
Contributor
Author
|
@whatyouhide here is the follow up work, I did the most safe way I found that would truely work across different projects, which I also tested there. I did not make assumptions about the prefix because as far as I can tell, we can't, but, correct me here. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Yordis Prieto yordis.prieto@gmail.com
Related to #360 and #409 this is the safest way I found to introduce the feature without making such big assumptions that it wouldn't work.
I have done this professionally for a while using https://hex.pm/packages/trogon_typeprovider
Intentionally, I did not make any assumptions around the
type_urlas far as I can tell, it is not required to betype.googleapis.com/prefixed.We could make the type provider module optional and fallback to some
Application.compiled_env!or something like that, personally, I rather introduce the feature avoiding global assumptions. We can always add a global function that make such assumption instead.