Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
2155044
DWDS Feature: Daemon Expression Compiler & FES Support
Markzipan Aug 11, 2026
c7ad8a7
Cleanup internal monologue comments in context.dart
Markzipan Aug 14, 2026
75a01b5
Refine DaemonExpressionCompiler to handle raw FES response format
Markzipan Aug 14, 2026
cdd5a8b
Fix analysis errors and clean up context.dart in hot_reload_and_eval_1
Markzipan Aug 14, 2026
39c9bd6
Format files in hot_reload_and_eval_1
Markzipan Aug 14, 2026
ff6babf
Merge hot_reload_and_eval_0 into hot_reload_and_eval_1 and resolve co…
Markzipan Aug 14, 2026
c9ae9f5
Merge hot_reload_and_eval_0 and propagate cleanup
Markzipan Aug 14, 2026
5bfe612
Merge branch 'hot_reload_and_eval_0' into hot_reload_and_eval_1
Markzipan Aug 14, 2026
cb4fef0
Merge branch 'hot_reload_and_eval_0' into hot_reload_and_eval_1
Markzipan Aug 14, 2026
22f2ec6
Merge branch 'hot_reload_and_eval_0' into hot_reload_and_eval_1
Markzipan Aug 14, 2026
0765432
Merge branch 'hot_reload_and_eval_0' into hot_reload_and_eval_1
Markzipan Aug 14, 2026
64f454b
Merge branch 'hot_reload_and_eval_0' into hot_reload_and_eval_1
Markzipan Aug 14, 2026
31013fa
Merge hot_reload_and_eval_0 with Chrome CI fixes
Markzipan Aug 14, 2026
1f4a872
Merge hot_reload_and_eval_0 with Zizmor fixes
Markzipan Aug 14, 2026
f3c2d91
Merge hot_reload_and_eval_0 with pull_request_label fix
Markzipan Aug 14, 2026
a847a08
Merge hot_reload_and_eval_0 with fixed Chrome paths
Markzipan Aug 14, 2026
65de936
Merge hot_reload_and_eval_0 with GITHUB_ENV fixes
Markzipan Aug 14, 2026
24ae198
Pass useDebuggerModuleNames to TestBuildSettings in test contexts
Markzipan Aug 15, 2026
77c1a9a
Fix duplicate daemon connection in BuildDaemonAndFrontendServerTestCo…
Markzipan Aug 15, 2026
9848bc6
Format files
Markzipan Aug 15, 2026
502c055
Resolve standard Windows Chrome installation paths in context.dart
Markzipan Aug 15, 2026
d663344
Pass provider moduleFormat and canaryFeatures to TestSettings in dart…
Markzipan Aug 15, 2026
03ff95d
Improve waitForAppId error reporting and diagnostic output
Markzipan Aug 15, 2026
7a0b9f4
Fix appServerPath in dart_uri_file_uri and reset _expressionCompiler …
Markzipan Aug 15, 2026
8887909
Format code with dart format
Markzipan Aug 15, 2026
e631a72
Format code with dart format
Markzipan Aug 17, 2026
f3787c9
Format code with modern dart format
Markzipan Aug 17, 2026
5762eda
Format debug_extension with modern dart format
Markzipan Aug 17, 2026
36fbb6f
Prepare 4.0.2 release (#2866)
Markzipan Aug 17, 2026
5c2fc0d
Remove test_uri.dart scratch file
Markzipan Aug 17, 2026
c6730f4
Merge origin/main into hot_reload_and_eval_1
Markzipan Aug 17, 2026
c8ed274
Implement waitForSuccessfulBuild in BuildDaemonContextMixin
Markzipan Aug 18, 2026
620c89b
Fix _logger in BuildDaemonTestContext
Markzipan Aug 18, 2026
ccbeb80
Fix appServerPath in dart_uri_file_uri to check usesFrontendServer
Markzipan Aug 18, 2026
d5d4133
Reduce concurrency in asset_handler test to prevent socket exhaustion…
Markzipan Aug 18, 2026
ec63914
Wrap test IOClient with RetryClient to handle intermittent TCP connec…
Markzipan Aug 18, 2026
e5469e3
Log warning when retrying request on network error in RetryClient
Markzipan Aug 18, 2026
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
6 changes: 6 additions & 0 deletions dwds/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 28.0.0

- Support expression evaluation in Frontend Server + Build Daemon mode via `DaemonExpressionCompiler`.
- Add `WebPathTranslator` to support path translation between Frontend Server and Build Daemon.
- Replace `PackageUriMapper` with `PathResolver` strategy.

## 27.1.3-wip

- Internal test infrastructure refactoring: Move common test files to `dwds_test_common`.
Expand Down
7 changes: 6 additions & 1 deletion dwds/lib/asset_reader.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,9 @@
// BSD-style license that can be found in the LICENSE file.

export 'src/readers/asset_reader.dart'
show AssetReader, PackageUriMapper, stripLeadingSlashes;
show
AssetReader,
BuildRunnerPathResolver,
FrontendServerPathResolver,
PathResolver,
stripLeadingSlashes;
13 changes: 12 additions & 1 deletion dwds/lib/dwds.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,16 @@ export 'src/debugging/metadata/provider.dart'
export 'src/events.dart' show DwdsEvent;
export 'src/handlers/dev_handler.dart' show AppConnectionException;
export 'src/handlers/socket_connections.dart';
export 'src/loaders/asset_scheme.dart'
show AssetScheme, BuildRunnerAssetScheme, FrontendServerAssetScheme;
export 'src/loaders/build_runner_strategy_provider.dart'
show
BuildRunnerDdcLibraryBundleStrategyProvider,
BuildRunnerRequireStrategyProvider;
export 'src/loaders/ddc.dart' show DdcStrategy;
export 'src/loaders/frontend_server_strategy_provider.dart'
show
FrontendServerBuildDaemonStrategyProvider,
FrontendServerDdcLibraryBundleStrategyProvider,
FrontendServerDdcStrategyProvider,
FrontendServerRequireStrategyProvider;
Expand All @@ -35,13 +38,21 @@ export 'src/loaders/strategy.dart'
LoadStrategy,
ReloadConfiguration,
ReloadableLoadStrategy;
export 'src/readers/asset_reader.dart' show AssetReader, PackageUriMapper;
export 'src/readers/asset_reader.dart'
show
AssetReader,
BuildRunnerPathResolver,
FlutterPathResolver,
FrontendServerPathResolver,
PathResolver;
export 'src/readers/frontend_server_asset_reader.dart'
show FrontendServerAssetReader;
export 'src/readers/proxy_server_asset_reader.dart' show ProxyServerAssetReader;
export 'src/servers/devtools.dart';
export 'src/services/chrome/chrome_debug_exception.dart'
show ChromeDebugException;
export 'src/services/daemon_expression_compiler.dart'
show DaemonExpressionCompiler;
export 'src/services/expression_compiler.dart'
show
CompilerOptions,
Expand Down
45 changes: 31 additions & 14 deletions dwds/lib/src/debugging/location.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import 'package:dwds/src/debugging/metadata/provider.dart';
import 'package:dwds/src/debugging/modules.dart';
import 'package:dwds/src/readers/asset_reader.dart';
import 'package:dwds/src/utilities/dart_uri.dart';
import 'package:dwds/src/utilities/web_path_translator.dart';
import 'package:logging/logging.dart';
import 'package:path/path.dart' as p;
import 'package:source_maps/parser.dart';
Expand Down Expand Up @@ -194,6 +195,8 @@ class Locations {
return _sourceToLocation[serverPath] ?? {};
}

Iterable<String> keys() => _sourceToLocation.keys;

/// Returns all [Location] data for a provided JS server path.
Future<Set<Location>> locationsForUrl(String url) async {
if (url.isEmpty) return {};
Expand Down Expand Up @@ -345,7 +348,13 @@ class Locations {
'/${stripLeadingSlashes(modulePath)}',
);

if (sourceMapContents == null) return result;
if (sourceMapContents == null) {
_logger.warning(
'Failed to load source map for module $module at path '
'$sourceMapPath',
);
return result;
}

final runtimeScriptId = await _modules.getRuntimeScriptIdForModule(
_entrypoint,
Expand Down Expand Up @@ -373,11 +382,9 @@ class Locations {
}
}
for (final location in result) {
final serverPath = location.dartLocation.uri.serverPath;
_sourceToLocation
.putIfAbsent(
location.dartLocation.uri.serverPath,
() => <Location>{},
)
.putIfAbsent(serverPath, () => <Location>{})
.add(location);
}
return _moduleToLocations[module] = result;
Expand All @@ -395,15 +402,25 @@ class Locations {
}) {
final index = entry.sourceUrlId;
if (index == null) return null;
// Source map URLS are relative to the script. They may have platform
// separators or they may use URL semantics. To be sure, we split and
// re-join them.
// This works on Windows because path treats both / and \ as separators.
// It will fail if the path has both separators in it.
final relativeSegments = p.split(sourceUrls[index]);
final path = p.url.normalize(
p.url.joinAll([scriptLocation, ...relativeSegments]),
);
final sourceUrl = sourceUrls[index];
String path;
if (Uri.tryParse(sourceUrl)?.isAbsolute == true) {
path = sourceUrl;
} else {
// TODO(markzipan): Check if platform-specific separators can be handled
// upstream in the SDK.
// Source map URLS are relative to the script. They may have platform
// separators or they may use URL semantics. To be sure, we split and
// re-join them.
// This works on Windows because path treats both / and \ as separators.
// It will fail if the path has both separators in it.
final relativeSegments = p.split(sourceUrl);
path = p.url.normalize(
p.url.joinAll([scriptLocation, ...relativeSegments]),
);

path = WebPathTranslator.reconstructAppScheme(path, scriptLocation);
}

try {
final dartUri = DartUri(path, _root);
Expand Down
38 changes: 19 additions & 19 deletions dwds/lib/src/debugging/metadata/provider.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) 2020, 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.

import 'dart:convert';

import 'package:async/async.dart';
Expand All @@ -13,7 +12,6 @@ import 'package:path/path.dart' as p;
/// A provider of metadata in which data is collected through DDC outputs.
class MetadataProvider {
final AssetReader _assetReader;
final _logger = Logger('MetadataProvider');
final String entrypoint;
final Set<String> _libraries = {};
final Map<String, String> _scriptToModule = {};
Expand Down Expand Up @@ -165,13 +163,15 @@ class MetadataProvider {
/// return a map from module names to their [ModuleMetadata].
Future<Map<String, ModuleMetadata>> _processMetadata() async {
final modules = <String, ModuleMetadata>{};
// The merged metadata resides next to the entrypoint.
// Assume that <name>.bootstrap.js has <name>.ddc_merged_metadata
if (entrypoint.endsWith('.bootstrap.js')) {
_logger.info('Loading debug metadata...');
final logger = Logger('MetadataProvider');
final assetScheme = _assetReader.assetScheme;
final bootstrapSuffix = assetScheme.bootstrapSuffix;

if (entrypoint.endsWith(bootstrapSuffix)) {
logger.info('Loading debug metadata...');
final serverPath = entrypoint.replaceAll(
'.bootstrap.js',
'.ddc_merged_metadata',
bootstrapSuffix,
assetScheme.mergedMetadataSuffix,
);
final merged = await _assetReader.metadataContents(serverPath);
if (merged != null) {
Expand All @@ -187,10 +187,9 @@ class MetadataProvider {
);
final moduleName = metadata.name;
modules[moduleName] = metadata;
_logger.fine('Loaded debug metadata for module: $moduleName');
logger.fine('Loaded debug metadata for module: $moduleName');
} catch (e) {
_logger.warning('Failed to read metadata: $e');
rethrow;
logger.warning('Failed to parse metadata: $e');
}
}
}
Expand Down Expand Up @@ -274,18 +273,19 @@ class MetadataProvider {

final moduleLibraries = <String>{};
for (final library in metadata.libraries.values) {
if (library.importUri.startsWith('file:/')) {
throw AbsoluteImportUriException(library.importUri);
final importUri = library.importUri;
if (importUri.startsWith('file:/')) {
throw AbsoluteImportUriException(importUri);
}
moduleLibraries.add(library.importUri);
_libraries.add(library.importUri);
_scripts[library.importUri] = [];
moduleLibraries.add(importUri);
_libraries.add(importUri);
_scripts[importUri] = [];

_scriptToModule[library.importUri] = moduleName;
_scriptToModule[importUri] = moduleName;
for (final path in library.partUris) {
// Parts in metadata are relative to the library Uri directory.
final partPath = p.url.join(p.dirname(library.importUri), path);
_scripts[library.importUri]!.add(partPath);
final partPath = p.url.join(p.url.dirname(importUri), path);
_scripts[importUri]!.add(partPath);
_scriptToModule[partPath] = moduleName;
}
}
Expand Down
Loading