flutter
flutter copied to clipboard
[native_assets] Stop running link hooks in JIT mode
Stop running link hooks in debug mode.
Rationale: link hooks only get access to tree-shaking info in release builds, so they can't do anything meaningful in debug builds. Debug builds should be fast as development cycle, so running less is better.
More details:
- https://github.com/dart-lang/native/issues/1252
Also: rolls packages to latest versions.
Implementation details
The decision whether linking is enabled is made as follows:
- For normal builds
build_info.dart::BuildModeis used to determine whether Dart is compiled in JIT or AOT mode. - Testers always run in JIT, so no linking.
- Native asset dry runs only run for JIT builds (e.g only when hot reload and hot restart are enabled).
Testing
The integration test is updated to output an asset for linking if BuildConfig.linkingEnabled is true, and to output an asset for bundling directly if linking is not enabled.
Pre-launch Checklist
- [x] I read the Contributor Guide and followed the process outlined there for submitting PRs.
- [x] I read the Tree Hygiene wiki page, which explains my responsibilities.
- [x] I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
- [x] I signed the CLA.
- [x] I listed at least one issue that this PR fixes in the description above.
- [x] I updated/added relevant documentation (doc comments with
///). - [x] I added new tests to check the change I am making, or this PR is test-exempt.
- [ ] I followed the breaking change policy and added Data Driven Fixes where supported.
- [x] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel on Discord.
FYI @mosuem
@christopherfujino This is ready for review. Let me know if you have any questions.
@andrewkolos can you review this one? I have my hands full with cherrypick release.