[flutter_tools] Deprecate plugin_ffi template#181588
Conversation
There was a problem hiding this comment.
Code Review
This pull request deprecates the plugin_ffi template in favor of package_ffi. The changes include adding a warning message when the deprecated template is used, updating the help text to reflect the deprecation, and adding corresponding tests to verify these changes. The implementation is straightforward and correct. I've added a couple of suggestions to improve the precision of the new test assertions.
| expect(templateHelp, contains('(deprecated)')); | ||
| expect(templateHelp, contains('Use "package_ffi" instead.')); |
There was a problem hiding this comment.
To make the test more precise and ensure the entire help message is correct, consider asserting against the full expected string instead of just parts of it. This prevents unintended changes to the middle of the string from going unnoticed.
expect(
templateHelp,
'(deprecated) Generate a shareable Flutter project containing an API '
'in Dart code with a platform-specific implementation through dart:ffi for Android, iOS, '
'Linux, macOS, Windows, or any combination of these. '
'Use "package_ffi" instead.',
);| expect(logger.warningText, contains('The "plugin_ffi" template is deprecated')); | ||
| expect(logger.warningText, contains('Use the "package_ffi" template instead.')); | ||
| expect( | ||
| logger.warningText, | ||
| contains('https://docs.flutter.dev/platform-integration/bind-native-code'), | ||
| ); |
There was a problem hiding this comment.
For better test precision and to ensure the entire deprecation message is accurate, it's preferable to check for the complete warning message in a single expect statement rather than checking for substrings in multiple statements. This makes the test more robust against unintended partial changes to the message.
expect(
logger.warningText,
contains(
'The "plugin_ffi" template is deprecated and will be removed in a future '
'version of Flutter. Use the "package_ffi" template instead. '
'For more information, see: '
'https://docs.flutter.dev/platform-integration/bind-native-code',
),
);| 'The "plugin_ffi" template is deprecated and will be removed in a future ' | ||
| 'version of Flutter. Use the "package_ffi" template instead. ' | ||
| 'For more information, see: ' | ||
| 'https://docs.flutter.dev/platform-integration/bind-native-code', |
There was a problem hiding this comment.
This says that plugin_ffi is still useful in some cases. I believe, our plan was to update that (and redirect people elsewhere) before deprecating this? See #131209 (comment).
There was a problem hiding this comment.
There was a problem hiding this comment.
Ah, yes. Thanks! Can you leave a breadcrumb to that in the PR description and make sure that gets submitted before this one?
goderbauer
left a comment
There was a problem hiding this comment.
LGTM after flutter/website#13004 is submitted.
The new way of bundling native code is `flutter create --template=package_ffi`. (Or if the Flutter Plugin API or Android Play components need to be bundled: `flutter create --template=plugin`.) Issue: * flutter/flutter#131209 Related PRs: * flutter/flutter#181588 (We should submit this PR before that one.)
Roll Flutter from da72d5936d69 to 1d9d6a9a5ef6 (33 revisions) flutter/flutter@da72d59...1d9d6a9 2026-01-30 [email protected] enable enhanced debugging for GLES playground (flutter/flutter#181157) 2026-01-30 [email protected] Make the Windows windowing_test in .ci.yaml have bringup as false (flutter/flutter#181664) 2026-01-30 [email protected] Roll Packages from cd4fd61 to 510dd40 (4 revisions) (flutter/flutter#181726) 2026-01-30 [email protected] Roll Skia from edbf7e9eb846 to 4745eb2fe837 (1 revision) (flutter/flutter#181725) 2026-01-30 [email protected] Enhance error handling of WidgetsBindingObserver callbacks (flutter/flutter#181174) 2026-01-30 [email protected] Roll Skia from 05d3cb9d2be9 to edbf7e9eb846 (2 revisions) (flutter/flutter#181715) 2026-01-30 [email protected] Roll Skia from c198e5fa9cd9 to 05d3cb9d2be9 (1 revision) (flutter/flutter#181712) 2026-01-30 [email protected] Roll Dart SDK from 920b7e24583e to 2703fd9733ce (2 revisions) (flutter/flutter#181693) 2026-01-30 [email protected] Roll Skia from b9f40c193e7a to c198e5fa9cd9 (6 revisions) (flutter/flutter#181692) 2026-01-30 [email protected] Roll pub packages (flutter/flutter#181690) 2026-01-30 [email protected] Extend the Windows tool_integration_tests_2_9 shard timeout to 1 hour (flutter/flutter#181678) 2026-01-29 [email protected] Add `android_sdk` dependency to `android_engine_opengles_tests` (flutter/flutter#181681) 2026-01-29 [email protected] Roll Dart SDK from a0685c8e946b to 920b7e24583e (3 revisions) (flutter/flutter#181680) 2026-01-29 [email protected] Roll Skia from 128b5213711e to b9f40c193e7a (14 revisions) (flutter/flutter#181675) 2026-01-29 [email protected] [Impeller] Ensure that HostBuffers/DeviceBuffers allocated by RendererTest tests are valid for the lifetime of the RenderPass (flutter/flutter#181635) 2026-01-29 [email protected] [Impeller] Fix off-by-one indices in the SimilarPointPair/SimilarPointTrio functions used by ShadowPathGeometryTest (flutter/flutter#181623) 2026-01-29 [email protected] 180162 fix radio list tile and switch list tile accept widget states controller (flutter/flutter#180367) 2026-01-29 [email protected] Remove unused test file (flutter/flutter#181671) 2026-01-29 [email protected] Roll libpng to version 1.6.54 (flutter/flutter#181625) 2026-01-29 [email protected] Remove nonstandard ndkpath for `hybrid_android_views` integration test (flutter/flutter#181666) 2026-01-29 [email protected] Add TestWidgetsApp utility and refactor widget tests to use WidgetsApp (flutter/flutter#180456) 2026-01-29 [email protected] Add `TestTextField` and migrate tests (flutter/flutter#180494) 2026-01-29 [email protected] Merge changelog for 3.38.9 (flutter/flutter#181668) 2026-01-29 [email protected] [flutter_tools] Deprecate `plugin_ffi` template (flutter/flutter#181588) 2026-01-29 [email protected] Deprecate onReorder callback (flutter/flutter#178242) 2026-01-29 [email protected] [web] Use defensive null check in text editing placeElement (flutter/flutter#180795) 2026-01-29 [email protected] Roll Packages from 1cb2148 to cd4fd61 (4 revisions) (flutter/flutter#181663) 2026-01-29 [email protected] Roll Skia from 89df65f8324c to 128b5213711e (2 revisions) (flutter/flutter#181651) 2026-01-29 [email protected] [hooks] Don't run build hooks for code assets in `flutter run` (flutter/flutter#181542) 2026-01-29 [email protected] Roll Dart SDK from f10dcbfca98f to a0685c8e946b (5 revisions) (flutter/flutter#181653) 2026-01-29 [email protected] Fixes getUniformX for Vulkan (flutter/flutter#181286) 2026-01-29 [email protected] Roll Fuchsia Linux SDK from adhoq9ouVRh0xzkm3... to isy1ARvK-3bsvtfc-... (flutter/flutter#181641) 2026-01-29 [email protected] Add isDark, isLight, and isSystem getters to ThemeMode (flutter/flutter#181475) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: ...
Add deprecation marker to `flutter create --template=plugin_ffi`. The new way of bundling native code is `flutter create --template=package_ffi`. (Or if the Flutter Plugin API or Android Play components need to be bundled: `flutter create --template=plugin)` Issue: * flutter#131209
Add deprecation marker to `flutter create --template=plugin_ffi`. The new way of bundling native code is `flutter create --template=package_ffi`. (Or if the Flutter Plugin API or Android Play components need to be bundled: `flutter create --template=plugin)` Issue: * flutter#131209
Add deprecation marker to `flutter create --template=plugin_ffi`. The new way of bundling native code is `flutter create --template=package_ffi`. (Or if the Flutter Plugin API or Android Play components need to be bundled: `flutter create --template=plugin)` Issue: * flutter#131209
Add deprecation marker to
flutter create --template=plugin_ffi.The new way of bundling native code is
flutter create --template=package_ffi. (Or if the Flutter Plugin API or Android Play components need to be bundled:flutter create --template=plugin)Issue: