Open
Description
The hook/build.dart
is run before kernel compilation.
We should consider running a hook/link.dart
after kernel compilation. In AOT we would have access to tree-shaking information that would enable us to:
- Not include an asset at all if it's not referenced from Dart code.
- Shrinking the contents of an asset if only a subset of its contents are used.
Use cases:
- If a dynamic library (native code asset) is not used at all, don't bundle it.
- For localization, we want to bundle a message file, and we want to tree-shake that message file based on what is reachable from the code. (If we would have icons, it would probably follow something similar to locazation.) https://github.com/dart-lang/sdk/blob/main/pkg/compiler/doc/resource_identifiers.md
For use case 2, we want to standardize the annotations and output format for what is reachable, so that any user can implement tree-shaking for any type of resource they want to bundle (e.g. icons, images, localization, nothing is special.)
Flutter tracking issue:
Dart tracking issue:
Metadata
Metadata
Assignees
Type
Projects
Status
No status