-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityteam-toolOwned by Flutter Tool teamOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.triaged-toolTriaged by Flutter Tool teamTriaged by Flutter Tool team
Description
In #129757, we've added hook/build.dart which runs before kernel compilation.
The link hook (hook/link.dart) will run after kernel compilation and enable tree-shaking assets:
- Completely removing an asset if it's not used.
- Shrinking the contents of an asset if only a subset of it is used.
This issue tracks the flutter_tools implementation of invoking link hooks.
- MacOS
- iOS (including add2app)
- Linux
- Android (including add2app)
- Windows
Only in AOT compilation (flutter release) will tree-shaking be available.
However, link hooks should also be invoked on all JIT paths (including hot-restart).
The relevant code can be found in the PRs mentioning #129757 (note that many files moved in #143055).
Tracking issue for the link hook for both Dart and Flutter combined:
Umbrella issue for native assets:
cc @mosuem you don't seem to be part of the flutter org yet on GitHub, so I can't assign you to this issue.
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityteam-toolOwned by Flutter Tool teamOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.triaged-toolTriaged by Flutter Tool teamTriaged by Flutter Tool team