Skip to content

[Pigeon] Condenses serialization formats#2745

Merged
auto-submit[bot] merged 72 commits into
flutter:mainfrom
tarrinneal:serialization
Dec 18, 2022
Merged

[Pigeon] Condenses serialization formats#2745
auto-submit[bot] merged 72 commits into
flutter:mainfrom
tarrinneal:serialization

Conversation

@tarrinneal

@tarrinneal tarrinneal commented Oct 27, 2022

Copy link
Copy Markdown
Contributor

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

  • 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.

@gaaclarke gaaclarke left a comment

Copy link
Copy Markdown
Member

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.

Comment thread packages/pigeon/lib/dart_generator.dart Outdated
Comment thread packages/pigeon/lib/dart_generator.dart Outdated
@flutter flutter deleted a comment from flutter-dashboard Bot Nov 23, 2022
@tarrinneal
tarrinneal marked this pull request as ready for review November 23, 2022 23:19
tarrinneal and others added 2 commits November 23, 2022 16:36
- Fix API call typo.
- Fix double nesting of arrays for class serialization.
- Replace incorrect emplace calls with push_back.
- Start to update unit tests.

@stuartmorgan-g stuartmorgan-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.

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.

Comment thread packages/pigeon/lib/cpp_generator.dart Outdated
Comment thread packages/pigeon/lib/dart_generator.dart Outdated
Comment thread packages/pigeon/lib/java_generator.dart Outdated
Comment thread packages/pigeon/lib/java_generator.dart Outdated
Comment thread packages/pigeon/lib/java_generator.dart Outdated
Comment thread packages/pigeon/lib/kotlin_generator.dart Outdated
Comment thread packages/pigeon/lib/kotlin_generator.dart Outdated
Comment thread packages/pigeon/lib/kotlin_generator.dart Outdated
Comment thread packages/pigeon/lib/swift_generator.dart Outdated
Comment thread packages/pigeon/lib/swift_generator.dart
Comment thread packages/pigeon/lib/kotlin_generator.dart

@gaaclarke gaaclarke left a comment

Copy link
Copy Markdown
Member

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:

  1. I think you have a bug in the c++ generator
  2. I think we should avoid building wrapped values by using .add methods, instead indexing exactly where the values should go.

Comment thread packages/pigeon/lib/cpp_generator.dart Outdated
Comment thread packages/pigeon/lib/cpp_generator.dart
Comment thread packages/pigeon/lib/dart_generator.dart
Comment thread packages/pigeon/lib/generator_tools.dart
Comment thread packages/pigeon/lib/kotlin_generator.dart Outdated
Comment thread packages/pigeon/lib/java_generator.dart Outdated

@gaaclarke gaaclarke left a comment

Copy link
Copy Markdown
Member

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.

@tarrinneal tarrinneal added the autosubmit Merge PR when tree becomes green via auto submit App label Dec 18, 2022
@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Dec 18, 2022
@auto-submit

auto-submit Bot commented Dec 18, 2022

Copy link
Copy Markdown
Contributor

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.

@tarrinneal tarrinneal added the autosubmit Merge PR when tree becomes green via auto submit App label Dec 18, 2022
@auto-submit
auto-submit Bot merged commit 5662a7e into flutter:main Dec 18, 2022
creatorpiyush pushed a commit to creatorpiyush/packages that referenced this pull request Jun 10, 2026
* Fixs missed indents on generated comments

* begin improved serialization

* formatting errors

* Dart encoder updated to use lists, tests to match

* Begin swift serial, change error shape

* update tests for swift and dart

* true > false

* Return to Object

* correctly nest lists in dart and tests

* Kotlin gen and tests updated to lists

* Java and Tests updated to new serials

* Stuart check this pr (start of objc changes)

* obj c tests for serial

* update unit tests to match new generated outputs

* finish objc tests

* More kt tests

* c++ generator and unit tests

* analyze, format, changelog

* test file updates for ci

* format and analyze again

* a few more test generated files

* Partial Windows fixes

- Fix API call typo.
- Fix double nesting of arrays for class serialization.
- Replace incorrect emplace calls with push_back.
- Start to update unit tests.

* null field tests c++

* format

* fix merge issue with broken test

* remove unneeded wrapping

* generated files

* fix some formatting errors

* format

* more gen files

* gen files

* generator reviews pt1

* test fixes pt1

* fixed nits and nil issues with objc

* better fix for objc null classes

* fix doc comment

* unit test updates

* format

* some c++ fixes

* typo

* format

* Some nits and such

* comment

* remove deleted files

* c++ nits

* objc nits

* all but one c++ bug

* init all fields

* start of documenting data shape

* nits and error handling

* more nits and such

* bug?

* references

* const

* new null for larger alltypes

Co-authored-by: Stuart Morgan <[email protected]>
bisor0627 pushed a commit to bisor0627/packages that referenced this pull request Jun 19, 2026
* Fixs missed indents on generated comments

* begin improved serialization

* formatting errors

* Dart encoder updated to use lists, tests to match

* Begin swift serial, change error shape

* update tests for swift and dart

* true > false

* Return to Object

* correctly nest lists in dart and tests

* Kotlin gen and tests updated to lists

* Java and Tests updated to new serials

* Stuart check this pr (start of objc changes)

* obj c tests for serial

* update unit tests to match new generated outputs

* finish objc tests

* More kt tests

* c++ generator and unit tests

* analyze, format, changelog

* test file updates for ci

* format and analyze again

* a few more test generated files

* Partial Windows fixes

- Fix API call typo.
- Fix double nesting of arrays for class serialization.
- Replace incorrect emplace calls with push_back.
- Start to update unit tests.

* null field tests c++

* format

* fix merge issue with broken test

* remove unneeded wrapping

* generated files

* fix some formatting errors

* format

* more gen files

* gen files

* generator reviews pt1

* test fixes pt1

* fixed nits and nil issues with objc

* better fix for objc null classes

* fix doc comment

* unit test updates

* format

* some c++ fixes

* typo

* format

* Some nits and such

* comment

* remove deleted files

* c++ nits

* objc nits

* all but one c++ bug

* init all fields

* start of documenting data shape

* nits and error handling

* more nits and such

* bug?

* references

* const

* new null for larger alltypes

Co-authored-by: Stuart Morgan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App p: pigeon

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[pigeon] Explicitly wrap EncodableMap in EncodableValue in C++ generated code [pigeon] Condense serialization formats

3 participants