Skip to content

Commit 59fe863

Browse files
committed
[ DWDS ] Expose dtdUri via DebugConnection (#2694)
This is needed to access the DTD instance spawned by DDS.
1 parent d5a5a26 commit 59fe863

File tree

7 files changed

+27
-9
lines changed

7 files changed

+27
-9
lines changed

dwds/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
## 25.1.0+1-wip
1+
## 25.1.0+1
22

33
- Bump SDK constraint to ^3.10.0
44
- Added 'scriptUri' parameter to compileExpressionToJs
55
- Fix an issue in `reloadSources` where a `PauseInterrupted` event was sent. - [#61560](https://github.com/dart-lang/sdk/issues/61560)
6+
- Expose `dtdUri` via `DebugConnection`.
67

78
## 25.1.0
89

dwds/lib/src/connections/debug_connection.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ class DebugConnection {
4141
/// The endpoint of the Dart DevTools instance.
4242
String? get devToolsUri => _appDebugServices.devToolsUri?.toString();
4343

44+
/// The endpoint of the Dart Tooling Daemon (DTD).
45+
String? get dtdUri => _appDebugServices.dtdUri?.toString();
46+
4447
/// A client of the Dart VM Service with DWDS specific extensions.
4548
VmService get vmService => _appDebugServices.dwdsVmClient.client;
4649

dwds/lib/src/handlers/dev_handler.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -869,6 +869,7 @@ class DevHandler {
869869
dwdsStats,
870870
dds?.wsUri,
871871
dds?.devToolsUri,
872+
dds?.dtdUri,
872873
);
873874
final encodedUri = await debugService.encodedUri;
874875
_logger.info('Debug service listening on $encodedUri\n');

dwds/lib/src/services/app_debug_services.dart

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ abstract class AppDebugServices {
1414
DwdsStats? get dwdsStats;
1515
Uri? get ddsUri;
1616
Uri? get devToolsUri;
17+
Uri? get dtdUri;
1718
String? get connectedInstanceId;
1819
set connectedInstanceId(String? id);
1920
Future<void> close();
@@ -27,6 +28,7 @@ class ChromeAppDebugServices implements AppDebugServices {
2728
final DwdsStats _dwdsStats;
2829
final Uri? _ddsUri;
2930
final Uri? _devToolsUri;
31+
final Uri? _dtdUri;
3032
Future<void>? _closed;
3133
String? _connectedInstanceId;
3234

@@ -36,6 +38,7 @@ class ChromeAppDebugServices implements AppDebugServices {
3638
this._dwdsStats,
3739
this._ddsUri,
3840
this._devToolsUri,
41+
this._dtdUri,
3942
);
4043

4144
@override
@@ -53,6 +56,9 @@ class ChromeAppDebugServices implements AppDebugServices {
5356
@override
5457
Uri? get devToolsUri => _devToolsUri;
5558

59+
@override
60+
Uri? get dtdUri => _dtdUri;
61+
5662
@override
5763
String? get connectedInstanceId => _connectedInstanceId;
5864

@@ -86,12 +92,17 @@ class WebSocketAppDebugServices implements AppDebugServices {
8692
// WebSocket-only service - Chrome/DDS features not available
8793
@override
8894
DwdsStats? get dwdsStats => null;
95+
8996
@override
9097
// TODO(bkonyi): DDS should still start in WebSocket mode.
9198
Uri? get ddsUri => null;
99+
92100
@override
93101
Uri? get devToolsUri => null;
94102

103+
@override
104+
Uri? get dtdUri => null;
105+
95106
@override
96107
ProxyService get proxyService => _debugService.webSocketProxyService;
97108

dwds/lib/src/version.dart

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dwds/pubspec.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: dwds
22
# Every time this changes you need to run `dart run build_runner build`.
3-
version: 25.1.0+1-wip
3+
version: 25.1.0+1
44

55
description: >-
66
A service that proxies between the Chrome debug protocol and the Dart VM
@@ -15,8 +15,8 @@ dependencies:
1515
built_value: ^8.3.0
1616
collection: ^1.15.0
1717
crypto: ^3.0.2
18-
dds: '>=4.2.5 <6.0.0'
19-
file: '>=6.1.4 <8.0.0'
18+
dds: ">=4.2.5 <6.0.0"
19+
file: ">=6.1.4 <8.0.0"
2020
http: ^1.0.0
2121
http_multi_server: ^3.2.0
2222
logging: ^1.0.2
@@ -29,15 +29,15 @@ dependencies:
2929
shelf_packages_handler: ^3.0.0
3030
shelf_proxy: ^1.0.4
3131
shelf_static: ^1.1.0
32-
shelf_web_socket: '>=2.0.0 <4.0.0'
32+
shelf_web_socket: ">=2.0.0 <4.0.0"
3333
source_maps: ^0.10.10
3434
stack_trace: ^1.10.0
3535
stream_channel: ^2.1.2
3636
sse: ^4.1.2
3737
uuid: ^4.0.0
38-
vm_service: '>=14.2.4 <16.0.0'
38+
vm_service: ">=14.2.4 <16.0.0"
3939
vm_service_interface: ^2.0.1
40-
web_socket_channel: '>=2.2.0 <4.0.0'
40+
web_socket_channel: ">=2.2.0 <4.0.0"
4141
web: ^1.1.0
4242
webkit_inspection_protocol: ^1.0.1
4343

@@ -55,7 +55,7 @@ dev_dependencies:
5555
frontend_server_common:
5656
path: ../frontend_server_common
5757
io: ^1.0.5
58-
js: '>=0.6.4 <0.8.0'
58+
js: ">=0.6.4 <0.8.0"
5959
pubspec_parse: ^1.2.0
6060
puppeteer: ^3.1.1
6161
test: ^1.21.6

dwds/test/dds_port_test.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ void main() {
4242
),
4343
);
4444
expect(Uri.parse(context.debugConnection.ddsUri!).port, expectedPort);
45+
expect(context.debugConnection.dtdUri, isNotNull);
4546
});
4647

4748
test('DWDS starts DDS with a specified port', () async {
@@ -58,5 +59,6 @@ void main() {
5859
),
5960
);
6061
expect(Uri.parse(context.debugConnection.ddsUri!).port, expectedPort);
62+
expect(context.debugConnection.dtdUri, isNotNull);
6163
});
6264
}

0 commit comments

Comments
 (0)