这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@okorohelijah
Copy link
Contributor

@okorohelijah okorohelijah commented Aug 19, 2025

This PR marks the --ios-language objc flag as deprecated for plugin creation. It introduces a warning message in the flutter create tool when the flag is used, but does not remove the functionality at this time. This is the first step towards its eventual removal.

Context

As discussed in the issue, usage metrics show that Objective-C is used in less than 4% of newly created plugins. To streamline the tool and align with modern iOS development practices (i.e., Swift), we are beginning the process of phasing out this option

Changes:

  • Adds a deprecation warning to the CLI when the objc flag is used.
  • Updates the --help text to reflect the deprecation.
  • Removes obsolete tests for Objective-C plugin creation and usage tracking.

Testing

I have validated these changes by:

  1. Manually running flutter-dev create with the objc flag to confirm the new deprecation warning appears.
  2. Verifying that creating a plugin without the --ios-language flag does not trigger the warning.
  3. Running the tests in the test/commands.shard to ensure no regressions were introduced.
  4. CI will validate the changes to the devicelab tests.

Fixes #169683

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

@github-actions github-actions bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Aug 19, 2025
@okorohelijah okorohelijah requested a review from jmagman August 19, 2025 00:08
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request effectively marks the Objective-C plugin template as deprecated by updating help texts and adding warnings. The changes are well-aligned with the goal of phasing out this option. I've identified one area for improvement in the tests to ensure that the deprecated path remains covered until it's fully removed.

@okorohelijah okorohelijah added the team-ios Owned by iOS platform team label Aug 19, 2025
@github-actions github-actions bot removed the team-ios Owned by iOS platform team label Aug 19, 2025
@okorohelijah okorohelijah added team-ios Owned by iOS platform team platform-ios iOS applications specifically labels Aug 21, 2025
@github-actions github-actions bot removed platform-ios iOS applications specifically team-ios Owned by iOS platform team labels Aug 22, 2025
Copy link
Member

@jmagman jmagman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is missing the actual change to disallow (exit with failure) when the flag is used:

} else if (argResults!.wasParsed('ios-language')) {
if (generateMethodChannelsPlugin) {
globals.printWarning(
'The "ios-language" option is deprecated and will be removed in a future Flutter release.',
);
if (stringArg('ios-language') == 'objc') {
globals.printWarning(
'Please comment in https://github.com/flutter/flutter/issues/169683 describing your use-case for using Objective-C instead of Swift.',
);
}
} else {
throwToolExit(
'The "ios-language" option is only supported for "--template=plugin".',
exitCode: 2,
);
}

    } else if (argResults!.wasParsed('ios-language')) {
        throwToolExit(
          'The "ios-language" option is deprecated. Swift is the only available option for new Flutter projects.',
          exitCode: 2,
        );
      }

@github-actions github-actions bot added d: examples Sample code and demos a: desktop Running on desktop labels Aug 27, 2025
Copy link
Member

@jmagman jmagman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also remove commandCreateIosLanguage from custom_dimensions and anywhere else it's used. The test was removed, but not the logic in the code.

etc.

See #163153 for an example of another case of that being removed.

In other places in this review I suggested removing comments like defaults to Swift since ios-language is deprecated since that information won't be relevant to future viewers of this code. You'll notice in custom_dimensions there are some hints like that though, example:

obsolete1, // cd48 (was fastReassemble)

That's because it's explaining why cd48 is missing from a list of sequential dimension numbers, so say a future developer doesn't try to plug a new value into cd48

Eventually (in a few releases) we can also remove this from unified_analytics
https://github.com/dart-lang/tools/blob/24707e094cd761178eb76e725ce17f51e22fd442/pkgs/unified_analytics/lib/src/event.dart#L282-L283

@github-actions github-actions bot removed the d: examples Sample code and demos label Aug 28, 2025
Copy link
Member

@jmagman jmagman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really close, one minor test comment!

Copy link
Member

