Add experimental hot reload flag support to flutter tools (#162889)

Rather than ask users to pass the complicated and long string
`--extra-front-end-options=--dartdevc-canary,--dartdevc-module-format=ddc`
we want a simpler flag to enable the new DDC module system/hot reload.

Technically this flag enables the new module system, not necessarily hot
reload directly. But we only expect people to use the flag to enable hot
reload so I've chosen the name based on that.

---------

Co-authored-by: Nate Biggs <natebiggs@google.com>
This commit is contained in:
Nate Biggs
2025-02-10 12:23:47 -05:00
committed by GitHub
parent 33a4c95de0
commit 1d766ed8d9
6 changed files with 17 additions and 24 deletions

View File

@@ -11,9 +11,7 @@ import '../src/common.dart';
void main() {
testAll(
chrome: true,
additionalCommandArgs: <String>[
'--extra-front-end-options=--dartdevc-canary,--dartdevc-module-format=ddc',
],
additionalCommandArgs: <String>['--web-experimental-hot-reload'],
// TODO(srujzs): Remove this custom message once we have the delta inspector emitting the same
// string as the VM.
constClassFieldRemovalErrorMessage: 'Const class cannot remove fields',

View File

@@ -9,10 +9,5 @@ import '../integration.shard/test_data/hot_reload_test_common.dart';
import '../src/common.dart';
void main() {
testAll(
chrome: true,
additionalCommandArgs: <String>[
'--extra-front-end-options=--dartdevc-canary,--dartdevc-module-format=ddc',
],
);
testAll(chrome: true, additionalCommandArgs: <String>['--web-experimental-hot-reload']);
}

View File

@@ -9,10 +9,5 @@ import '../integration.shard/test_data/hot_reload_with_asset_test_common.dart';
import '../src/common.dart';
void main() {
testAll(
chrome: true,
additionalCommandArgs: <String>[
'--extra-front-end-options=--dartdevc-canary,--dartdevc-module-format=ddc',
],
);
testAll(chrome: true, additionalCommandArgs: <String>['--web-experimental-hot-reload']);
}

View File

@@ -9,10 +9,5 @@ import '../integration.shard/test_data/stateless_stateful_hot_reload_test_common
import '../src/common.dart';
void main() {
testAll(
chrome: true,
additionalCommandArgs: <String>[
'--extra-front-end-options=--dartdevc-canary,--dartdevc-module-format=ddc',
],
);
testAll(chrome: true, additionalCommandArgs: <String>['--web-experimental-hot-reload']);
}

View File

@@ -73,9 +73,7 @@ Future<void> _testProject(
late FlutterRunTestDriver flutter;
final List<String> additionalCommandArgs =
useDDCLibraryBundleFormat
? <String>['--extra-front-end-options=--dartdevc-canary,--dartdevc-module-format=ddc']
: <String>[];
useDDCLibraryBundleFormat ? <String>['--web-experimental-hot-reload'] : <String>[];
final String testName =
'Hot restart (index.html: $name)'
'${additionalCommandArgs.isEmpty ? '' : ' with args: $additionalCommandArgs'}';