Skip to content

shorten the deprecation messages for clone() and copyWith() #999

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

Merged
merged 3 commits into from
May 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions protoc_plugin/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* Read `default_host` and `oauth_scopes` options from gRPC service definitions
and write that information to the generated gRPC clients.
* Generate dartdocs for grpc services ([#973]).
* Adjust the deprecation messages for the message `clone()` and `copyWith()`
methods ([#998]).

We now parse and generate code cooresponding to the proto options
`google.api.default_host` and `google.api.oauth_scopes`:
Expand Down Expand Up @@ -49,6 +51,7 @@ class FirestoreClient extends $grpc.Client {
[#975]: https://github.com/google/protobuf.dart/issues/975
[#952]: https://github.com/google/protobuf.dart/issues/952
[#986]: https://github.com/google/protobuf.dart/issues/986
[#998]: https://github.com/google/protobuf.dart/issues/998

## 22.0.1

Expand Down
96 changes: 24 additions & 72 deletions protoc_plugin/lib/src/generated/client.pb.dart
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,10 @@ class CommonLanguageSettings extends $pb.GeneratedMessage {
subBuilder: SelectiveGapicGeneration.create)
..hasRequiredFields = false;

@$core.Deprecated('Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
'Will be removed in next major version')
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
CommonLanguageSettings clone() =>
CommonLanguageSettings()..mergeFromMessage(this);
@$core.Deprecated('Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
CommonLanguageSettings copyWith(
void Function(CommonLanguageSettings) updates) =>
super.copyWith((message) => updates(message as CommonLanguageSettings))
Expand Down Expand Up @@ -200,13 +196,9 @@ class Publishing extends $pb.GeneratedMessage {
..aOS(111, _omitFieldNames ? '' : 'restReferenceDocumentationUri')
..hasRequiredFields = false;

@$core.Deprecated('Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
'Will be removed in next major version')
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
Publishing clone() => Publishing()..mergeFromMessage(this);
@$core.Deprecated('Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
Publishing copyWith(void Function(Publishing) updates) =>
super.copyWith((message) => updates(message as Publishing)) as Publishing;

Expand Down Expand Up @@ -381,13 +373,9 @@ class JavaSettings extends $pb.GeneratedMessage {
subBuilder: CommonLanguageSettings.create)
..hasRequiredFields = false;

@$core.Deprecated('Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
'Will be removed in next major version')
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
JavaSettings clone() => JavaSettings()..mergeFromMessage(this);
@$core.Deprecated('Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
JavaSettings copyWith(void Function(JavaSettings) updates) =>
super.copyWith((message) => updates(message as JavaSettings))
as JavaSettings;
Expand Down Expand Up @@ -487,13 +475,9 @@ class CppSettings extends $pb.GeneratedMessage {
subBuilder: CommonLanguageSettings.create)
..hasRequiredFields = false;

@$core.Deprecated('Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
'Will be removed in next major version')
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
CppSettings clone() => CppSettings()..mergeFromMessage(this);
@$core.Deprecated('Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
CppSettings copyWith(void Function(CppSettings) updates) =>
super.copyWith((message) => updates(message as CppSettings))
as CppSettings;
Expand Down Expand Up @@ -552,13 +536,9 @@ class PhpSettings extends $pb.GeneratedMessage {
subBuilder: CommonLanguageSettings.create)
..hasRequiredFields = false;

@$core.Deprecated('Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
'Will be removed in next major version')
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
PhpSettings clone() => PhpSettings()..mergeFromMessage(this);
@$core.Deprecated('Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
PhpSettings copyWith(void Function(PhpSettings) updates) =>
super.copyWith((message) => updates(message as PhpSettings))
as PhpSettings;
Expand Down Expand Up @@ -629,14 +609,10 @@ class PythonSettings_ExperimentalFeatures extends $pb.GeneratedMessage {
..aOB(3, _omitFieldNames ? '' : 'unversionedPackageDisabled')
..hasRequiredFields = false;

@$core.Deprecated('Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
'Will be removed in next major version')
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
PythonSettings_ExperimentalFeatures clone() =>
PythonSettings_ExperimentalFeatures()..mergeFromMessage(this);
@$core.Deprecated('Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
PythonSettings_ExperimentalFeatures copyWith(
void Function(PythonSettings_ExperimentalFeatures) updates) =>
super.copyWith((message) =>
Expand Down Expand Up @@ -740,13 +716,9 @@ class PythonSettings extends $pb.GeneratedMessage {
subBuilder: PythonSettings_ExperimentalFeatures.create)
..hasRequiredFields = false;

@$core.Deprecated('Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
'Will be removed in next major version')
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
PythonSettings clone() => PythonSettings()..mergeFromMessage(this);
@$core.Deprecated('Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
PythonSettings copyWith(void Function(PythonSettings) updates) =>
super.copyWith((message) => updates(message as PythonSettings))
as PythonSettings;
Expand Down Expand Up @@ -822,13 +794,9 @@ class NodeSettings extends $pb.GeneratedMessage {
subBuilder: CommonLanguageSettings.create)
..hasRequiredFields = false;

@$core.Deprecated('Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
'Will be removed in next major version')
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
NodeSettings clone() => NodeSettings()..mergeFromMessage(this);
@$core.Deprecated('Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
NodeSettings copyWith(void Function(NodeSettings) updates) =>
super.copyWith((message) => updates(message as NodeSettings))
as NodeSettings;
Expand Down Expand Up @@ -923,13 +891,9 @@ class DotnetSettings extends $pb.GeneratedMessage {
..pPS(6, _omitFieldNames ? '' : 'handwrittenSignatures')
..hasRequiredFields = false;

@$core.Deprecated('Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
'Will be removed in next major version')
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
DotnetSettings clone() => DotnetSettings()..mergeFromMessage(this);
@$core.Deprecated('Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
DotnetSettings copyWith(void Function(DotnetSettings) updates) =>
super.copyWith((message) => updates(message as DotnetSettings))
as DotnetSettings;
Expand Down Expand Up @@ -1024,13 +988,9 @@ class RubySettings extends $pb.GeneratedMessage {
subBuilder: CommonLanguageSettings.create)
..hasRequiredFields = false;

@$core.Deprecated('Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
'Will be removed in next major version')
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
RubySettings clone() => RubySettings()..mergeFromMessage(this);
@$core.Deprecated('Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
RubySettings copyWith(void Function(RubySettings) updates) =>
super.copyWith((message) => updates(message as RubySettings))
as RubySettings;
Expand Down Expand Up @@ -1099,13 +1059,9 @@ class GoSettings extends $pb.GeneratedMessage {
packageName: const $pb.PackageName('google.api'))
..hasRequiredFields = false;

@$core.Deprecated('Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
'Will be removed in next major version')
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
GoSettings clone() => GoSettings()..mergeFromMessage(this);
@$core.Deprecated('Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
GoSettings copyWith(void Function(GoSettings) updates) =>
super.copyWith((message) => updates(message as GoSettings)) as GoSettings;

Expand Down Expand Up @@ -1179,14 +1135,10 @@ class SelectiveGapicGeneration extends $pb.GeneratedMessage {
..aOB(2, _omitFieldNames ? '' : 'generateOmittedAsInternal')
..hasRequiredFields = false;

@$core.Deprecated('Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
'Will be removed in next major version')
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
SelectiveGapicGeneration clone() =>
SelectiveGapicGeneration()..mergeFromMessage(this);
@$core.Deprecated('Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
SelectiveGapicGeneration copyWith(
void Function(SelectiveGapicGeneration) updates) =>
super.copyWith((message) => updates(message as SelectiveGapicGeneration))
Expand Down
16 changes: 4 additions & 12 deletions protoc_plugin/lib/src/generated/dart_options.pb.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,9 @@ class DartMixin extends $pb.GeneratedMessage {
..aOS(3, _omitFieldNames ? '' : 'parent')
..hasRequiredFields = false;

@$core.Deprecated('Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
'Will be removed in next major version')
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
DartMixin clone() => DartMixin()..mergeFromMessage(this);
@$core.Deprecated('Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
DartMixin copyWith(void Function(DartMixin) updates) =>
super.copyWith((message) => updates(message as DartMixin)) as DartMixin;

Expand Down Expand Up @@ -143,13 +139,9 @@ class Imports extends $pb.GeneratedMessage {
subBuilder: DartMixin.create)
..hasRequiredFields = false;

@$core.Deprecated('Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
'Will be removed in next major version')
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
Imports clone() => Imports()..mergeFromMessage(this);
@$core.Deprecated('Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
Imports copyWith(void Function(Imports) updates) =>
super.copyWith((message) => updates(message as Imports)) as Imports;

Expand Down
Loading