Skip to content

refactor: migrate ffigen configs to Dart and upgrade to ^21.0.0 - #324

Open
mosuem wants to merge 7 commits into
google:masterfrom
mosuem:migrate-ffigen-to-dart-config
Open

refactor: migrate ffigen configs to Dart and upgrade to ^21.0.0#324
mosuem wants to merge 7 commits into
google:masterfrom
mosuem:migrate-ffigen-to-dart-config

Conversation

@mosuem

@mosuem mosuem commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Migrated YAML ffigen configurations to Dart configurations in tool/ffigen.dart, updated ffigen to ^21.0.0, updated tool/update-bindings.sh, and re-generated native bindings.

@jonasfj

jonasfj commented Jul 15, 2026

Copy link
Copy Markdown
Member

Why not use YAML files?

@mosuem

mosuem commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator Author

Why not use YAML files?

https://pub.dev/packages/ffigen#yaml-configuration-reference It's being deprecated :)

@mosuem
mosuem requested a review from jonasfj July 16, 2026 09:25

@HamdaanAliQuatil HamdaanAliQuatil 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.

Moving the ffigen configuration to Dart makes sense since YAML configuration is being phased out.

I left comments on three things that currently make this harder to audit: typedefs: includeAll is greatly expanding the generated surface, the Flutter demo cleanup is unrelated, and the hooks major upgrade should be separated unless ffigen 20 requires it.

Could we keep this PR focused on the Dart configuration migration, the ffigen upgrade, the update script, and the necessary regenerated bindings? Changes to generated native bindings are much easier to review when the surrounding diff has one clear purpose.

Comment thread tool/ffigen.dart Outdated

@override
_MyAppState createState() => _MyAppState();
MyAppState createState() => MyAppState();

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.

Could we leave the demo changes out of this PR? They aren’t needed for the ffigen migration.

If the private return type was causing a lint, the narrower fix is:

State<MyApp> createState() => _MyAppState();

That keeps the state class private. The scrolling, spacing and deprecated-API cleanup would be easier to review separately.

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.

I just applied dart fix as a cleanup.

Comment thread pubspec.yaml
dependencies:
ffi: ^2.0.0
hooks: ^1.0.0
hooks: ^2.0.0

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.

Is the hooks 2.x upgrade required by ffigen 20? This changes a runtime dependency, while the rest of the PR is a code-generation tooling migration.

If it is independent, can we update it separately?

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.

I think its fine to do here IMO.

@mosuem
mosuem force-pushed the migrate-ffigen-to-dart-config branch from ee3749b to d6f835b Compare July 27, 2026 12:04
mosuem and others added 6 commits July 27, 2026 12:05
- Upgrade ffigen dependency to ^20.0.0 in pubspec.yaml
- Consolidate YAML ffigen configs into tool/ffigen.dart
- Update tool/update-bindings.sh to run dart run tool/ffigen.dart
- Re-generate native bindings
@mosuem
mosuem force-pushed the migrate-ffigen-to-dart-config branch from d6f835b to 027ccfe Compare July 27, 2026 12:05
@mosuem mosuem changed the title refactor: migrate ffigen configs to Dart and upgrade to ^20.0.0 refactor: migrate ffigen configs to Dart and upgrade to ^21.0.0 Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants