-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
area-metaCross-cutting, high-level issues (for tracking many other implementation issues, ...).Cross-cutting, high-level issues (for tracking many other implementation issues, ...).
Description
Problems:
- Flutter has an assets system, Dart does not. This is problematic when wanting to access bytes at runtime in a platform independent way.
- Various types of assets could benefit from minifying and/or tree-shaking. For example a translation package might only want include translations in a
translations.jsonasset with keys that are actually reachable from Dart code after Dart AOT optimizations.
High level outline:
- Bring
AssetBundletodart: - Make
build.dart(from ☂️ [vm/ffi] Build hooks & Code assets #50565) be able to output data assets besides code assets. - Introduce a
link.dartthat runs after dart AOT compilation that can do minifying and tree-shaking for data assets.
The tree-shaking info that link.dart would be getting is const values from arguments to static function calls and constructors:
// package:foo/foo.dart
void main() {
for(int i = 0; i < 10; i++){
foo(i, 'foo');
foo(i, 'bar');
}
}
@someTreeShakingAnnotationToBeDecided
foo (int i, string s) {
// ...
}->
[
{
"uri": "package:foo/foo.dart",
"name": "foo",
"callers" : [
{ "s" : "foo" },
{ "s" : "bar" },
]
}
]Some WIP format in the test cases: https://dart-review.googlesource.com/c/sdk/+/329961
More details to follow. Filing an issue so we have somewhere to point to.
halildurmus, ykmnkmi, dnys1, bivens-dev, safasofuoglu and 13 moreparlough, ykmnkmi, dnys1, bivens-dev, safasofuoglu and 5 morehalildurmus, ykmnkmi, mnordine, dnys1 and smit-ai
Metadata
Metadata
Labels
area-metaCross-cutting, high-level issues (for tracking many other implementation issues, ...).Cross-cutting, high-level issues (for tracking many other implementation issues, ...).