Skip to content

[native_assets_cli] Stop running link hooks in JIT mode. #1252

Closed

Description

@dcharkes

We should stop running link hooks for JIT targets.

  1. The hooks can't do anything meaningful over build hooks due to not having treeshaking info ([native_assets_builder] Add hook/link.dart #153).
  2. Their "map-reduce"-like behavior means that many assets will be touched on rebuilds (cold start JIT, hot reload, hot restart ([native_assets_cli][native_assets_builder] Hot reload and hot restart #1207)).

The price to pay is that in JIT-mode, a build hook needs to do the linking. So likely, there'll be some shared logic between the build and link hooks in packages that have a link hook.

And we need an API for BuildConfig detailing if the link hooks will be run: bool BuildConfig.hasLinkPhase?

  • Add BuildConfig field.
  • Stop running link hooks in JIT mode (Dart and Flutter PRs).
  • Add proper documentation.

Thanks @mkustermann @mosuem @HosseinYousefi @liamappelbe! Please leave additional suggestions, thoughts, etc!

Activity

  1. added
    P1A high priority bug; for example, a single project is unusable or has many test failures
    on Jul 2, 2024
  2. mosuem commented on Jul 3, 2024

    @mosuem
    Member

    Documentation/Messaging on this is important, as we don't want people wondering why their link hooks did or did not run, or even worse, why some assets are there/missing if compiling in JIT vs. AOT.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1A high priority bug; for example, a single project is unusable or has many test failurespackage:hookspackage:hooks_runner

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions