Skip to content
Merged
4 changes: 4 additions & 0 deletions dwds/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
## 24.3.11-wip

- Added WebSocket-based hot reload support: `reloadSources` in `ChromeProxyService` and `DevHandler` now handle hot reload requests and responses over WebSockets.
- Refactored the injected client to use a reusable function for handling hot reload requests and responses over WebSockets.

## 24.3.10

- Disabled breakpoints on changed files in a hot reload. They currently do not
map to the correct locations or are broken, so disable them for now. - [#60186](https://github.com/dart-lang/sdk/issues/60186)


## 24.3.9

- Renamed DWDS Injector parameter `enableDebuggingSupport` to `injectDebuggingSupportCode` for clearer intent.
Expand Down
24 changes: 24 additions & 0 deletions dwds/lib/data/hot_reload_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_reload_request;

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

part 'hot_reload_request.g.dart';

/// A request to hot reload the application.
abstract class HotReloadRequest
implements Built<HotReloadRequest, HotReloadRequestBuilder> {
static Serializer<HotReloadRequest> get serializer =>
_$hotReloadRequestSerializer;

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

HotReloadRequest._();
factory HotReloadRequest([void Function(HotReloadRequestBuilder) updates]) =
_$HotReloadRequest;
}
151 changes: 151 additions & 0 deletions dwds/lib/data/hot_reload_request.g.dart

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

31 changes: 31 additions & 0 deletions dwds/lib/data/hot_reload_response.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// 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_reload_response;

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

part 'hot_reload_response.g.dart';

/// A response to a hot reload request.
abstract class HotReloadResponse
implements Built<HotReloadResponse, HotReloadResponseBuilder> {
static Serializer<HotReloadResponse> get serializer =>
_$hotReloadResponseSerializer;

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

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

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

HotReloadResponse._();
factory HotReloadResponse([void Function(HotReloadResponseBuilder) updates]) =
_$HotReloadResponse;
}
Loading
Loading