-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Added UISceneDelegate breaking change notice. #12082
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
Conversation
Co-authored-by: Victoria Ashworth <15619084+vashworth@users.noreply.github.com>
Co-authored-by: Victoria Ashworth <15619084+vashworth@users.noreply.github.com>
gaaclarke
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the storyboard recommendation as discussed in the chat.
|
Visit the preview URL for this PR (updated for commit e875e96): https://flutter-docs-prod--pr12082-uiscenedelegate-bjp0wxxs.web.app |
|
I'm not quite sure what's breaking about my png. This seems to be following the pattern in |
Looks like images usually go under and then they're referenced like |
sfshaza2
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, it's still in draft and I edited it like it was out of draft. :)
|
|
||
| - Landed in main: TBD | ||
| - Landed in stable: TBD | ||
| - Unknown: Apple changes their warning to an assert and Flutter apps that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Meaning that we don't know when this change will occur? Do we know what the Apple release number will be? Like iOS 20?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it's not communicated when it will happen.
| {% endtab %} | ||
| {% endtabs %} | ||
|
|
||
| Set up the `FlutterPluginRegistrant` programmatically through the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this sentence doing here? It seems out of place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's describing what is happening in the code blocks. Would you like to see it before the code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that would be better, but it's not worth holding this PR up if folks are running into thi problem.
|
@parlough, Aaron added a screenshot to this breaking change. He put it in the assets subdirectory, under the breaking changes directory, which seems fine, and is done with other breaking changes. However, the build is breaking because it can't find the image. Might this be because of that old situation where you must put the image in place in a separate PR before referring to it? I only wonder that because the image isn't in our usual place for assets, but we've certainly done this with other breaking changes. |
|
@gaaclarke, I edited this more dramatically than usual, and that is because of the references to "users", which I find confusing. You mean "users of the API", or "developers". But, in actual reality, its the app's behavior that we care about, so I just removed most (all?) references to "users", rather than change them to "developers" or (better still) "you". |
Co-authored-by: Shams Zakhour (ignore Sfshaza) <44418985+sfshaza2@users.noreply.github.com>
Co-authored-by: Shams Zakhour (ignore Sfshaza) <44418985+sfshaza2@users.noreply.github.com>
Co-authored-by: Shams Zakhour (ignore Sfshaza) <44418985+sfshaza2@users.noreply.github.com>
Co-authored-by: Shams Zakhour (ignore Sfshaza) <44418985+sfshaza2@users.noreply.github.com>
Co-authored-by: Shams Zakhour (ignore Sfshaza) <44418985+sfshaza2@users.noreply.github.com>
Co-authored-by: Shams Zakhour (ignore Sfshaza) <44418985+sfshaza2@users.noreply.github.com>
Co-authored-by: Shams Zakhour (ignore Sfshaza) <44418985+sfshaza2@users.noreply.github.com>
Co-authored-by: Shams Zakhour (ignore Sfshaza) <44418985+sfshaza2@users.noreply.github.com>
Co-authored-by: Shams Zakhour (ignore Sfshaza) <44418985+sfshaza2@users.noreply.github.com>
Co-authored-by: Shams Zakhour (ignore Sfshaza) <44418985+sfshaza2@users.noreply.github.com>
This comment was marked as outdated.
This comment was marked as outdated.
For some future infra changes, I'd prefer if we kept images in the shared I pushed some minor formatting consistency cleanup, but otherwise this looks good to me. Thanks! |
|
@sfshaza2 do we want to land this now that it's on |
|
I'm getting pings on github where users are running into this on |
sfshaza2
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
… usage (#12095) ## _Description of what this PR is changing or adding, and why:_ Updating platform channel guidance to be inline with the breaking change: #12082 ## _Issues fixed by this PR (if any):_ ## _PRs or commits this PR depends on (if any):_ flutter/flutter#169365 #12082 ## Presubmit checklist - [x] This PR is marked as draft with an explanation if not meant to land until a future stable release. - [x] This PR doesn’t contain automatically generated corrections (Grammarly or similar). - [x] This PR follows the [Google Developer Documentation Style Guidelines](https://developers.google.com/style) — for example, it doesn’t use _i.e._ or _e.g._, and it avoids _I_ and _we_ (first person). - [x] This PR uses [semantic line breaks](https://github.com/dart-lang/site-shared/blob/main/doc/writing-for-dart-and-flutter-websites.md#semantic-line-breaks) of 80 characters or fewer.
| func register(with registry: any FlutterPluginRegistry) { | ||
| let registrar = registry.registrar(forPlugin: "battery") | ||
| let batteryChannel = FlutterMethodChannel(name: "samples.flutter.dev/battery", | ||
| binaryMessenger: registrar.messenger) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This Swift code does not compile. registry.registrar(forPlugin: "battery") returns a nullable value, so registrar is a FlutterPluginRegistrar?, and can't have methods called on it without unwrapping. This seems like a serious problem, because it's not clear how a Flutter app developer should if/when it's safe to assume they can actually unwrap it, or what they should do it a null check on it fails and they have critical logic that relies on it existing.
Also, it has to be messenger(), because on iOS messenger isn't declared as a property.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is the example code that accompanied the change: https://github.com/flutter/flutter/blob/master/examples/platform_channel_swift/ios/Runner/AppDelegate.swift
We should update it to match the example, give that a look.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| } | ||
|
|
||
| func register(with registry: any FlutterPluginRegistry) { | ||
| let registrar = registry.registrar(forPlugin: "battery") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we forcing applications to pretend they are plugins? Couldn't the engine make a registrar internally, and the protocol apps implement give them a registrant, rather than a registry?
This is not just awkward, it's also dangerous. If the name the developer picks for this arbitrary-to-them string collides with an actual plugin's registry, Bad Things will happen.
Was there a design doc for this new system?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was there a design doc for this new system?
Yes, this was discussed quite a bit and there is a section for it in the design doc: https://docs.google.com/document/d/1ZfcQOs-UKRa9jsFG84-MTFeibZTLKCvPQLxF2eskx44/edit?tab=t.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not just awkward, it's also dangerous. If the name the developer picks for this arbitrary-to-them string collides with an actual plugin's registry, Bad Things will happen.
Bad things like the registrar returns nil? That's unfortunately inherent to the design of the plugins. We could provide a better example for plugin names, "flutter.dev/battery"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bad things like the registrar returns nil?
Bad things like:
- It will NSAssert in debug mode
- One of the registrars will be stomped in the engine's mapping, causing any future interactions with the registry to have unexpected behavior, with the exact behavior depending on the order of operations in engine logic.
That's unfortunately inherent to the design of the plugins.
Not really. Actual plugins don't rely on individual developers to pick magic strings, we auto-generate them in the tool, where we can centrally control the set of strings and avoid collisions.
We could provide a better example for plugin names, "flutter.dev/battery"?
The fundamental problem is that this isn't a plugin. I think we should address the fact that we are requiring developers to give something that isn't a plugin a "plugin name" in the first place.
Description of what this PR is changing or adding, and why:
Adding breaking change notice for UISceneDelegate adoption.
Issues fixed by this PR (if any):
flutter/flutter#167267
PRs or commits this PR depends on (if any):
flutter/flutter#169365
Presubmit checklist