Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 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
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
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
64 changes: 48 additions & 16 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,12 +381,8 @@ class Locations {
}
}
for (final location in result) {
_sourceToLocation
.putIfAbsent(
location.dartLocation.uri.serverPath,
() => <Location>{},
)
.add(location);
final sp = location.dartLocation.uri.serverPath;
_sourceToLocation.putIfAbsent(sp, () => <Location>{}).add(location);
}
return _moduleToLocations[module] = result;
});
Expand All @@ -395,15 +399,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 the package namespace `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
Loading
Loading