Skip to content
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

[pigeon] Updates README.md with examples of using @ProxyApi #8087

Draft
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

bparrishMines
Copy link
Contributor

@bparrishMines bparrishMines commented Nov 14, 2024

Pre-launch Checklist

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

@@ -284,7 +284,7 @@ private class PigeonFlutterApi {
aString aStringArg: String?, completion: @escaping (Result<String, Error>) -> Void
) {
flutterAPI.flutterMethod(aString: aStringArg) {
completion(.success($0))
completion(.success(try! $0.get()))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Code didn't compile until I fixed this. I'm assuming our CI doesn't verify the example compiles. Is this unintentional?

I also had to fix the same line for Kotlin.

Copy link
Contributor

Choose a reason for hiding this comment

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

Just ran into this in my pr as well. Not sure why the examples are getting compiled in ci though

Copy link
Contributor

Choose a reason for hiding this comment

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

https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8731158450509496993/+/u/Run_package_tests/build_examples/stdout

============================================================
|| Running for packages/pigeon [@0:00]
============================================================

Building for: Android

Skipping Android for pigeon/example; not supported.
SKIPPING: No examples found supporting requested platform(s).

O.o

Let me look into what's going on here.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, it's because the actual example is example/app/, not example/, but example.pubspec.yaml exists so the tooling sees that example is a package.

I'll play with fixing this in a separate PR. I think the pubspec may have only been there for the old excerpt system.

@@ -118,7 +118,7 @@ Future<int> generateTestPigeons(
? null
: '$outputBase/ios/Classes/$pascalCaseName.gen.swift',
swiftErrorClassName: swiftErrorClassName,
swiftIncludeErrorClass: input != 'core_tests',
swiftIncludeErrorClass: input != 'background_platform_channels',
Copy link
Contributor Author

@bparrishMines bparrishMines Nov 16, 2024

Choose a reason for hiding this comment

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

Fixes a test failure caused by #7849

tldr:
This wasn't caught by CI because core_tests is checked in and the order of the tests matters.

When I reran the generator and pushed my code, it removed the PigeonError from core_tests. Therefore the tests that run before the CI generates the unchecked in files would fail because core_tests was missing the reference to PigeonError that was in background_platform_channels. Therefore the fix was to switch the location of the single PigeonError to reside in core_tests instead of background_platform_channels.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is also addressed in my current pr. Your solution is smarter than mine :)

@bparrishMines bparrishMines changed the title Pigeon readme proxy [pigeon] Updates README.md with examples of using @ProxyApi Nov 16, 2024
@bparrishMines bparrishMines marked this pull request as ready for review November 16, 2024 00:40
@stuartmorgan
Copy link
Contributor

We should hold off on this until I've had a chance to discuss with folks about overall interop plans.

@bparrishMines bparrishMines marked this pull request as draft November 19, 2024 04:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants