Skip to content

Commit bea508e

Browse files
authored
Merge branch 'master' into app_shared_pkg_web
2 parents 50c72a8 + 8efcaed commit bea508e

39 files changed

+521
-193
lines changed

.github/workflows/build.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ jobs:
5252
- build_dart2js
5353
- test_ddc
5454
- test_dart2js
55+
- benchmarks_dart2js
5556
steps:
5657
- name: git clone
5758
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac

.github/workflows/flutter-candidate-update.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on:
33
workflow_dispatch: # Allows for manual triggering if needed
44
schedule:
55
# * is a special character in YAML so you have to quote this string
6-
- cron: "0 8 * * *" # Run every day at midnight Pacific Time
6+
- cron: "0 8/12 * * *" # Run every day at midnight and noon Pacific Time
77

88
permissions:
99
contents: write

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ of launch configurations for running and debugging DevTools:
8484

8585
### Workflow for making changes
8686

87-
1. Change your local Flutter SDK to the latest flutter candidate branch: `./tool/update_flutter_sdk.sh --local`
87+
1. Change your local Flutter SDK to the latest flutter candidate branch: `devtools_tool update-flutter-sdk --local`
8888
2. Create a branch from your cloned DevTools repo: `git checkout -b myBranch`
8989
3. Ensure your branch, dependencies, and generated code are up-to-date: `devtools_tool sync`
9090
4. Implement your changes, and commit to your branch: `git commit -m “description”`

case_study/memory_leaks/memory_leak_app/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ dependencies:
1111
dev_dependencies:
1212
flutter_test:
1313
sdk: flutter
14-
intl: '>=0.16.1 <0.19.0'
14+
intl: ^0.18.0
1515
http: ^0.13.5
1616

1717
# For information on the generic Dart part of this file, see the

flutter-candidate.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.16.0-16.0.pre
1+
3.16.0-17.0.pre

packages/devtools_app/lib/devtools_app.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ export 'src/service/json_to_service_cache.dart';
5757
export 'src/service/resolved_uri_manager.dart';
5858
export 'src/service/service_extensions.dart';
5959
export 'src/service/service_manager.dart';
60+
export 'src/service/service_registrations.dart';
6061
export 'src/service/timeline_streams.dart';
6162
export 'src/service/vm_flags.dart';
6263
export 'src/service/vm_service_wrapper.dart';

