Skip to content

Commit

Permalink
Prep devtools_app_shared and devtools_extensions for release (#8224)
Browse files Browse the repository at this point in the history
  • Loading branch information
kenzieschmoll authored Aug 21, 2024
1 parent 0c63f82 commit ba9f12d
Show file tree
Hide file tree
Showing 37 changed files with 76 additions and 65 deletions.
2 changes: 1 addition & 1 deletion flutter-candidate.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
92ac5653386e88931e680c1d62034fe6a4cf7fff
b74fa8afc7e2365f96098e6ff0fb150beb22682a
Original file line number Diff line number Diff line change
Expand Up @@ -561,16 +561,6 @@ enum FunctionKind {
}
}

extension CodeRefPrivateViewExtension on CodeRef {
static const _functionKey = 'function';

/// Returns the function from which this code object was generated.
FuncRef? get function {
final functionJson = json![_functionKey] as Map<String, dynamic>?;
return FuncRef.parse(functionJson);
}
}

/// An extension on [Code] which allows for access to VM internal fields.
extension CodePrivateViewExtension on Code {
static const _disassemblyKey = '_disassembly';
Expand Down
2 changes: 1 addition & 1 deletion packages/devtools_app/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ dependencies:
stream_channel: ^2.1.1
string_scanner: ^1.1.0
unified_analytics: ^6.1.0
vm_service: ^14.2.1
vm_service: ^14.2.5
vm_service_protos: ^1.0.0
vm_snapshot_analysis: ^0.7.6
web: ^1.0.0
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ void main() {
id: 'code-obj',
kind: 'Dart',
name: 'testFuncCode',
function: testFunction,
);

final offset = pow(2, 20) as int;
const addressCount = 1000;
testCode.json = {
'function': testFunction.toJson(),
'_objectPool': {
'id': 'pool-id',
'length': 0,
Expand Down
5 changes: 5 additions & 0 deletions packages/devtools_app_shared/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.2.3
* Bump `web` dependency to `^1.0.0`
* Bump `pointer_interceptor` dependency to `^0.10.1+1`
* Add better error handling in `ServiceExtensionManager`.

## 0.2.2
* Lookup the connected app package root from an expression evaluation when
the connected app is a Dart or Flutter test.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,19 +208,27 @@ final class ServiceExtensionManager with DisposerMixin {
}
_checkForFirstFrameStarted = true;

final value = await _service!.callServiceExtension(
extensions.didSendFirstFrameEvent,
isolateId: lastMainIsolate.id,
);
if (lastMainIsolate != _isolateManager.mainIsolate.value) {
// The active isolate has changed since we started querying the first
// frame.
return;
}
final didSendFirstFrameEvent = value.json!['enabled'] == 'true';
try {
final value = await _service!.callServiceExtension(
extensions.didSendFirstFrameEvent,
isolateId: lastMainIsolate.id,
);
if (lastMainIsolate != _isolateManager.mainIsolate.value) {
// The active isolate has changed since we started querying the first
// frame.
return;
}
final didSendFirstFrameEvent = value.json!['enabled'] == 'true';

if (didSendFirstFrameEvent) {
await _onFrameEventReceived();
if (didSendFirstFrameEvent) {
await _onFrameEventReceived();
}
} on RPCError catch (e) {
if (e.code == RPCErrorKind.kServerError.code) {
// Connection disappeared
return;
}
rethrow;
}
}

Expand Down Expand Up @@ -362,41 +370,49 @@ final class ServiceExtensionManager with DisposerMixin {
if (_isolateManager.mainIsolate.value != mainIsolate) return;

assert(value != null);
if (value is bool) {
Future<void> call(String? isolateId, bool value) async {
try {
if (value is bool) {
Future<void> call(String? isolateId, bool value) async {
await _service!.callServiceExtension(
name,
isolateId: isolateId,
args: {'enabled': value},
);
}

final description = extensions.serviceExtensionsAllowlist[name];
if (description?.shouldCallOnAllIsolates ?? false) {
// TODO(jacobr): be more robust instead of just assuming that if the
// service extension is available on one isolate it is available on
// all. For example, some isolates may still be initializing so may
// not expose the service extension yet.
await _service!.forEachIsolate((isolate) async {
await call(isolate.id, value);
});
} else {
await call(mainIsolate?.id, value);
}
} else if (value is String) {
await _service!.callServiceExtension(
name,
isolateId: isolateId,
args: {'enabled': value},
isolateId: mainIsolate?.id,
args: {'value': value},
);
} else if (value is double) {
await _service!.callServiceExtension(
name,
isolateId: mainIsolate?.id!,
// The param name for a numeric service extension will be the last part
// of the extension name (ext.flutter.extensionName => extensionName).
args: {name.substring(name.lastIndexOf('.') + 1): value},
);
}

final description = extensions.serviceExtensionsAllowlist[name];
if (description?.shouldCallOnAllIsolates ?? false) {
// TODO(jacobr): be more robust instead of just assuming that if the
// service extension is available on one isolate it is available on
// all. For example, some isolates may still be initializing so may
// not expose the service extension yet.
await _service!.forEachIsolate((isolate) async {
await call(isolate.id, value);
});
} else {
await call(mainIsolate?.id, value);
} on RPCError catch (e) {
if (e.code == RPCErrorKind.kServerError.code) {
// Connection disappeared
return;
}
} else if (value is String) {
await _service!.callServiceExtension(
name,
isolateId: mainIsolate?.id,
args: {'value': value},
);
} else if (value is double) {
await _service!.callServiceExtension(
name,
isolateId: mainIsolate?.id!,
// The param name for a numeric service extension will be the last part
// of the extension name (ext.flutter.extensionName => extensionName).
args: {name.substring(name.lastIndexOf('.') + 1): value},
);
rethrow;
}
}

Expand Down
4 changes: 2 additions & 2 deletions packages/devtools_app_shared/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: devtools_app_shared
description: Package of Dart & Flutter structures shared between devtools_app and devtools extensions.
version: 0.2.2
version: 0.2.3
repository: https://github.com/flutter/devtools/tree/master/packages/devtools_app_shared

environment:
Expand All @@ -10,7 +10,7 @@ environment:
dependencies:
collection: ^1.15.0
dds_service_extensions: ^2.0.0
devtools_shared: ^10.0.1
devtools_shared: ^10.0.2
dtd: ^2.1.0
flutter:
sdk: flutter
Expand Down
3 changes: 2 additions & 1 deletion packages/devtools_extensions/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
## 0.3.0-wip
## 0.3.0-dev.0
* Add `ExtensionManager.copyToClipboard` method.
* Add `DevToolsExtensionEventType.copyToClipboard` enum type.
* Add `CopyToClipboardExtensionEvent` extension event type.
* Bump `web` dependency to `^1.0.0`.

## 0.2.2
* Load the IDE Theme from the extension URL instead of creating
Expand Down
2 changes: 1 addition & 1 deletion packages/devtools_extensions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ Now it is time to build your extension.

From the directory where you want your extension source code to live, run the following
command, replacing `some_pkg_devtools_extension` with
`<your_package_name>_devtools_extension``:
`<your_package_name>_devtools_extension`:
```console
flutter create --template app --platforms web some_pkg_devtools_extension
```
Expand Down
11 changes: 5 additions & 6 deletions packages/devtools_extensions/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
name: devtools_extensions
description: A package for building and supporting extensions for Dart DevTools.
version: 0.3.0-wip
version: 0.3.0-dev.0

repository: https://github.com/flutter/devtools/tree/master/packages/devtools_extensions

environment:
# TODO(kenz): bump min SDK versions to next beta.
sdk: ">=3.4.3 <4.0.0"
flutter: ">=3.22.2"
sdk: ">=3.6.0-149.3.beta <4.0.0"
flutter: ">=3.25.0-0.1.pre"

executables:
devtools_extensions: devtools_extensions

dependencies:
args: ^2.4.2
devtools_shared: ^10.0.1
devtools_app_shared: ^0.2.2
devtools_shared: ^10.0.2
devtools_app_shared: ^0.2.3
flutter:
sdk: flutter
io: ^1.0.4
Expand Down

0 comments on commit ba9f12d

Please sign in to comment.