@jmagman jmagman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for tracking all this down, LGTM!

@okorohelijah okorohelijah added this pull request to the merge queue Sep 15, 2025
auto-merge was automatically disabled September 15, 2025 22:39

Pull Request is not mergeable

@matanlurey matanlurey removed their request for review September 15, 2025 22:46
Merged via the queue into flutter:master with commit 1eab8e1 Sep 15, 2025
157 checks passed
@okorohelijah okorohelijah deleted the fix_169683 branch September 15, 2025 22:58
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 16, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 16, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 16, 2025
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Sep 16, 2025
flutter/flutter@29a238d...8d0b31d

2025-09-16 engine-flutter-autoroll@skia.org Roll Packages from fcd5f68 to 0255ac9 (2 revisions) (flutter/flutter#175427)
2025-09-16 47866232+chunhtai@users.noreply.github.com Adds a11y section locale support for iOS (flutter/flutter#175005)
2025-09-16 engine-flutter-autoroll@skia.org Roll Skia from 4e9c86d4a6d9 to 7d160bbf9403 (3 revisions) (flutter/flutter#175404)
2025-09-16 gregorysconrad@gmail.com [native_assets] Find more `CCompilerConfig` on Linux (flutter/flutter#175323)
2025-09-16 engine-flutter-autoroll@skia.org Roll Dart SDK from 50e61e5bff51 to 700de52f29a9 (3 revisions) (flutter/flutter#175395)
2025-09-16 32538273+ValentinVignal@users.noreply.github.com Fix default overlay color in `TabBar` (flutter/flutter#175270)
2025-09-16 32538273+ValentinVignal@users.noreply.github.com Migrate to widget state (flutter/flutter#175242)
2025-09-16 engine-flutter-autoroll@skia.org Roll Skia from 01b0ede33ae9 to 4e9c86d4a6d9 (1 revision) (flutter/flutter#175387)
2025-09-15 chinmaygarde@google.com Merge the engine README into the README of the old buildroot. (flutter/flutter#175384)
2025-09-15 fluttergithubbot@gmail.com Marks Mac_ios microbenchmarks_ios to be unflaky (flutter/flutter#171146)
2025-09-15 okorohelijah@google.com Deprecate Objective-C plugin template (flutter/flutter#174003)
2025-09-15 robert.ancell@canonical.com Add a gn --ccache argument (flutter/flutter#174621)
2025-09-15 mohellebiabdessalem@gmail.com Update `build.gradle` to remove deprecation warning in `flutter\engine\src\flutter\shell\platform\android` (flutter/flutter#175305)
2025-09-15 54338732+Memet18@users.noreply.github.com Show cursor after swipe only if TextField has focus (flutter/flutter#175044)
2025-09-15 engine-flutter-autoroll@skia.org Roll Skia from f950263bb3d4 to 01b0ede33ae9 (7 revisions) (flutter/flutter#175373)
2025-09-15 rmacnak@google.com Update Chromium sysroot to pick up RISC-V support. (flutter/flutter#173671)
2025-09-15 magder@google.com Set Gemini Code Assist `include_drafts` to false (flutter/flutter#175098)
2025-09-15 engine-flutter-autoroll@skia.org Roll Packages from 15e7e89 to fcd5f68 (3 revisions) (flutter/flutter#175366)
2025-09-15 115182119+danwirele@users.noreply.github.com Remove 'v' Open DevTools from help on web in profile/release mode (flutter/flutter#172829)

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 louisehsu@google.com,stuartmorgan@google.com 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:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
dixita0607 pushed a commit to dixita0607/flutter that referenced this pull request Sep 17, 2025
This PR marks the `--ios-language objc` flag as deprecated for plugin
creation. It introduces a warning message in the `flutter create` tool
when the flag is used, but **does not** remove the functionality at this
time. This is the first step towards its eventual removal.

## Context

As discussed in the issue, usage metrics show that Objective-C is used
in less than 4% of newly created plugins. To streamline the tool and
align with modern iOS development practices (i.e., Swift), we are
beginning the process of phasing out this option

**Changes:**
-   Adds a deprecation warning to the CLI when the `objc` flag is used.
-   Updates the `--help` text to reflect the deprecation.
- Removes obsolete tests for Objective-C plugin creation and usage
tracking.

## Testing

I have validated these changes by:

1. Manually running `flutter-dev create` with the `objc` flag to confirm
the new deprecation warning appears.
2. Verifying that creating a plugin without the --ios-language flag does
**not** trigger the warning.
3. Running the tests in the `test/commands.shard` to ensure no
regressions were introduced.
4.  CI will validate the changes to the devicelab tests.

Fixes flutter#169683 

## Pre-launch Checklist

- [X] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [X] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [X] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [X] I signed the [CLA].
- [X] I listed at least one issue that this PR fixes in the description
above.
- [] I updated/added relevant documentation (doc comments with `///`).
- [] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [X] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
mboetger pushed a commit to mboetger/flutter that referenced this pull request Sep 18, 2025
This PR marks the `--ios-language objc` flag as deprecated for plugin
creation. It introduces a warning message in the `flutter create` tool
when the flag is used, but **does not** remove the functionality at this
time. This is the first step towards its eventual removal.

## Context

As discussed in the issue, usage metrics show that Objective-C is used
in less than 4% of newly created plugins. To streamline the tool and
align with modern iOS development practices (i.e., Swift), we are
beginning the process of phasing out this option

**Changes:**
-   Adds a deprecation warning to the CLI when the `objc` flag is used.
-   Updates the `--help` text to reflect the deprecation.
- Removes obsolete tests for Objective-C plugin creation and usage
tracking.

## Testing

I have validated these changes by:

1. Manually running `flutter-dev create` with the `objc` flag to confirm
the new deprecation warning appears.
2. Verifying that creating a plugin without the --ios-language flag does
**not** trigger the warning.
3. Running the tests in the `test/commands.shard` to ensure no
regressions were introduced.
4.  CI will validate the changes to the devicelab tests.

Fixes flutter#169683 

## Pre-launch Checklist

- [X] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [X] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [X] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [X] I signed the [CLA].
- [X] I listed at least one issue that this PR fixes in the description
above.
- [] I updated/added relevant documentation (doc comments with `///`).
- [] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [X] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
Jaineel-Mamtora pushed a commit to Jaineel-Mamtora/flutter_forked that referenced this pull request Sep 24, 2025
This PR marks the `--ios-language objc` flag as deprecated for plugin
creation. It introduces a warning message in the `flutter create` tool
when the flag is used, but **does not** remove the functionality at this
time. This is the first step towards its eventual removal.

## Context

As discussed in the issue, usage metrics show that Objective-C is used
in less than 4% of newly created plugins. To streamline the tool and
align with modern iOS development practices (i.e., Swift), we are
beginning the process of phasing out this option

**Changes:**
-   Adds a deprecation warning to the CLI when the `objc` flag is used.
-   Updates the `--help` text to reflect the deprecation.
- Removes obsolete tests for Objective-C plugin creation and usage
tracking.

## Testing

I have validated these changes by:

1. Manually running `flutter-dev create` with the `objc` flag to confirm
the new deprecation warning appears.
2. Verifying that creating a plugin without the --ios-language flag does
**not** trigger the warning.
3. Running the tests in the `test/commands.shard` to ensure no
regressions were introduced.
4.  CI will validate the changes to the devicelab tests.

Fixes flutter#169683 

## Pre-launch Checklist

- [X] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [X] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [X] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [X] I signed the [CLA].
- [X] I listed at least one issue that this PR fixes in the description
above.
- [] I updated/added relevant documentation (doc comments with `///`).
- [] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [X] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deprecate iOS Objective-C create template flutter create --ios-language objc -t plugin for new plugins

2 participants