Skip to content

Commit 35b571c

Browse files
Revert "Improve time to development by initializing frontend_server concurrently with platform build (flutter#45236)" (flutter#45422)
1 parent c63c576 commit 35b571c

File tree

4 files changed

+7
-34
lines changed

4 files changed

+7
-34
lines changed

packages/flutter_tools/lib/src/compile.dart

+1
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,7 @@ abstract class ResidentCompiler {
468468
List<String> dartDefines,
469469
}) = DefaultResidentCompiler;
470470

471+
471472
/// If invoked for the first time, it compiles Dart script identified by
472473
/// [mainPath], [invalidatedFiles] list is ignored.
473474
/// On successive runs [invalidatedFiles] indicates which files need to be

packages/flutter_tools/lib/src/devfs.dart

-3
Original file line numberDiff line numberDiff line change
@@ -487,9 +487,6 @@ class DevFS {
487487
if (fullRestart) {
488488
generator.reset();
489489
}
490-
// On a full restart, or on an initial compile for the attach based workflow,
491-
// this will produce a full dill. Subsequent invocations will produce incremental
492-
// dill files that depend on the invalidated files.
493490
printTrace('Compiling dart to kernel with ${invalidatedFiles.length} updated files');
494491
final CompilerOutput compilerOutput = await generator.recompile(
495492
mainPath,

packages/flutter_tools/lib/src/run_hot.dart

+5-23
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import 'base/platform.dart';
1818
import 'base/terminal.dart';
1919
import 'base/utils.dart';
2020
import 'build_info.dart';
21-
import 'bundle.dart';
2221
import 'compile.dart';
2322
import 'convert.dart';
2423
import 'devfs.dart';
@@ -263,31 +262,14 @@ class HotRunner extends ResidentRunner {
263262

264263
firstBuildTime = DateTime.now();
265264

266-
final List<Future<bool>> startupTasks = <Future<bool>>[];
267265
for (FlutterDevice device in flutterDevices) {
268-
// Here we initialize the frontend_server conccurently with the gradle
269-
// build, reducing initialization time. This is safe because the first
270-
// invocation of the frontend server produces a full dill file that
271-
// the subsequent invocation in devfs will not overwrite.
272-
if (device.generator != null) {
273-
startupTasks.add(
274-
device.generator.recompile(
275-
mainPath,
276-
<Uri>[],
277-
outputPath: dillOutputPath ??
278-
getDefaultApplicationKernelPath(trackWidgetCreation: device.trackWidgetCreation),
279-
packagesFilePath : packagesFilePath,
280-
).then((CompilerOutput output) => output?.errorCount == 0)
281-
);
282-
}
283-
startupTasks.add(device.runHot(
266+
final int result = await device.runHot(
284267
hotRunner: this,
285268
route: route,
286-
).then((int result) => result == 0));
287-
}
288-
final List<bool> results = await Future.wait(startupTasks);
289-
if (!results.every((bool passed) => passed)) {
290-
return 1;
269+
);
270+
if (result != 0) {
271+
return result;
272+
}
291273
}
292274

293275
return attach(

packages/flutter_tools/test/integration.shard/hot_reload_test.dart

+1-8
Original file line numberDiff line numberDiff line change
@@ -108,18 +108,13 @@ void main() {
108108
});
109109

110110
test('hot reload doesn\'t reassemble if paused', () async {
111-
final Future<void> setup = _flutter.run(withDebugger: true);
112-
final Completer<void> sawTick1 = Completer<void>();
111+
await _flutter.run(withDebugger: true);
113112
final Completer<void> sawTick2 = Completer<void>();
114113
final Completer<void> sawTick3 = Completer<void>();
115114
final Completer<void> sawDebuggerPausedMessage1 = Completer<void>();
116115
final Completer<void> sawDebuggerPausedMessage2 = Completer<void>();
117116
final StreamSubscription<String> subscription = _flutter.stdout.listen(
118117
(String line) {
119-
if (line.contains('((((TICK 1))))')) {
120-
expect(sawTick1.isCompleted, isFalse);
121-
sawTick1.complete();
122-
}
123118
if (line.contains('((((TICK 2))))')) {
124119
expect(sawTick2.isCompleted, isFalse);
125120
sawTick2.complete();
@@ -134,8 +129,6 @@ void main() {
134129
}
135130
},
136131
);
137-
await setup;
138-
await sawTick1.future;
139132
await _flutter.addBreakpoint(
140133
_project.buildBreakpointUri,
141134
_project.buildBreakpointLine,

0 commit comments

Comments
 (0)