Skip to content

Commit 652e040

Browse files
authored
Provide an app entrypoint to DWDS (#2047)
1 parent 0afc9eb commit 652e040

15 files changed

+452
-253
lines changed

dwds/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
## 18.0.3-dev
1+
## 19.0.0-dev
2+
- Allow clients to specify the connected app's entrypoint file. - [#2047](https://github.com/dart-lang/webdev/pull/2047)
23

34
## 18.0.2
45

dwds/lib/src/debugging/libraries.dart

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,15 @@ class LibraryHelper extends Domain {
3232
// TODO: read entrypoint from app metadata.
3333
// Issue: https://github.com/dart-lang/webdev/issues/1290
3434
final libraries = await libraryRefs;
35-
_rootLib = libraries
36-
.firstWhereOrNull((lib) => lib.name?.contains('org-dartlang') ?? false);
35+
if (globalLoadStrategy.appEntrypoint != null) {
36+
_rootLib = libraries.firstWhereOrNull(
37+
(lib) => Uri.parse(lib.uri ?? '') == globalLoadStrategy.appEntrypoint,
38+
);
39+
}
40+
_rootLib = _rootLib ??
41+
libraries.firstWhereOrNull(
42+
(lib) => lib.name?.contains('org-dartlang') ?? false,
43+
);
3744
_rootLib = _rootLib ??
3845
libraries
3946
.firstWhereOrNull((lib) => lib.name?.contains('main') ?? false);

0 commit comments

Comments
 (0)