Use createMessage() of type GeneratedMessage Function() in Dart protoc compiler#1093
Conversation
786ce2e to
b9bf0fe
Compare
sigurdm
left a comment
There was a problem hiding this comment.
LGTM
This is probably a breaking change though.
|
@sigurdm Do you know how I can fix the PR failures? I formatted locally before pushing, but it still seems fail. Maybe the bot uses a slightly different Dart SDK with slightly different analyzer infos? |
I will try this in g3 before landing & measure impact on some apps before landing. In reality I hope this doesn't break anyone as it'd be strange to use |
Package publishingIf you have publishing permissions, you can use the links below to publish the changes after merging this PR.
Documentation at https://github.com/dart-lang/ecosystem/wiki/Publishing-automation. |
|
Yeah it would be strange, but people do the strangest things... If we cannot find any breakages I'm ok with a minor release At least we should try see how this fares against google3. The protoc_plugin pubspec should have its constraint on protobuf updated to require at least this new version. |
|
/cc @rakudrama |
create() functions have GeneratedMessage Function() typecreateMessage() of type GeneratedMessage Function() in Dart protoc compiler
bc8eac5 to
0a69d5a
Compare
|
@sigurdm The g3 change landed (with small update sent today). This is now mirroring those changes externally to avoid github<->g3 drift. |
Often apps use extensive numbers of protos. The
BuilderInfoof a proto will refer to sub proto messages via usingFoo.createtear-offs.Big apps can end up with tens of thousands of those
<name>.createclosures. All of them currently have a unique<name> Function()function type.Though the actual usage of those closures is only in contexts where the caller of the closure expects a
GeneratedMessageas return type. If a caller knew the actual return type, then the caller could call the constructor directly.To avoid having to create potentially tens of thousands of unique function types, we make those closures have the
GeneratedMessage Function()type.This mirrors cl/923994549 & cl/940364489