Skip to content

Added support for getModuleLibraries with the DDC library bundle format #2581

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 42 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
7caa652
Added support for getClassMetadata with the DDc library bundle format
jyameo Dec 5, 2024
5f29674
Merge branch 'main' into yj-dartdevembedder-3
jyameo Dec 10, 2024
17a9775
Merge branch 'main' into yj-dartdevembedder-3
jyameo Dec 12, 2024
f3b2bd7
Added support for some debugging APIs with the DDC library bundle for…
jyameo Dec 12, 2024
a1f017c
Update pattern test to account for new DDC JS variable naming
jyameo Dec 13, 2024
58b8762
reverting change to pattern test
jyameo Dec 13, 2024
c781e5f
Added support for debugging API with the DDC library bundle format.
jyameo Dec 13, 2024
8a9006a
Merge branch 'main' into yj-dartdevembedder-4
jyameo Dec 17, 2024
0b235e6
updated licenses
jyameo Dec 17, 2024
607c7e4
updated licenses and remove new line from changelog
jyameo Dec 17, 2024
067ab27
Merge branch 'main' into yj-dartdevembedder-5
jyameo Dec 18, 2024
b9a8c2f
Added support for some debugging APIs with the DDC library bundle for…
jyameo Dec 18, 2024
b220536
Merge branch 'main' into yj-dartdevembedder-5
jyameo Dec 23, 2024
75f57a9
Merge branch 'main' into yj-dartdevembedder-5
jyameo Dec 23, 2024
3401d30
Merge branch 'main' into yj-dartdevembedder-5
jyameo Dec 23, 2024
1e44766
Added support for some debugging APIs with the DDC library bundle format
jyameo Jan 9, 2025
62c3cea
Merge branch 'main' into yj-dartdevembedder-6
jyameo Jan 9, 2025
c537b7b
updated CHANGELOG
jyameo Jan 9, 2025
0e35c5e
refactored test to use common file
jyameo Jan 10, 2025
344867d
delete main_ddc_library_bundle.dart
jyameo Jan 10, 2025
22cdf34
Merge branch 'main' into yj-dartdevembedder-6
jyameo Jan 10, 2025
db9abfb
fixed broken test - decoded response body to match source and renamed…
jyameo Jan 15, 2025
c7b0632
Merge branch 'main' into yj-dartdevembedder-6
jyameo Jan 15, 2025
1bc9d5c
updated changelog
jyameo Jan 15, 2025
32c12a5
updated dart_scope to not renamed wildcard and skipped related test case
jyameo Jan 16, 2025
aa38d3a
formatted test/common/chrome_proxy_service_common.dart
jyameo Jan 16, 2025
a551cb5
WIP
jyameo Jan 20, 2025
e35ac5e
WIP
jyameo Jan 20, 2025
e81fa22
Added support for callLibraryMethod with the DDC library bundle format.
jyameo Jan 22, 2025
72d198a
updated DCM
jyameo Jan 22, 2025
951e72b
revert changes to callFunction
jyameo Jan 22, 2025
498184a
updated function name and comments
jyameo Jan 23, 2025
81b9915
Merge branch 'yj-dev-2566' into yj-2573
jyameo Jan 23, 2025
81624f9
Added support for some debugging APIs with the DDC library bundle for…
jyameo Jan 24, 2025
aa1dd4c
Merge branch 'main' into yj-2573
jyameo Jan 24, 2025
6be2d0a
reorder parameters
jyameo Jan 24, 2025
090e73f
made arguments parameter optional
jyameo Jan 24, 2025
39b8b83
updated comment
jyameo Jan 24, 2025
6ad5438
removed comments from test/instances/instance_amd_test.dart
jyameo Jan 24, 2025
bd8a5d9
removed duplicate import
jyameo Jan 24, 2025
b082d6a
removed unecessary methods and branching
jyameo Jan 28, 2025
b36dda7
formatted lib/src/debugging/inspector.dart
jyameo Jan 28, 2025
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
2 changes: 1 addition & 1 deletion dwds/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## 24.3.4-wip
- Added support for some debugging APIs with the DDC library bundle format. - [#2566](https://github.com/dart-lang/webdev/issues/2566)
- Added support for some debugging APIs with the DDC library bundle format. - [#2566](https://github.com/dart-lang/webdev/issues/2566), [#2573](https://github.com/dart-lang/webdev/issues/2573)

## 24.3.3

Expand Down
40 changes: 18 additions & 22 deletions dwds/lib/src/debugging/inspector.dart
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,9 @@ class AppInspector implements AppInspectorInterface {
@override
Future<RemoteObject> invoke(
String targetId,
String selector,
List<dynamic> arguments,
) async {
String selector, [
List<dynamic> arguments = const [],
]) async {
final remoteArguments =
arguments.cast<String>().map(remoteObjectFor).toList();
// We special case the Dart library, where invokeMethod won't work because
Expand All @@ -302,14 +302,18 @@ class AppInspector implements AppInspectorInterface {
String selector,
List<RemoteObject> arguments,
) {
final libraryUri = library.uri;
if (libraryUri == null) {
throwInvalidParam('invoke', 'library uri is null');
}
return globalToolConfiguration.loadStrategy is DdcLibraryBundleStrategy
? _evaluateLibraryMethodWithDdcLibraryBundle(
library,
libraryUri,
selector,
arguments,
)
: _evaluateInLibrary(
library,
libraryUri,
'function () { return this.$selector.apply(this, arguments); }',
arguments,
);
Expand Down Expand Up @@ -337,16 +341,12 @@ class AppInspector implements AppInspectorInterface {
}

/// Evaluate the JS function with source [jsFunction] in the context of
/// [library] with [arguments].
/// the library identified by [libraryUri] with [arguments].
Future<RemoteObject> _evaluateInLibrary(
Library library,
String libraryUri,
String jsFunction,
List<RemoteObject> arguments,
) async {
final libraryUri = library.uri;
if (libraryUri == null) {
throwInvalidParam('invoke', 'library uri is null');
}
final findLibraryJsExpression = globalToolConfiguration
.loadStrategy.dartRuntimeDebugger
.callLibraryMethodJsExpression(libraryUri, jsFunction);
Expand All @@ -355,18 +355,14 @@ class AppInspector implements AppInspectorInterface {
return jsCallFunctionOn(remoteLibrary, jsFunction, arguments);
}

/// Evaluates the specified top-level method [methodName] within [library]
/// using the Dart Development Compiler (DDC) library bundle strategy with
/// the given [arguments].
/// Evaluates the specified top-level method [methodName] within the library
/// identified by [libraryUri] using the Dart Development Compiler (DDC)
/// library bundle strategy with the given optional [arguments].
Future<RemoteObject> _evaluateLibraryMethodWithDdcLibraryBundle(
Library library,
String methodName,
List<RemoteObject> arguments,
) {
final libraryUri = library.uri;
if (libraryUri == null) {
throwInvalidParam('invoke', 'library uri is null');
}
String libraryUri,
String methodName, [
List<RemoteObject> arguments = const [],
]) {
final expression = globalToolConfiguration.loadStrategy.dartRuntimeDebugger
.callLibraryMethodJsExpression(libraryUri, methodName);
return _jsCallFunction(expression, arguments);
Expand Down
Loading
Loading