Repository navigation
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: contributor-productivityTeam-specific productivity, code health, technical debt.Team-specific productivity, code health, technical debt.packageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.team-ecosystemOwned by Ecosystem teamOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem teamTriaged by Ecosystem team
Description
Pigeon improves the ease and safety of plugin development, and we've been having good experiences switching our plugins over to it as Pigeon has continued to mature and stabilize:
- It eliminates bad-cast errors, where we make a mistake in the manual synchronization of expected types across the language boundary, including (in some languages) nullability mistakes in most cases.
- It avoids the need to try to validate that contract in review, switching between the Dart and host code trying to see if all of the pieces line up as expected; instead the API definition can be easily reviewed, and then the implementations using that API can be reviewed in isolation, which is far easier.
- It avoids the need to manage a bunch of string constants across languages.
- It avoids a lot of tedious boilerplate for dictionary extraction to get individual arguments (and in ObjC, much of the need for annoying special-case handling of
NSNull).
While it still has some limitations that we may want to address before adopting it in specific cases (e.g., we may want to implement an instance-tracking system before applying it to things like camera or maps, rather than having to build multiplexing in the API itself), in general we should plan to migrate all of our plugins to Pigeon.
This serves as a central tracking point, and explanation for the motivation for these migrations for future repo archeology. Plugin migrations are tracked in individual issues:
Reacted by Francesco Iapicca, Hillel Coren and Pablo Jiménez Pascual
Reacted by Rulong Chen(陈汝龙) and Ailton Vieira Pinto Filho
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: contributor-productivityTeam-specific productivity, code health, technical debt.Team-specific productivity, code health, technical debt.packageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.team-ecosystemOwned by Ecosystem teamOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem teamTriaged by Ecosystem team
Activity
stuartmorgan-g commentedon Jan 3, 2023
As a general note for conversions: except for cases where we are doing a full rewrite of the plugin for other reasons, or very small interfaces, it's best to convert things to Pigeon using something identical or very close to the existing method call structure (just converted to actual objects/params instead of arg maps), to minimize other changes (e.g., to unit test structure) in the PR. Once the Pigeon conversion has happened, follow-ups can adjust the boundary between native and Dart, or adjust to better match underlying platform APIs.
[quick_actions] Convert android to pigeon (#5099)
[quick_actions] convert to pigeon (#5159)
stuartmorgan-g commentedon Nov 4, 2024
Closing, as there's no need for a high-level tracking issue any more. The only case of direct method channel use that's left in any of our plugins in part of IAP, which has an issue for it, and then there's some remaining use of method-channel-remnant JSON inside of Pigeon calls in Maps, which is also being tracked.
github-actions commentedon Nov 18, 2024
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.