Skip to content

Commit d07dabc

Browse files
[pigeon] Deprecate dartHostTestHandler (#10403)
Deprecates `dartHostTestHandler`, in preparation for removing sometime in 2026 if no significant new information comes to light. Part of flutter/flutter#178322 ## Pre-Review Checklist [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
1 parent 0aa4d9d commit d07dabc

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

packages/pigeon/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## 26.1.0
2+
3+
* Deprecates `dartHostTestHandler` and `dartTestOut`.
4+
* If you have a use case where this cannot easily be replaced with a mock or
5+
fake of the generated Dart API, please provide details in
6+
https://github.com/flutter/flutter/issues/178322.
7+
18
## 26.0.5
29

310
* [kotlin] Serialize custom enums as `Long` instead of `Int` to avoid `ClassCastException` on decoding.

packages/pigeon/lib/src/generator_tools.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import 'generator.dart';
1515
/// The current version of pigeon.
1616
///
1717
/// This must match the version in pubspec.yaml.
18-
const String pigeonVersion = '26.0.5';
18+
const String pigeonVersion = '26.1.0';
1919

2020
/// Read all the content from [stdin] to a String.
2121
String readStdin() {

packages/pigeon/lib/src/pigeon_lib.dart

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,10 @@ class ConfigurePigeon {
9696
/// generated host-platform interface.
9797
class HostApi {
9898
/// Parametric constructor for [HostApi].
99-
const HostApi({this.dartHostTestHandler});
99+
const HostApi({
100+
@Deprecated('Mock/fake the generated Dart API instead.')
101+
this.dartHostTestHandler,
102+
});
100103

101104
/// The name of an interface generated for tests. Implement this
102105
/// interface and invoke `[name of this handler].setup` to receive
@@ -111,6 +114,7 @@ class HostApi {
111114
/// testing.
112115
///
113116
/// Defaults to `null` in which case no handler will be generated.
117+
@Deprecated('Mock/fake the generated Dart API instead.')
114118
final String? dartHostTestHandler;
115119
}
116120

@@ -238,7 +242,7 @@ class PigeonOptions {
238242
const PigeonOptions({
239243
this.input,
240244
this.dartOut,
241-
this.dartTestOut,
245+
@Deprecated('Mock/fake the generated Dart API instead.') this.dartTestOut,
242246
this.objcHeaderOut,
243247
this.objcSourceOut,
244248
this.objcOptions,
@@ -269,6 +273,7 @@ class PigeonOptions {
269273
final String? dartOut;
270274

271275
/// Path to the Dart file that will be generated for test support classes.
276+
@Deprecated('Mock/fake the generated Dart API instead.')
272277
final String? dartTestOut;
273278

274279
/// Path to the ".h" Objective-C file will be generated.

packages/pigeon/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: pigeon
22
description: Code generator tool to make communication between Flutter and the host platform type-safe and easier.
33
repository: https://github.com/flutter/packages/tree/main/packages/pigeon
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+pigeon%22
5-
version: 26.0.5 # This must match the version in lib/src/generator_tools.dart
5+
version: 26.1.0 # This must match the version in lib/src/generator_tools.dart
66

77
environment:
88
sdk: ^3.7.0

0 commit comments

Comments
 (0)