Skip to content

Make pauseIsolatesOnStart an optional parameter to hot-restart #2397

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 18 additions & 19 deletions dwds/lib/src/injected/client.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions dwds/web/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ Future<void>? main() {

Completer? readyToRunMainCompleter;

hotRestartJs = allowInterop((String runId, bool pauseIsolatesOnStart) {
if (pauseIsolatesOnStart) {
hotRestartJs = allowInterop((String runId, [bool? pauseIsolatesOnStart]) {
if (pauseIsolatesOnStart ?? false) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this preferable to giving it a default value?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also define @JS(r'$dartHotRestartDwds') somewhere else (in google3) and this way we don't need to update the parameters there too. I'm not sure if we would if this had a default value.

readyToRunMainCompleter = Completer();
return toPromise(
manager.hotRestart(
Expand Down Expand Up @@ -344,7 +344,7 @@ external String get dartModuleStrategy;

@JS(r'$dartHotRestartDwds')
external set hotRestartJs(
Promise<bool> Function(String runId, bool pauseIsolatesOnStart) cb,
Promise<bool> Function(String runId, [bool? pauseIsolatesOnStart]) cb,
);

@JS(r'$dartReadyToRunMain')
Expand Down