Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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
4 changes: 4 additions & 0 deletions dwds/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 24.3.8

- Updated DWDS to include a boolean flag that enables debugging support only when set to true. [#60289](https://github.com/dart-lang/sdk/issues/60289)

## 24.3.7

- The registered extension `reassemble` is now no longer called when calling
Expand Down
6 changes: 5 additions & 1 deletion dwds/lib/dart_web_debug_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class Dwds {
required Stream<BuildResult> buildResults,
required ConnectionProvider chromeConnection,
required ToolConfiguration toolConfiguration,
bool enableDebuggingSupport = true,
Copy link
Collaborator

Choose a reason for hiding this comment

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

It'd be great if we had documentation explaining what this does and what the implications are. Unfortunately, it doesn't look like we have much documentation here. Can we at least add some to the DwdsInjector constructor for now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated the docstring for DwdsInjector to include more details.

}) async {
globalToolConfiguration = toolConfiguration;
final debugSettings = toolConfiguration.debugSettings;
Expand Down Expand Up @@ -117,7 +118,10 @@ class Dwds {
_logger.info('Serving DevTools at $uri\n');
}

final injected = DwdsInjector(extensionUri: extensionUri);
final injected = DwdsInjector(
extensionUri: extensionUri,
enableDebuggingSupport: enableDebuggingSupport,
);

final devHandler = DevHandler(
chromeConnection,
Expand Down
25 changes: 17 additions & 8 deletions dwds/lib/src/handlers/injector.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,13 @@ class DwdsInjector {
final Future<String>? _extensionUri;
final _devHandlerPaths = StreamController<String>();
final _logger = Logger('DwdsInjector');
final bool _enableDebuggingSupport;

DwdsInjector({Future<String>? extensionUri}) : _extensionUri = extensionUri;
DwdsInjector({
Future<String>? extensionUri,
bool enableDebuggingSupport = true,
}) : _extensionUri = extensionUri,
_enableDebuggingSupport = enableDebuggingSupport;

/// Returns the embedded dev handler paths.
///
Expand Down Expand Up @@ -95,13 +100,17 @@ class DwdsInjector {
await globalToolConfiguration.loadStrategy.trackEntrypoint(
entrypoint,
);
body = await _injectClientAndHoistMain(
body,
appId,
devHandlerPath,
entrypoint,
await _extensionUri,
);
// If true, inject the debugging client and hoist the main function
// to enable debugging support.
if (_enableDebuggingSupport) {
body = await _injectClientAndHoistMain(
body,
appId,
devHandlerPath,
entrypoint,
await _extensionUri,
);
}
body += await globalToolConfiguration.loadStrategy.bootstrapFor(
entrypoint,
);
Expand Down
2 changes: 1 addition & 1 deletion dwds/lib/src/version.dart

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

2 changes: 1 addition & 1 deletion dwds/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: dwds
# Every time this changes you need to run `dart run build_runner build`.
version: 24.3.7
version: 24.3.8
description: >-
A service that proxies between the Chrome debug protocol and the Dart VM
service protocol.
Expand Down
Loading