Skip to content

Commit 31dc969

Browse files
natebiggsCommit Queue
authored andcommitted
[ddc] Test DartPad-like hot reload workflow.
Refactors the hot reload test suite to support non-FE server based hot reload. Similar to DartPad it uses a DDC process running in '--persistent_worker' mode and sends bazel requests for each reload. I call this "stateless" mode because the compilation process itself is not maintaining any state. The necessary metadata is passed from one compilation to the other via a delta dill. This differs from the "stateful" mode where the FE server persists a kernel AST in memory from one compilation to the next. Disregarding the browsers there are effectively 3 run modes now: - web stateful - web stateless (new) - vm stateful One key difference between the "stateless" and "stateful" modes is the output format of the JS files. In stateful mode DDC emits a file per library being re-compiled. In stateless mode DDC is emitting a single file with all the libraries. DartPad's workflow is slightly simpler than what's seen in the stateless mode here. It only supports editing a single library so we skip processing any metadata. To simulate this I've added the special 'main_only' which passes a single library for each reload generation. I've verified that this would fail if not for the change recently made to ddc_module_loader.js. Change-Id: If05da6dbeded4dd20e9e6d9dfaed52151541a19b Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/434340 Commit-Queue: Nate Biggs <[email protected]> Reviewed-by: Mark Zhou <[email protected]> Reviewed-by: Kevin Moore <[email protected]> Reviewed-by: Nicholas Shahan <[email protected]>
1 parent 4b3c8a3 commit 31dc969

File tree

8 files changed

+950
-503
lines changed

8 files changed

+950
-503
lines changed

pkg/dev_compiler/lib/src/command/command.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,8 +394,8 @@ Future<CompilerResult> _compile(
394394
} else {
395395
if (reloadLastAcceptedKernel != null) {
396396
throw ArgumentError(
397-
"Must provide 'new-reload-delta-kernel' if "
398-
"'old-reload-delta-kernel' provided.",
397+
"Must provide 'reload-delta-kernel' if "
398+
"'reload-last-accepted-kernel' provided.",
399399
);
400400
}
401401
}

0 commit comments

Comments
 (0)