Skip to content

Commit b43030e

Browse files
authored
Implemented hot restart over websocket (#2666)
* implemented hot restart over websocket * remove service callback for fullReload * addressed comments * addressed comments
1 parent 94c172c commit b43030e

13 files changed

+2655
-992
lines changed

dwds/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
## 24.4.2-wip
22

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

57
## 24.4.1
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
library hot_restart_request;
6+
7+
import 'package:built_value/built_value.dart';
8+
import 'package:built_value/serializer.dart';
9+
10+
part 'hot_restart_request.g.dart';
11+
12+
/// A request to hot restart the application.
13+
abstract class HotRestartRequest
14+
implements Built<HotRestartRequest, HotRestartRequestBuilder> {
15+
static Serializer<HotRestartRequest> get serializer =>
16+
_$hotRestartRequestSerializer;
17+
18+
/// A unique identifier for this request.
19+
String get id;
20+
21+
HotRestartRequest._();
22+
factory HotRestartRequest([void Function(HotRestartRequestBuilder) updates]) =
23+
_$HotRestartRequest;
24+
}

dwds/lib/data/hot_restart_request.g.dart

Lines changed: 147 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
library hot_restart_response;
6+
7+
import 'package:built_value/built_value.dart';
8+
import 'package:built_value/serializer.dart';
9+
10+
part 'hot_restart_response.g.dart';
11+
12+
/// A response to a hot restart request.
13+
abstract class HotRestartResponse
14+
implements Built<HotRestartResponse, HotRestartResponseBuilder> {
15+
static Serializer<HotRestartResponse> get serializer =>
16+
_$hotRestartResponseSerializer;
17+
18+
/// The unique identifier matching the request.
19+
String get id;
20+
21+
/// Whether the hot restart succeeded on the client.
22+
bool get success;
23+
24+
/// An optional error message if success is false.
25+
@BuiltValueField(wireName: 'error')
26+
String? get errorMessage;
27+
28+
HotRestartResponse._();
29+
factory HotRestartResponse([
30+
void Function(HotRestartResponseBuilder) updates,
31+
]) = _$HotRestartResponse;
32+
}

0 commit comments

Comments
 (0)