packages/devtools_app/lib/src/screens/performance/panes/frame_analysis/frame_hints.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,10 +370,10 @@ class ShaderCompilationHint extends StatelessWidget {
370370
LinkTextSpan(
371371
link: Link(
372372
display: 'Impeller',
373-
url: impellerWikiUrl,
373+
url: impellerDocsUrl,
374374
gaScreenName: gac.performance,
375375
gaSelectedItemDescription:
376-
gac.PerformanceDocs.impellerWikiLink.name,
376+
gac.PerformanceDocs.impellerDocsLink.name,
377377
),
378378
context: context,
379379
),

packages/devtools_app/lib/src/screens/performance/panes/raster_stats/raster_stats.dart

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,48 @@ import '../../../../shared/globals.dart';
1414
import '../../../../shared/primitives/utils.dart';
1515
import '../../../../shared/table/table.dart';
1616
import '../../../../shared/table/table_data.dart';
17+
import '../../performance_utils.dart';
1718
import 'raster_stats_controller.dart';
1819
import 'raster_stats_model.dart';
1920

2021
class RasterStatsView extends StatelessWidget {
2122
const RasterStatsView({
2223
super.key,
2324
required this.rasterStatsController,
25+
required this.impellerEnabled,
2426
});
2527

2628
final RasterStatsController rasterStatsController;
2729

30+
final bool impellerEnabled;
31+
2832
@override
2933
Widget build(BuildContext context) {
34+
if (impellerEnabled) {
35+
return Center(
36+
child: RichText(
37+
textAlign: TextAlign.center,
38+
text: TextSpan(
39+
text: 'The Raster Stats tool is not currently available for the '
40+
'Impeller backend.\nLearn more about the status of ',
41+
style: Theme.of(context).regularTextStyle,
42+
children: [
43+
LinkTextSpan(
44+
link: Link(
45+
display: 'Impeller',
46+
url: impellerDocsUrl,
47+
gaScreenName: gac.performance,
48+
gaSelectedItemDescription:
49+
gac.PerformanceDocs.impellerDocsLinkFromRasterStats.name,
50+
),
51+
context: context,
52+
),
53+
const TextSpan(text: '.'),
54+
],
55+
),
56+
),
57+
);
58+
}
3059
return Column(
3160
children: [
3261
if (!offlineController.offlineMode.value)

packages/devtools_app/lib/src/screens/performance/panes/raster_stats/raster_stats_controller.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ class RasterStatsController extends PerformanceFeatureController {
4141
setData(rasterStats);
4242
} catch (e, st) {
4343
_log.shout('Error collecting raster stats: $e', e, st);
44+
notificationService.pushError(
45+
'Error collecting raster stats: $e',
46+
stackTrace: st.toString(),
47+
);
4448
clearData();
4549
} finally {
4650
_loadingSnapshot.value = false;

packages/devtools_app/lib/src/screens/performance/performance_controller.dart

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import 'dart:async';
77
import 'package:devtools_app_shared/utils.dart';
88
import 'package:vm_service/vm_service.dart';
99

10+
import '../../service/service_registrations.dart' as registrations;
1011
import '../../shared/diagnostics/inspector_service.dart';
1112
import '../../shared/feature_flags.dart';
1213
import '../../shared/globals.dart';
@@ -98,6 +99,9 @@ class PerformanceController extends DisposableController
9899
/// in selected timeline event, selected frame, etc.).
99100
PerformanceData? offlinePerformanceData;
100101

102+
bool get impellerEnabled => _impellerEnabled;
103+
late final bool _impellerEnabled;
104+
101105
final _initialized = Completer<void>();
102106

103107
Future<void> get initialized => _initialized.future;
@@ -115,6 +119,17 @@ class PerformanceController extends DisposableController
115119
if (!offlineController.offlineMode.value) {
116120
await serviceConnection.serviceManager.onServiceAvailable;
117121

122+
if (serviceConnection.serviceManager.connectedApp?.isFlutterAppNow ??
123+
false) {
124+
final impellerEnabledResponse = await serviceConnection.serviceManager
125+
.callServiceExtensionOnMainIsolate(
126+
registrations.isImpellerEnabled,
127+
);
128+
_impellerEnabled = impellerEnabledResponse.json?['enabled'] == true;
129+
} else {
130+
_impellerEnabled = false;
131+
}
132+
118133
enhanceTracingController.init();
119134

120135
// Listen for Flutter.Frame events with frame timing data.

packages/devtools_app/lib/src/screens/performance/performance_utils.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ void debugTraceEventCallback(VoidCallback callback) {
8787

8888
const preCompileShadersDocsUrl = 'https://docs.flutter.dev/perf/shader';
8989

90-
const impellerWikiUrl = 'https://github.com/flutter/flutter/wiki/Impeller';
90+
const impellerDocsUrl = 'https://docs.flutter.dev/perf/impeller';
9191

9292
extension TraceEventExtension on TraceEvent {
9393
bool get isThreadNameEvent =>

packages/devtools_app/lib/src/screens/performance/tabbed_performance_view.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ class _TabbedPerformanceViewState extends State<TabbedPerformanceView>
152152
child: Center(
153153
child: RasterStatsView(
154154
rasterStatsController: controller.rasterStatsController,
155+
impellerEnabled: controller.impellerEnabled,
155156
),
156157
),
157158
),

packages/devtools_app/lib/src/service/service_registrations.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,7 @@ const renderFrameWithRasterStats = '_flutter.renderFrameWithRasterStats';
5858

5959
/// Dwds listens to events for recording end-to-end analytics.
6060
const dwdsSendEvent = 'ext.dwds.sendEvent';
61+
62+
/// Service extension that returns whether or not the Impeller rendering engine
63+
/// is being used (if false, the app is using SKIA).
64+
const isImpellerEnabled = 'ext.ui.window.impellerEnabled';

packages/devtools_app/lib/src/shared/analytics/_analytics_web.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@ library gtags;
88
// ignore_for_file: non_constant_identifier_names
99

1010
import 'dart:async';
11-
// ignore: avoid_web_libraries_in_flutter, by design
12-
import 'dart:html';
1311

1412
import 'package:devtools_app_shared/ui.dart';
1513
import 'package:js/js.dart';
1614
import 'package:logging/logging.dart';
15+
import 'package:web/helpers.dart';
1716

1817
import '../../../devtools.dart' as devtools show version;
1918
import '../config_specific/server/server.dart' as server;
@@ -802,7 +801,7 @@ Future<bool> disableAnalytics() async {
802801
/// devtoolsChrome.
803802
void computeDevToolsCustomGTagsData() {
804803
// Platform
805-
final String platform = window.navigator.platform!;
804+
final String platform = window.navigator.platform;
806805
platform.replaceAll(' ', '_');
807806
devtoolsPlatformType = platform;
808807

packages/devtools_app/lib/src/shared/analytics/constants/_performance_constants.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ enum PerformanceDocs {
5050
intrinsicOperationsDocs,
5151
shaderCompilationDocs,
5252
shaderCompilationDocsTooltipLink,
53-
impellerWikiLink,
53+
impellerDocsLink,
54+
impellerDocsLinkFromRasterStats,
5455
platformChannelsDocs,
5556
}

packages/devtools_app/lib/src/shared/banner_messages.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,10 +355,10 @@ class ShaderJankMessage {
355355
LinkTextSpan(
356356
link: Link(
357357
display: 'Impeller',
358-
url: impellerWikiUrl,
358+
url: impellerDocsUrl,
359359
gaScreenName: screenId,
360360
gaSelectedItemDescription:
361-
gac.PerformanceDocs.impellerWikiLink.name,
361+
gac.PerformanceDocs.impellerDocsLink.name,
362362
),
363363
context: context,
364364
style: theme.errorMessageLinkStyle,

packages/devtools_app/lib/src/shared/common_widgets.dart

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -976,10 +976,7 @@ class CenteredMessage extends StatelessWidget {
976976
@override
977977
Widget build(BuildContext context) {
978978
return Center(
979-
child: Text(
980-
message,
981-
style: Theme.of(context).textTheme.titleLarge,
982-
),
979+
child: Text(message),
983980
);
984981
}
985982
}

packages/devtools_app/lib/src/shared/memory/adapted_heap_data.dart

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
import 'dart:io';
6-
75
import 'package:flutter/foundation.dart';
86
import 'package:vm_service/vm_service.dart';
97

@@ -74,17 +72,6 @@ class AdaptedHeapData {
7472
return AdaptedHeapData(objects);
7573
}
7674

77-
@visibleForTesting
78-
static Future<AdaptedHeapData> fromFile(
79-
String fileName,
80-
) async {
81-
final file = File(fileName);
82-
final bytes = await file.readAsBytes();
83-
final data = bytes.buffer.asByteData();
84-
final graph = HeapSnapshotGraph.fromChunks([data]);
85-
return AdaptedHeapData.fromHeapSnapshot(graph);
86-
}
87-
8875
/// Default value for rootIndex is taken from the doc:
8976
/// https://github.com/dart-lang/sdk/blob/main/runtime/vm/service/heap_snapshot.md#object-ids
9077
static const int _defaultRootIndex = 1;

packages/devtools_app/pubspec.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ dependencies:
4343
sdk: flutter
4444
http: ^0.13.4
4545
image: ^3.0.2
46-
intl: ">=0.16.1 <=0.18.1"
46+
intl: ^0.18.0
4747
js: ^0.6.1+1
4848
json_rpc_2: ^3.0.2
4949
logging: ^1.1.1
@@ -65,6 +65,7 @@ dependencies:
6565
vm_service: ^12.0.0
6666
# TODO https://github.com/dart-lang/sdk/issues/52853 - unpin this version
6767
vm_snapshot_analysis: 0.7.2
68+
web: ^0.3.0
6869
web_socket_channel: ^2.1.0
6970
# widget_icons: ^0.0.1
7071

@@ -81,8 +82,9 @@ dev_dependencies:
8182
integration_test:
8283
sdk: flutter
8384
mockito: ^5.4.1
84-
webkit_inspection_protocol: ">=0.5.0 <2.0.0"
8585
stager: ^1.0.1
86+
test: ^1.21.1
87+
webkit_inspection_protocol: ">=0.5.0 <2.0.0"
8688

8789
flutter:
8890
uses-material-design: true

packages/devtools_app/release_notes/NEXT_RELEASE_NOTES.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ video provides a brief tutorial for each DevTools screen.
1919

2020
* Fix a bug with service extension states not being cleared on app disconnect.
2121
[#6547](https://github.com/flutter/devtools/pull/6547)
22-
- Improved styling of bottom status bar when connected to an app. [#6525](https://github.com/flutter/devtools/pull/6525)
22+
* Improved styling of bottom status bar when connected to an app. [#6525](https://github.com/flutter/devtools/pull/6525)
2323

2424
## Inspector updates
2525

@@ -28,7 +28,7 @@ TODO: Remove this section if there are not any general updates.
2828
## Performance updates
2929

3030
* Added an option in the "Enhance Tracing" menu for tracking platform channel
31-
activity. This is useful for apps with plugins.
31+
activity. This is useful for apps with plugins. [#6515](https://github.com/flutter/devtools/pull/6515)
3232

3333
![Track platform channels setting](images/track_platform_channels.png "Track platform channels setting")
3434

@@ -37,6 +37,10 @@ previously saved from DevTools can be reloaded for viewing from this screen. [#6
3737
* Added an "Open" button to the Performance controls for loading data that was previously saved
3838
from DevTools. [#6567](https://github.com/flutter/devtools/pull/6567)
3939

40+
![Open file button on the performance screen](images/open_file_performance_screen.png "Open file button on the performance screen")
41+
42+
* Disable the Raster Stats tool for the Impeller backend since it is not supported. [#6616](https://github.com/flutter/devtools/pull/6616)
43+
4044
## CPU profiler updates
4145

4246
* Tree guidelines are now always enabled for the "Bottom Up" and "Call Tree" tabs. [#6534](https://github.com/flutter/devtools/pull/6534)
@@ -55,7 +59,7 @@ TODO: Remove this section if there are not any general updates.
5559

5660
## Network profiler updates
5761

58-
* Network statuses now show with an error color when the request failed [#6527](https://github.com/flutter/devtools/pull/6527)
62+
* Network statuses now show with an error color when the request failed. [#6527](https://github.com/flutter/devtools/pull/6527)
5963

6064
## Logging updates
6165

@@ -68,7 +72,7 @@ TODO: Remove this section if there are not any general updates.
6872
## VS Code Sidebar updates
6973

7074
* When using VS Code with a light theme, the embedded sidebar provided by DevTools will now also show in the light
71-
theme [#6581](https://github.com/flutter/devtools/pull/6581)
75+
theme. [#6581](https://github.com/flutter/devtools/pull/6581)
7276

7377
## Full commit history
7478

Loading

packages/devtools_app/test/app_size/app_size_screen_test.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ void main() {
248248
expect(find.byType(AnalysisView), findsOneWidget);
249249
expect(
250250
find.text(
251-
'Dart AOT snapshot: lib/src/app_size/stub_data/new_v8.dart - 7/28/2020 1:29 PM',
251+
'Dart AOT snapshot: lib/src/app_size/stub_data/new_v8.dart - 7/28/2020 1:29PM',
252252
),
253253
findsOneWidget,
254254
);
@@ -359,9 +359,10 @@ void main() {
359359
expect(find.text('No File Selected'), findsNothing);
360360

361361
expect(find.byType(DiffView), findsOneWidget);
362+
362363
expect(
363364
find.text(
364-
'Diffing Dart AOT snapshots: lib/src/app_size/stub_data/old_v8.dart - 7/28/2020 1:29 PM (OLD) vs (NEW) lib/src/app_size/stub_data/new_v8.dart - 7/28/2020 1:29 PM',
365+
'Diffing Dart AOT snapshots: lib/src/app_size/stub_data/old_v8.dart - 7/28/2020 1:29PM (OLD) vs (NEW) lib/src/app_size/stub_data/new_v8.dart - 7/28/2020 1:29PM',
365366
),
366367
findsOneWidget,
367368
);

packages/devtools_app/test/performance/raster_stats/raster_stats_controller_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ void main() {
2929
);
3030
setGlobal(ServiceConnectionManager, mockServiceConnection);
3131
setGlobal(IdeTheme, IdeTheme());
32+
setGlobal(NotificationService, NotificationService());
3233

3334
controller =
3435
RasterStatsController(createMockPerformanceControllerWithDefaults());

0 commit comments

Comments
 (0)