Skip to content
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

Initial commit for package:devtools_extensions #6055

Merged

Conversation

kenzieschmoll
Copy link
Member

This PR adds the devtools_extensions package to devtools/packages/. The initial commit for this package includes some shared data models that will be used by both DevTools and extension authors.

work towards #1632.

@kenzieschmoll kenzieschmoll requested a review from a team as a code owner July 18, 2023 23:02
@kenzieschmoll kenzieschmoll requested review from bkonyi and polina-c and removed request for a team July 18, 2023 23:02
packages/devtools_extensions/lib/src/api.dart Show resolved Hide resolved
static DevToolsExtensionEvent pong =
DevToolsExtensionEvent(DevToolsExtensionEventType.pong);

final DevToolsExtensionEventType type;
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the point to differentiate types of extensions if they behave equally?

Copy link
Member Author

Choose a reason for hiding this comment

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

Each extension will share some underlying framework for integration with DevTools (connection to DevTools, connection to a VM service, etc.), but the functionality that each extension provides will be entirely dependent on the use case a package or extension author addresses.


/// Data model for a devtools extension event that will be sent and received
/// over 'postMessage' between DevTools and the embedded extension iFrame.
class DevToolsExtensionEvent {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you explain in doc comment why the events are needed, and how they are supposed to be used?

Copy link
Member Author

Choose a reason for hiding this comment

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

Added a reference to [DevToolsExtensionEventType]. This code is incomplete right now since we are starting with the ping, pong support, but in the future we will also support events like connectToVmService, maybe showNotification etc. When we support more events, the DevToolsExtensionEventType enum will be self documenting.

packages/devtools_extensions/lib/src/api.dart Show resolved Hide resolved
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this file need to be included?

Copy link
Member Author

Choose a reason for hiding this comment

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

we include the .iml file for the other packages devtools_app, devtools_shared, devtools_test, so following that pattern and including this one as well.


dependencies:
flutter:
sdk: flutter
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm assuming we plan on exposing widgets / ValueNotifiers through this package?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, this package will also include a template for extension authors to place at the root of their devtools extension app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants