Skip to content

Commit

Permalink
Provide an app entrypoint to DWDS (#2047)
Browse files Browse the repository at this point in the history
  • Loading branch information
elliette committed Mar 30, 2023
1 parent 0afc9eb commit 652e040
Show file tree
Hide file tree
Showing 15 changed files with 452 additions and 253 deletions.
3 changes: 2 additions & 1 deletion dwds/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## 18.0.3-dev
## 19.0.0-dev
- Allow clients to specify the connected app's entrypoint file. - [#2047](https://github.com/dart-lang/webdev/pull/2047)

## 18.0.2

Expand Down
11 changes: 9 additions & 2 deletions dwds/lib/src/debugging/libraries.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,15 @@ class LibraryHelper extends Domain {
// TODO: read entrypoint from app metadata.
// Issue: https://github.com/dart-lang/webdev/issues/1290
final libraries = await libraryRefs;
_rootLib = libraries
.firstWhereOrNull((lib) => lib.name?.contains('org-dartlang') ?? false);
if (globalLoadStrategy.appEntrypoint != null) {
_rootLib = libraries.firstWhereOrNull(
(lib) => Uri.parse(lib.uri ?? '') == globalLoadStrategy.appEntrypoint,
);
}
_rootLib = _rootLib ??
libraries.firstWhereOrNull(
(lib) => lib.name?.contains('org-dartlang') ?? false,
);
_rootLib = _rootLib ??
libraries
.firstWhereOrNull((lib) => lib.name?.contains('main') ?? false);
Expand Down
Loading

0 comments on commit 652e040

Please sign in to comment.