Unverified Commit 35b571cc authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

Revert "Improve time to development by initializing frontend_server...

Revert "Improve time to development by initializing frontend_server concurrently with platform build (#45236)" (#45422)
parent c63c576b
......@@ -468,6 +468,7 @@ abstract class ResidentCompiler {
List<String> dartDefines,
}) = DefaultResidentCompiler;
/// If invoked for the first time, it compiles Dart script identified by
/// [mainPath], [invalidatedFiles] list is ignored.
/// On successive runs [invalidatedFiles] indicates which files need to be
......
......@@ -487,9 +487,6 @@ class DevFS {
if (fullRestart) {
generator.reset();
}
// On a full restart, or on an initial compile for the attach based workflow,
// this will produce a full dill. Subsequent invocations will produce incremental
// dill files that depend on the invalidated files.
printTrace('Compiling dart to kernel with ${invalidatedFiles.length} updated files');
final CompilerOutput compilerOutput = await generator.recompile(
mainPath,
......
......@@ -18,7 +18,6 @@ import 'base/platform.dart';
import 'base/terminal.dart';
import 'base/utils.dart';
import 'build_info.dart';
import 'bundle.dart';
import 'compile.dart';
import 'convert.dart';
import 'devfs.dart';
......@@ -263,31 +262,14 @@ class HotRunner extends ResidentRunner {
firstBuildTime = DateTime.now();
final List<Future<bool>> startupTasks = <Future<bool>>[];
for (FlutterDevice device in flutterDevices) {
// Here we initialize the frontend_server conccurently with the gradle
// build, reducing initialization time. This is safe because the first
// invocation of the frontend server produces a full dill file that
// the subsequent invocation in devfs will not overwrite.
if (device.generator != null) {
startupTasks.add(
device.generator.recompile(
mainPath,
<Uri>[],
outputPath: dillOutputPath ??
getDefaultApplicationKernelPath(trackWidgetCreation: device.trackWidgetCreation),
packagesFilePath : packagesFilePath,
).then((CompilerOutput output) => output?.errorCount == 0)
);
}
startupTasks.add(device.runHot(
final int result = await device.runHot(
hotRunner: this,
route: route,
).then((int result) => result == 0));
);
if (result != 0) {
return result;
}
final List<bool> results = await Future.wait(startupTasks);
if (!results.every((bool passed) => passed)) {
return 1;
}
return attach(
......
......@@ -108,18 +108,13 @@ void main() {
});
test('hot reload doesn\'t reassemble if paused', () async {
final Future<void> setup = _flutter.run(withDebugger: true);
final Completer<void> sawTick1 = Completer<void>();
await _flutter.run(withDebugger: true);
final Completer<void> sawTick2 = Completer<void>();
final Completer<void> sawTick3 = Completer<void>();
final Completer<void> sawDebuggerPausedMessage1 = Completer<void>();
final Completer<void> sawDebuggerPausedMessage2 = Completer<void>();
final StreamSubscription<String> subscription = _flutter.stdout.listen(
(String line) {
if (line.contains('((((TICK 1))))')) {
expect(sawTick1.isCompleted, isFalse);
sawTick1.complete();
}
if (line.contains('((((TICK 2))))')) {
expect(sawTick2.isCompleted, isFalse);
sawTick2.complete();
......@@ -134,8 +129,6 @@ void main() {
}
},
);
await setup;
await sawTick1.future;
await _flutter.addBreakpoint(
_project.buildBreakpointUri,
_project.buildBreakpointLine,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment