Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
6db11cd
Adding tests for Build Daemon + Frontend Server backend
Markzipan Apr 20, 2026
0415fed
Adding dwds hooks for build runner + FES expression eval
Markzipan Apr 29, 2026
890f49b
Adding support for FES port communications
Markzipan May 5, 2026
2fb3a67
Support fes_manager in tests.
Markzipan May 7, 2026
e8a9d44
updating port file name
Markzipan May 14, 2026
c6efb3c
formatting
Markzipan May 14, 2026
ef4b320
adding local override
Markzipan May 14, 2026
f0086a1
updating tests
Markzipan May 15, 2026
82ad3a4
formatting
Markzipan May 15, 2026
6ace94c
Merging
Markzipan May 15, 2026
163b4b9
Fixing override
Markzipan May 15, 2026
8782282
updating test pubspec
Markzipan May 18, 2026
e74fc12
Updating test constraints
Markzipan May 19, 2026
dc58b2a
updating compilationMode checks
Markzipan May 19, 2026
1d84f5c
Add hot reload + restart support
Markzipan May 28, 2026
67f91bc
Fix DWDS test hangs by targeting specific web assets path
Markzipan Jun 12, 2026
67bbfea
Extending tests
Markzipan Jun 16, 2026
a3f687e
updating dwds test utilities
Markzipan Jun 16, 2026
85a056b
Adding DdcUriTranslator
Markzipan Jun 16, 2026
b0f17b6
Using DdcUriTranslator
Markzipan Jun 16, 2026
b41e58e
Add hotReloadResult vm service extension call
Markzipan Jun 16, 2026
cb923d6
fix expression eval in FES mode
Markzipan Jun 16, 2026
4358d38
Updating path resolution and FES-specific logic
Markzipan Jun 16, 2026
79b7fa2
Finalizing test fixture serving logic and adding cleanup
Markzipan Jun 16, 2026
b87fbce
Cleaning up unused or debug code
Markzipan Jun 16, 2026
0486e4d
Bumping build web compilers to 4.8.2
Markzipan Jun 16, 2026
292ca00
Reverting unused test code
Markzipan Jun 16, 2026
0967e59
Fixing fes_manager resolution
Markzipan Jun 16, 2026
d1a6baa
Update URI translation
Markzipan Jun 16, 2026
eb304ae
Updating versions
Markzipan Jun 17, 2026
b3991f2
Readding uri roots
Markzipan Jun 17, 2026
503cff9
Updating hot reload error signalling in tests
Markzipan Jun 17, 2026
2315796
Merge remote-tracking branch 'origin/main' into expression_eval_dwds
Markzipan Jun 17, 2026
5bec825
Updating uri tests
Markzipan Jun 18, 2026
5ab44e9
Add useDebuggerModuleNames support
Markzipan Jul 1, 2026
16c1e6f
Splitting more dwds tests between ddc module systems
Markzipan Jul 8, 2026
54db476
Merge remote-tracking branch 'origin/main' into expression_eval_dwds
Markzipan Jul 9, 2026
035c94b
formatting
Markzipan Jul 9, 2026
5669ced
Reading entrypoints from .web.entrypoint.json and cleaning up test sc…
Markzipan Jul 10, 2026
06cee25
Updating uri tests
Markzipan Jul 13, 2026
6ceb90c
bumping fixtures to dwds 4.8.7
Markzipan Jul 14, 2026
4ce2ee8
Merge remote-tracking branch 'origin/main' into expression_eval_dwds
Markzipan Jul 14, 2026
7ba2c1f
Fixing analysis issues
Markzipan Jul 14, 2026
10302f8
code cleanup + adding comments
Markzipan Jul 14, 2026
f074c92
Removing extraneous debug code
Markzipan Jul 14, 2026
56a50bd
Code cleanup
Markzipan Jul 14, 2026
b6e816f
Removing invalid tests and fixing timeouts
Markzipan Jul 14, 2026
0e0e083
Removing debug pubspec files
Markzipan Jul 15, 2026
df538ab
Passing AppUriLayout
Markzipan Jul 15, 2026
1174260
Updating expectations
Markzipan Jul 15, 2026
7ed1938
Deleting tests in the test workspace to ensure a single entrypoint
Markzipan Jul 15, 2026
fba1e52
Updating tls test expectations
Markzipan Jul 15, 2026
96d62da
formatting
Markzipan Jul 15, 2026
1aa966c
fixing analysis errors
Markzipan Jul 15, 2026
858e6f2
Updating versions
Markzipan Jul 16, 2026
6e66ca9
Updating injected client logic
Markzipan Jul 16, 2026
28afafa
Updating versions in fixtures
Markzipan Jul 17, 2026
47c54cf
Updating changelogs
Markzipan Jul 18, 2026
d87e0ea
Updating versions
Markzipan Jul 18, 2026
eb0883b
Updating uri modifiers to support windows style paths
Markzipan Jul 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
5 changes: 5 additions & 0 deletions dwds/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 27.2.0

