Skip to content

[flutter_hook_config] Add the flutter_hook_config package#19

Merged
bdero merged 2 commits into
flutter:mainfrom
bdero:bdero/flutter-hook-config
Jun 9, 2026
Merged

[flutter_hook_config] Add the flutter_hook_config package#19
bdero merged 2 commits into
flutter:mainfrom
bdero:bdero/flutter-hook-config

Conversation

@bdero

@bdero bdero commented Jun 8, 2026

Copy link
Copy Markdown
Member

Towards flutter/flutter#186299

Adds flutter_hook_config, a package:hooks protocol extension owned by Flutter. It lets the Flutter SDK pass engine host-tool paths (such as impellerc and libtessellator) to build and link hooks in a typed way, resolved through the same artifact lookup flutter_tools uses for its own build steps, so --local-engine propagates to hooks instead of silently using stale cached tools.

Originally proposed in flutter/packages#11701. Per review there, the package belongs in this repo: flutter_tools depends on it, so keeping it in flutter/packages would create a circular repo dependency. This moves it here unchanged apart from the repo onboarding bits (SDK constraint, allowed dependencies, labeler, README) and a bump to hooks: ^2.0.0.

What a Flutter build hook looks like with it:

import 'package:flutter_hook_config/flutter_hook_config.dart';
import 'package:hooks/hooks.dart';

void main(List<String> args) async {
  await build(args, (input, output) async {
    if (input.config.buildForFlutter) {
      final impellerc = input.config.flutter.impellerc; // absolute Uri
      // ... invoke impellerc to compile a shader bundle ...
    } else {
      // Plain `dart` build, or a Flutter SDK without this extension:
      // fall back to the hook's own tool discovery.
    }
  });
}

v1 exposes impellerc, libtessellator, and an engineVersion for cache invalidation; more host artifacts can be added later as null-checked fields. Pure Dart, depends on hooks: ^2.0.0, starts at 0.1.0 while the shape stabilizes.

Pre-Review Checklist

@bdero bdero added the triage-framework Should be looked at in framework triage label Jun 8, 2026
@bdero bdero marked this pull request as ready for review June 8, 2026 19:25
@bdero bdero requested review from dcharkes and stuartmorgan-g June 8, 2026 19:28
@bdero

bdero commented Jun 8, 2026

Copy link
Copy Markdown
Member Author

Migrated from flutter/packages#11701.

FYI @dcharkes, I also updated this to use hooks v2.

@bdero

bdero commented Jun 8, 2026

Copy link
Copy Markdown
Member Author

Copying publishing notes from previous PR:

Note for shipping this: flutter_hook_config is a brand-new package, so on its first publish the release workflow will publish it under the bot publisher account rather than the flutter.dev verified publisher. Someone on the Flutter team with publisher-account access will need to do the one-time transfer from the package's Admin tab on pub.dev afterward (per the packages release process docs; access is tracked internally at b/191674407). Happy to coordinate in #hackers-ecosystem.

Also flagging: the top-level README.md row and the issue_tracker URL reference pub.dev/packages/flutter_hook_config and the flutter/flutter label p: flutter_hook_config, neither of which exists yet, so the badges/links will 404 until the package publishes and the label is created.

@Piinks

Piinks commented Jun 8, 2026

Copy link
Copy Markdown

I am not aware of this being owned by the framework team. Let's discuss if that is expected. Removing the triage label for now.

@Piinks Piinks removed the triage-framework Should be looked at in framework triage label Jun 8, 2026
@bdero

bdero commented Jun 8, 2026

Copy link
Copy Markdown
Member Author

@Piinks Ah whoopsies, I added that label by accident. This is more tools-esque.

@dcharkes dcharkes left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All the comments from flutter/packages#11701 have been addressed. LGTM!

@bdero bdero merged commit daffbc8 into flutter:main Jun 9, 2026
12 checks passed
@bdero bdero deleted the bdero/flutter-hook-config branch June 9, 2026 13:30
@github-actions github-actions Bot added triage-framework Should be looked at in framework triage p: flutter_hook_config labels Jun 9, 2026
@stuartmorgan-g

stuartmorgan-g commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Note for shipping this: flutter_hook_config is a brand-new package, so on its first publish the release workflow will publish it under the bot publisher account rather than the flutter.dev verified publisher. Someone on the Flutter team with publisher-account access will need to do the one-time transfer from the package's Admin tab on pub.dev afterward

Except it isn't a new package; what appears to be a placeholder package, with no useful metadata about where it came from, was published 5 months ago. So the publishing failed.

Does one of you own that package?

(The only clue to ownership I can find in the package is that it is "Copyright 2025, the Dart project authors", so hopefully that means someone on the Dart team is the package owner.)

@bdero

bdero commented Jun 9, 2026

Copy link
Copy Markdown
Member Author

Ugh, no. I thought I had checked if the name was taken, but I guess not. :/ This was actually my second choice name, as the first name I chose was also taken. Another good name would be flutter_hook_extensions... making a follow-up to rename now. I can also back it out and reland if you'd prefer.

@dcharkes

dcharkes commented Jun 9, 2026

Copy link
Copy Markdown

I'm also not owning it. But it seems that package is just being name-squatted, which is against the pub.dev policy: https://pub.dev/policy#name-squatting I've pinged the pub team to unsquat it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

p: flutter_hook_config triage-framework Should be looked at in framework triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants