-
Notifications
You must be signed in to change notification settings - Fork 2.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
[Pigeon] Condenses serialization formats #2745
Conversation
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 gave this a quick look and it's all in the right place. One thing to make sure is that there is an explicit defined order of the fields when they are written. Writing them in the order they show up in the pigeon file is good. I'd just make sure that's the case.
packages/pigeon/platform_tests/ios_swift_unit_tests/ios/RunnerTests/AsyncHandlersTest.swift
Outdated
Show resolved
Hide resolved
- Fix API call typo. - Fix double nesting of arrays for class serialization. - Replace incorrect emplace calls with push_back. - Start to update unit tests.
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.
C++ and Obj-C reviews done; again just small things. Swift and Kotlin tomorrow :)
@@ -588,7 +588,7 @@ const flutter::StandardMessageCodec& ${api.name}::GetCodec() { | |||
indent.write('if ($encodableArgName.IsNull()) '); | |||
indent.scoped('{', '}', () { | |||
indent.writeln( | |||
'wrapped.emplace(flutter::EncodableValue("${Keys.error}"), WrapError("$argName unexpectedly null."));'); | |||
'wrapped = WrapError("$argName unexpectedly null.");'); |
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.
Note for future PR work: this is something we should remove, and replace with a debug-only assert, since per previous offline discussion we don't want non-debug runtime checks that the wire format is correct. Could you see if we have a bug about removing runtime type/nullability checks in our deserialization across any generators that have them, and file it if not?
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.
Issue filed, feel free to add more detail if you think my description is lacking. flutter/flutter#116972
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.
All languages complete! Other than the Kotlin wrapError thing it's all very minor.
I'm going to LGTM with these comments since I don't think anything here should need re-review, but if there's anything you change that you want me to look at let me know.
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.
Wowee, there is a lot more to review now. 2 big things, the rest you can ignore:
- I think you have a bug in the c++ generator
- I think we should avoid building wrapped values by using
.add
methods, instead indexing exactly where the values should go.
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! Thanks for tackling this, a brave new world for pigeon.
auto label is removed for flutter/packages, pr: 2745, due to - The status or check suite ios-build_all_packages CHANNEL:master has failed. Please fix the issues identified (or deflake) before re-applying this label. |
Condenses the serialization platform of generated api's by converting objects to lists
List which issues are fixed by this PR. You must list at least one issue.
fixes flutter/flutter#111503
fixes flutter/flutter#111722
If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.
tbc
Pre-launch Checklist
dart format
.)[shared_preferences]
pubspec.yaml
with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.md
to add a description of the change, following repository CHANGELOG style.///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.