From a7e1ee3368014118aa154dec0c4cd7cb8d5b5c66 Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Tue, 11 Nov 2025 15:30:45 -0500 Subject: [PATCH 1/2] [pigeon] Deprecate dartHostTestHandler Deprecates `dartHostTestHandler`, in preparation for removing sometime in 2026 if no significant new information comes to light. Part of https://github.com/flutter/flutter/issues/178322 --- packages/pigeon/CHANGELOG.md | 7 +++++++ packages/pigeon/lib/src/generator_tools.dart | 2 +- packages/pigeon/lib/src/pigeon_lib.dart | 9 +++++++-- packages/pigeon/pubspec.yaml | 2 +- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/packages/pigeon/CHANGELOG.md b/packages/pigeon/CHANGELOG.md index 851e4fe694f..4dfdf4167df 100644 --- a/packages/pigeon/CHANGELOG.md +++ b/packages/pigeon/CHANGELOG.md @@ -1,3 +1,10 @@ +## 26.1.0 + +* Deprecates `dartHostTestHandler`. + * If you have a use case where this cannot easily be replaced with a mock or + fake of the generated Dart API, please provide details in + https://github.com/flutter/flutter/issues/178322. + ## 26.0.5 * [kotlin] Serialize custom enums as `Long` instead of `Int` to avoid `ClassCastException` on decoding. diff --git a/packages/pigeon/lib/src/generator_tools.dart b/packages/pigeon/lib/src/generator_tools.dart index eef39cb00bd..91032ee0b9c 100644 --- a/packages/pigeon/lib/src/generator_tools.dart +++ b/packages/pigeon/lib/src/generator_tools.dart @@ -15,7 +15,7 @@ import 'generator.dart'; /// The current version of pigeon. /// /// This must match the version in pubspec.yaml. -const String pigeonVersion = '26.0.5'; +const String pigeonVersion = '26.1.0'; /// Read all the content from [stdin] to a String. String readStdin() { diff --git a/packages/pigeon/lib/src/pigeon_lib.dart b/packages/pigeon/lib/src/pigeon_lib.dart index 48b6047ff03..9e00f0f2ee5 100644 --- a/packages/pigeon/lib/src/pigeon_lib.dart +++ b/packages/pigeon/lib/src/pigeon_lib.dart @@ -96,7 +96,10 @@ class ConfigurePigeon { /// generated host-platform interface. class HostApi { /// Parametric constructor for [HostApi]. - const HostApi({this.dartHostTestHandler}); + const HostApi({ + @Deprecated('Mock/fake the generated Dart API instead.') + this.dartHostTestHandler, + }); /// The name of an interface generated for tests. Implement this /// interface and invoke `[name of this handler].setup` to receive @@ -111,6 +114,7 @@ class HostApi { /// testing. /// /// Defaults to `null` in which case no handler will be generated. + @Deprecated('Mock/fake the generated Dart API instead.') final String? dartHostTestHandler; } @@ -238,7 +242,7 @@ class PigeonOptions { const PigeonOptions({ this.input, this.dartOut, - this.dartTestOut, + @Deprecated('Mock/fake the generated Dart API instead.') this.dartTestOut, this.objcHeaderOut, this.objcSourceOut, this.objcOptions, @@ -269,6 +273,7 @@ class PigeonOptions { final String? dartOut; /// Path to the Dart file that will be generated for test support classes. + @Deprecated('Mock/fake the generated Dart API instead.') final String? dartTestOut; /// Path to the ".h" Objective-C file will be generated. diff --git a/packages/pigeon/pubspec.yaml b/packages/pigeon/pubspec.yaml index e7e2860629e..d9114129958 100644 --- a/packages/pigeon/pubspec.yaml +++ b/packages/pigeon/pubspec.yaml @@ -2,7 +2,7 @@ name: pigeon description: Code generator tool to make communication between Flutter and the host platform type-safe and easier. repository: https://github.com/flutter/packages/tree/main/packages/pigeon issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+pigeon%22 -version: 26.0.5 # This must match the version in lib/src/generator_tools.dart +version: 26.1.0 # This must match the version in lib/src/generator_tools.dart environment: sdk: ^3.7.0 From 7918568a43af47389773ee5a23fbe5d2031c0e7f Mon Sep 17 00:00:00 2001 From: stuartmorgan-g Date: Tue, 11 Nov 2025 15:42:40 -0500 Subject: [PATCH 2/2] Add dartTestOut to changelog Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- packages/pigeon/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/pigeon/CHANGELOG.md b/packages/pigeon/CHANGELOG.md index 4dfdf4167df..6f22c5df072 100644 --- a/packages/pigeon/CHANGELOG.md +++ b/packages/pigeon/CHANGELOG.md @@ -1,6 +1,6 @@ ## 26.1.0 -* Deprecates `dartHostTestHandler`. +* Deprecates `dartHostTestHandler` and `dartTestOut`. * If you have a use case where this cannot easily be replaced with a mock or fake of the generated Dart API, please provide details in https://github.com/flutter/flutter/issues/178322.