-
Notifications
You must be signed in to change notification settings - Fork 26.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecate iOS Objective-C create template flutter create --ios-language objc
#148586
Comments
flutter create -i obj-c
flutter create --ios-language obj-c
flutter create --ios-language obj-c
flutter create --ios-language objc
Just app template, or is this actually all |
For the same 3 month period, for |
@stuartmorgan based on that number, would you like me to keep the |
Interesting. I'm not surprised that it's higher since most people probably don't plan to interact with the native app code, whereas a plugin developer by definition is going to write native code, but I am surprised that it's that high. It would be nice to reduce our plugin template complexity, but that feels high to cut off (although of course someone sufficiently knowledgeable could still make a new plugin in Obj-C without a template). What do you think about keeping it for plugins but having it print a box at the end saying we are considering removing support for creating Obj-C plugins in the future, with a pointer to a tracking issue we file, and asking them to comment about what their use case is for using Obj-C instead of Swift? Alternately if it's reasonably easy to make a mixed-mode plugin (I forget the current state; is it easy now that everything is modules? /cc @hellohuanlin who has probably played with that the most recently), we could remove the template, and just update the plugin docs to explain how to add some Obj-C source to a plugin. |
That sounds good to me. Are you okay with |
Yes, I definitely don't want to keep the app template complexity around just for plugin examples; your point is an excellent one, and I would also bet that the vast majority of plugin examples don't have changes in the native code. |
The |
Not sure if this is a blocker, but FYI the add-to-app iOS module template only supports Objective-C: #23955 |
Oh very good point, I forgot about that. We could probably relatively easily swap that to a Swift template? It just was never prioritized. |
@stuartmorgan how do you think this should work in the IntelliJ workflow (it doesn't look supported for VS Code)? flutter/flutter-intellij#7439 Maybe we remove the radio button, and it's only supported from the command line for plugins? Or we keep the radio, but it's only enabled when the Project Type is "Plugin"? |
It is actually used, but we only pass it if it's not I can update the VS Code extension easily, but we should try not to make changes that break older versions of the plugins (at least for a little while). Could we just ignore the flag when it's not supported and output a message (so the user would see some output telling them why the language wasn't what they'd configured)? (and I can update the text on the setting to indicate which Flutter versions/project types it works for). (note: for VS Code, this is a setting that you set once and applies to all executions of the Flutter: New Project command, it's not chosen each time, so we can't enable/disable it based on the project type as suggested for IntelliJ above). |
I think this is the most straightforward option. Making a new plugin isn't a frequent activity, so it's fine if people doing it have to hunt a bit to figure out how to use a deprecated path. |
In that case, does it seem reasonable for VS Code to:
That will retain current behaviour for existing (and earlier) SDKs and make it easier to remove the flag in some distant future (because we'll know that all VS Code extensions since [approximately now] will not try to send it)? |
Couldn't we just remove the setting instead? It doesn't seem like a big deal if people using new version of the VS Code lose UI access to this flag earlier than we drop it in the command line. |
We could, but I try to avoid removing/breaking functionality if not necessary.. it's more understandable for this functionality to stop working in a future SDK release than be taken away by the VS Code extension if you're still using the same SDK. The VS Code extension already handles a lot of differences in SDK Versions so an extra condition like this is very minor (and easy to remove in future at the point we deem the older SDKs are not going to be supported by the extension). |
We have metrics that show in 2024 Q1 less than 1% of
flutter create
apps were Objective-C. Deprecate and remove the flag and templates.--ios-language
flag and templates from the tool.Users will still be able to open
ios/Runner.xcworkspace
and add Objective-C code or replace the Swift code that's there with Objective-C.macOS never had a
flutter create -i objc
option and only provided a Swift template #70598 (comment)The text was updated successfully, but these errors were encountered: