Skip to content

[various] Update Swift plugins for non-nullable generics - #7742

Merged
auto-submit[bot] merged 7 commits into
flutter:mainfrom
stuartmorgan-g:pigeon-non-null-update-swift
Oct 4, 2024
Merged

auto-submit[bot] merged 7 commits into
flutter:mainfrom
stuartmorgan-g:pigeon-non-null-update-swift

Conversation

@stuartmorgan-g

Copy link
Copy Markdown
Collaborator

Updates Swift-based plugins to the current version of Pigeon:

  • Removes workarounds for previous lack of support for non-nullable generics.
  • Minor tweaks for other Pigeon changes in intervening versions.

These are done as a batch since the Swift plugins are unusual among our plugins in having strong typing changes on the native side, making them easier to do mechanically.

Part of flutter/flutter#155891

Pre-launch Checklist

@stuartmorgan-g stuartmorgan-g Sep 30, 2024 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Since this change is non-obvious: Pigeon used to basically discard the constructor, so none of this mattered. With the update:

  • some code failed analysis because it was passing default values, and I decided I preferred having the call site across the Pigeon boundary be very explicit about the settings in each method, and
  • the const SavePanelOptions() didn't compile because const-ness isn't preserved into the Pigeon-generated Dart code.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is const-ness something we'd like?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Could be worth considering, since having data classes be unmodifiable is often useful. It would add some complexity to native generators though since we'd need to make setters conditionally generated.

@stuartmorgan-g

Copy link
Copy Markdown
Collaborator Author

I can split this into three PRs if folks prefer, I just figured since we get more compiler support for the change with Swift, there aren't too many, and they are relatively small, I'd try batching them.

@stuartmorgan-g
stuartmorgan-g force-pushed the pigeon-non-null-update-swift branch from 2ccc25f to 2e01a36 Compare September 30, 2024 18:47
@stuartmorgan-g
stuartmorgan-g removed the request for review from cbracken September 30, 2024 18:47

@tarrinneal tarrinneal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good! Did you run into any issues?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is const-ness something we'd like?

@stuartmorgan-g

Copy link
Copy Markdown
Collaborator Author

Did you run into any issues?

I'll let you know once I see whether any regression issues are filed 😅

But it was easy to update. With strongly typed generic enforcement on both sides, the compilers did most of the work for me.

@stuartmorgan-g stuartmorgan-g added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 4, 2024
@auto-submit
auto-submit Bot merged commit 05bf1d4 into flutter:main Oct 4, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 4, 2024
auto-submit Bot pushed a commit to flutter/flutter that referenced this pull request Oct 4, 2024
flutter/packages@429650f...05bf1d4

2024-10-04 [email protected] [various] Update Swift plugins for non-nullable generics (flutter/packages#7742)
2024-10-04 [email protected] [url_launcher] Update Android Pigeon (flutter/packages#7744)
2024-10-04 [email protected] [xdg_directories] Add `stateHome` property (flutter/packages#7766)
2024-10-03 [email protected] [file_selector] Update Android Pigeon for non-nullable generics (flutter/packages#7781)
2024-10-03 [email protected] [go_router] Relax subroute path requirements (allow root and child routes to have the same path forms ) (flutter/packages#7647)

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-flutter-autoroll
Please CC [email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: 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
creatorpiyush pushed a commit to creatorpiyush/packages that referenced this pull request Jun 10, 2026
Updates Swift-based plugins to the current version of Pigeon:
- Removes workarounds for previous lack of support for non-nullable generics.
- Minor tweaks for other Pigeon changes in intervening versions.

These are done as a batch since the Swift plugins are unusual among our plugins in having strong typing changes on the native side, making them easier to do mechanically.

Part of flutter/flutter#155891
bisor0627 pushed a commit to bisor0627/packages that referenced this pull request Jun 19, 2026
Updates Swift-based plugins to the current version of Pigeon:
- Removes workarounds for previous lack of support for non-nullable generics.
- Minor tweaks for other Pigeon changes in intervening versions.

These are done as a batch since the Swift plugins are unusual among our plugins in having strong typing changes on the native side, making them easier to do mechanically.

Part of flutter/flutter#155891
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants