Skip to content

Commit 8f583fe

Browse files
jyameoyuuangzhang
authored andcommitted
Set injectDebuggingSupportCode in DWDS based on specified device ID (flutter#165820)
This change ensures that `injectDebuggingSupportCode` in DWDS is set based on the specified device ID, defaulting to Chrome. This complements the changes made in dart-lang/webdev#2601 and ensures that debugging support is correctly configured for different environments. fixes dart-lang/sdk#60289
1 parent 093ca0c commit 8f583fe

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

packages/flutter_tools/lib/src/isolated/devfs_web.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ typedef DwdsLauncher =
4949
required Stream<BuildResult> buildResults,
5050
required ConnectionProvider chromeConnection,
5151
required ToolConfiguration toolConfiguration,
52+
bool injectDebuggingSupportCode,
5253
});
5354

5455
// A minimal index for projects that do not yet support web. A meta tag is used
@@ -428,6 +429,10 @@ class WebAssetServer implements AssetReader {
428429
),
429430
appMetadata: AppMetadata(hostname: hostname),
430431
),
432+
// Defaults to 'chrome' if deviceManager or specifiedDeviceId is null,
433+
// ensuring the condition is true by default.
434+
injectDebuggingSupportCode:
435+
(globals.deviceManager?.specifiedDeviceId ?? 'chrome') == 'chrome',
431436
);
432437
shelf.Pipeline pipeline = const shelf.Pipeline();
433438
if (enableDwds) {

packages/flutter_tools/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ dependencies:
1313
archive: 3.6.1
1414
args: 2.6.0
1515
dds: 5.0.0
16-
dwds: 24.3.7
16+
dwds: 24.3.9
1717
code_builder: 4.10.1
1818
completion: 1.0.1
1919
coverage: 1.11.1
@@ -122,4 +122,4 @@ dartdoc:
122122
# Exclude this package from the hosted API docs.
123123
nodoc: true
124124

125-
# PUBSPEC CHECKSUM: f46e
125+
# PUBSPEC CHECKSUM: 2f70

0 commit comments

Comments
 (0)