- Add support for Frontend Server + Build Daemon configuration with hot reload via `FrontendServerBuildDaemonStrategyProvider`.
- Expose `DaemonExpressionCompiler` for handling expression compile directly via `build_daemon`.

## 27.1.2

- Bump the min sdk to 3.13.0-107.0.dev.
Expand Down
3 changes: 3 additions & 0 deletions dwds/lib/dwds.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export 'src/loaders/build_runner_strategy_provider.dart'
export 'src/loaders/ddc.dart' show DdcStrategy;
export 'src/loaders/frontend_server_strategy_provider.dart'
show
FrontendServerBuildDaemonStrategyProvider,
FrontendServerDdcLibraryBundleStrategyProvider,
FrontendServerDdcStrategyProvider,
FrontendServerRequireStrategyProvider;
Expand All @@ -42,6 +43,8 @@ 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
62 changes: 48 additions & 14 deletions dwds/lib/src/debugging/location.dart
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,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 +347,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 +381,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 +401,43 @@ 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 {
// 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]),
);

// Frontend Server emits source maps paths relative relative to the
// generated JS. If this is for a 'package:build' source, it may be in
// `.dart_tool/build/generated`, and relative path resolution might
// traverse beyond the package directory. We detect this and reconstruct
// the correct `org-dartlang-app:///` URI.
//
// For example:
// scriptLocation: `/packages/my_package/subdir/main.ddc.js`
// relativePath in source map: `../../../lib/src/library.dart`
//
// Joined path:
// Before: `/lib/src/library.dart` (loses `my_package`)
// After: `org-dartlang-app:///packages/my_package/src/library.dart`
if (scriptLocation.startsWith('/packages/') &&
!path.startsWith('/packages/')) {
final packageDir = scriptLocation.split('/').take(3).join('/');
final relativePath = path.startsWith('/lib/')
? path.substring('/lib/'.length)
: path.substring('/'.length);
path = 'org-dartlang-app://$packageDir/$relativePath';
}
}

try {
final dartUri = DartUri(path, _root);
Expand Down
24 changes: 14 additions & 10 deletions dwds/lib/src/debugging/metadata/provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,10 @@ class MetadataProvider {
}

void _addMetadata(ModuleMetadata metadata) {
final modulePath = stripLeadingSlashes(metadata.moduleUri);
final sourceMapPath = stripLeadingSlashes(metadata.sourceMapUri);
final modulePath = stripLeadingSlashes(metadata.moduleUri)
.replaceAll('\\', '/');
final sourceMapPath = stripLeadingSlashes(metadata.sourceMapUri)
.replaceAll('\\', '/');
final moduleName = metadata.name;

_moduleToSourceMap[moduleName] = sourceMapPath;
Expand All @@ -274,18 +276,20 @@ 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.replaceAll('\\', '/');
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) {
final normalizedPath = path.replaceAll('\\', '/');
// 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), normalizedPath);
_scripts[importUri]!.add(partPath);
_scriptToModule[partPath] = moduleName;
}
}
Expand Down
Loading
Loading