Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions dwds/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- Add DDC Library Bundle tests in `dwds/test/integration/instances`.
- Fix WebSocket reconnection hang by ensuring Dart isolate recreation when a new browser client reuses an `AppDebugServices`.
- Don't inject script loads from within DWDS when executing with build_runner + DDC Module Bundles.
- Add sourcemap logic fixes to DDC Library Bundle + build_runner execution scheme.

## 27.0.0
- Remove `package:built_value`, `package:built_value_generator`, and `package:built_collection` dependencies.
Expand Down
10 changes: 9 additions & 1 deletion dwds/lib/src/loaders/ddc_library_bundle.dart
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,15 @@ class DdcLibraryBundleStrategy extends LoadStrategy {
final modulePaths = await _moduleProvider(metadataProvider);
final scripts = <Map<String, String?>>[];
modulePaths.forEach((name, path) {
scripts.add(<String, String>{'src': '$path.js', 'id': name});
var id = name;
if (id.startsWith('package:')) {
id = id.replaceFirst('package:', 'packages/');
// Remove trailing '.dart' from script ids.
if (id.endsWith('.dart')) {
id = id.substring(0, id.length - '.dart'.length);
}
}
scripts.add(<String, String>{'src': '$path.js', 'id': id});
});
// Flutter always depends on the injected loader, but some canary-enabled
// Frontend Server implementations load scripts via a separate pathway.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,16 @@ void main() {
);
});

group(
'canary: $canaryFeatures | Build Daemon |',
() {
final compilationMode = CompilationMode.buildDaemon;
tearDownAll(provider.dispose);

runTests(
provider: provider,
moduleFormat: moduleFormat,
compilationMode: compilationMode,
canaryFeatures: canaryFeatures,
debug: debug,
);
},
skip: 'https://github.com/dart-lang/webdev/issues/2764',
);
group('canary: $canaryFeatures | Build Daemon |', () {
final compilationMode = CompilationMode.buildDaemon;
tearDownAll(provider.dispose);

runTests(
provider: provider,
moduleFormat: moduleFormat,
compilationMode: compilationMode,
canaryFeatures: canaryFeatures,
debug: debug,
);
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -784,12 +784,7 @@ void runTests({
final result = await http.get(
Uri.parse('http://localhost:${context.port}/$serverPath'),
);
// TODO: Figure out if we can encode the sript as utf8 and avoid this
final body =
(moduleFormat == ModuleFormat.ddc && canaryFeatures == true)
? utf8.decode(result.body.codeUnits)
: result.body;
expect(script.source, body);
expect(script.source, utf8.decode(result.bodyBytes));
expect(scriptRef.uri, endsWith('.dart'));
expect(script.tokenPosTable, isNotEmpty);
}
Expand Down
2 changes: 1 addition & 1 deletion frontend_server_common/lib/src/bootstrap.dart
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ $_simpleLoaderScript
if (url == 'dart_sdk.js') {
return dartDevEmbedder.debugger.getSourceMap('dart_sdk');
}
url = url.replace(".lib.js", "");
url = url.replace(".lib.js", "").replace(".ddc.js", "");
return dartDevEmbedder.debugger.getSourceMap(url);
});
}
Expand Down
Loading