Skip to content

[pigeon] add flutter api protocol - #5181

Merged
auto-submit[bot] merged 6 commits into
flutter:mainfrom
tarrinneal:pigeon-swift-flutter-api-protocol
Oct 19, 2023
Merged

[pigeon] add flutter api protocol#5181
auto-submit[bot] merged 6 commits into
flutter:mainfrom
tarrinneal:pigeon-swift-flutter-api-protocol

Conversation

@tarrinneal

@tarrinnealtarrinneal commented Oct 19, 2023

Copy link
Copy Markdown
Contributor

Protocols to make testing with mocks easier.

Fixesflutter/flutter#136811

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the relevant style guides and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/packages repo does use dart format.)
  • I signed the CLA.
  • The title of the PR starts with the name of the package surrounded by square brackets, e.g. [shared_preferences]
  • I listed at least one issue that this PR fixes in the description above.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.
  • I updated CHANGELOG.md to add a description of the change, following repository CHANGELOG style.
  • 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.
  • All existing and new tests are passing.

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

@tarrinnealtarrinneal changed the title first draft[pigeon] add flutter api protocolOct 19, 2023
@tarrinneal
tarrinneal marked this pull request as ready for review October 19, 2023 10:16
@tarrinneal

tarrinneal commented Oct 19, 2023

Copy link
Copy Markdown
ContributorAuthor

I feel the current tests provide coverage for this change, I'm hoping to avoid adding more unit tests. I can add more if you think it's necessary @stuartmorgan. (We are also getting usage on this through #5159)

Nevermind. There may be a better way to handle the unit. I don't love it as is.

@stuartmorgan-gstuartmorgan-g left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM with nits!

I was just thinking this would have a Dart unit test of generator output that protocol Foo existed and the class conformed to Foo, but this real-world usage test is definitely better.

Comment threadpackages/pigeon/example/app/ios/Runner/Messages.g.swift Outdated
Comment threadpackages/pigeon/lib/swift_generator.dart Outdated
Comment threadpackages/pigeon/lib/swift_generator.dart Outdated
@tarrinnealtarrinneal added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 19, 2023
@auto-submit
auto-submitBot merged commit 24654d3 into flutter:mainOct 19, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 20, 2023
auto-submitBot pushed a commit to flutter/flutter that referenced this pull request Oct 20, 2023
flutter/packages@09c6b11...be915be
2023-10-20 737941+loic-sharma@users.noreply.github.com [ci] Finalize migration to x64 specific Windows platform (flutter/packages#5174)
2023-10-19 15619084+vashworth@users.noreply.github.com [image_picker_ios] Update UITests for Xcode 15/iOS 17 (flutter/packages#5176)
2023-10-19 stuartmorgan@google.com [ci] Add emulator tests on older Android version (flutter/packages#4616)
2023-10-19 engine-flutter-autoroll@skia.org Roll Flutter from 189196d to c2bd2c1 (11 revisions) (flutter/packages#5183)
2023-10-19 stuartmorgan@google.com [tool] Fix `filter-packages-to` when everything is changed (flutter/packages#5182)
2023-10-19 tarrinneal@gmail.com [pigeon] add flutter api protocol (flutter/packages#5181)
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 flutter-ecosystem@google.com,rmistry@google.com 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
@hellohuanlin

Copy link
Copy Markdown
Contributor

Nice change!

@reidbakerreidbaker mentioned this pull request Jan 12, 2024
creatorpiyush pushed a commit to creatorpiyush/packages that referenced this pull request Jun 10, 2026
Protocols to make testing with mocks easier.
Fixesflutter/flutter#136811
bisor0627 pushed a commit to bisor0627/packages that referenced this pull request Jun 19, 2026
Protocols to make testing with mocks easier.
Fixesflutter/flutter#136811
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmitMerge PR when tree becomes green via auto submit Appp: pigeonplatform-androidplatform-iosplatform-macosplatform-windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[pigeon] Add a protocol for Flutter APIs in the Swift generator

3 participants

@tarrinneal@hellohuanlin@stuartmorgan-g