Skip to content

Implemented hot restart over websocket #2666

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 4 commits into from
Aug 12, 2025
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
2 changes: 2 additions & 0 deletions dwds/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## 24.4.2-wip

- Implemented hot restart over websockets with multi window support.
- Fix refresh race condition bug by adding an isolate destruction grace period.
- Update a call to the `package:shelf_web_socket` `webSocketHandler()` function.

## 24.4.1
Expand Down
24 changes: 24 additions & 0 deletions dwds/lib/data/hot_restart_request.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

library hot_restart_request;

import 'package:built_value/built_value.dart';
import 'package:built_value/serializer.dart';

part 'hot_restart_request.g.dart';

/// A request to hot restart the application.
abstract class HotRestartRequest
implements Built<HotRestartRequest, HotRestartRequestBuilder> {
static Serializer<HotRestartRequest> get serializer =>
_$hotRestartRequestSerializer;

/// A unique identifier for this request.
String get id;

HotRestartRequest._();
factory HotRestartRequest([void Function(HotRestartRequestBuilder) updates]) =
_$HotRestartRequest;
}
147 changes: 147 additions & 0 deletions dwds/lib/data/hot_restart_request.g.dart

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

32 changes: 32 additions & 0 deletions dwds/lib/data/hot_restart_response.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

library hot_restart_response;

import 'package:built_value/built_value.dart';
import 'package:built_value/serializer.dart';

part 'hot_restart_response.g.dart';

/// A response to a hot restart request.
abstract class HotRestartResponse
implements Built<HotRestartResponse, HotRestartResponseBuilder> {
static Serializer<HotRestartResponse> get serializer =>
_$hotRestartResponseSerializer;

/// The unique identifier matching the request.
String get id;

/// Whether the hot restart succeeded on the client.
bool get success;

/// An optional error message if success is false.
@BuiltValueField(wireName: 'error')
String? get errorMessage;

HotRestartResponse._();
factory HotRestartResponse([
void Function(HotRestartResponseBuilder) updates,
]) = _$HotRestartResponse;
}
Loading
Loading