Skip to content

Refactor Dart Debug Extension to add shared files for Chrome API and Web API wrappers #1729

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 12 commits into from
Aug 24, 2022

Conversation

elliette
Copy link
Contributor

  • Pulls Chrome API and Web API wrappers out of background.dart and into chrome_api.dart and web_api.dart (this way they can be used by both the service worker and IFRAME script for MV3 migration)
  • Follows suggestion in Error compiling Dart Debug Extension with DDC sdk#49617 (comment) so that the Dart interface looks the same as the JS (eg, chrome.debugger.onEvent.addListener)

@elliette elliette requested a review from grouma August 23, 2022 17:49
@@ -5,6 +5,7 @@
import 'package:js/js.dart';

@JS()
// ignore: non_constant_identifier_names
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this newly necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've re-factored the JS wrappers to match the native JS APIs (in this case, JSON.stringify). Because the JS class name is all-caps, we need to add the ignore comment.

(Before we weren't matching the JS APIs, so this was simply called stringify).

@@ -298,13 +303,14 @@ void _maybeMarkTabAsDebuggable(
void _maybeAttachDebugSession(
Debuggee source,
String method,
Object params,
dynamic params,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I think I changed to dynamic so it would be nullable. Switched to Object? instead

@elliette elliette merged commit 605b981 into dart-lang:master Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants