Skip to content

Commit b1455f8

Browse files
committed
Merge remote-tracking branch 'upstream/master' into fix-widget-rebuilds-profile-mode
# Conflicts: # packages/devtools_app/release_notes/NEXT_RELEASE_NOTES.md
2 parents 575b372 + 34ddb37 commit b1455f8

23 files changed

Lines changed: 578 additions & 225 deletions

.github/workflows/build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ jobs:
7979
sudo chmod +x /usr/bin/dcm
8080
echo "$(dcm --version)"
8181
- name: Setup Dart SDK
82-
uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
82+
uses: dart-lang/setup-dart@7654d458321ee25acccccfdb86cd48bd95768ff1
8383
- name: Run dcm analyze on root
8484
run: |
8585
dcm analyze packages/devtools_app packages/devtools_app_shared packages/devtools_extensions packages/devtools_shared packages/devtools_test

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
with:
2626
ref: master
2727

28-
- uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
28+
- uses: dart-lang/setup-dart@7654d458321ee25acccccfdb86cd48bd95768ff1
2929

3030
- name: setup git config
3131
run: |

TRIAGE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The triager is assigned by an automatic rotation of DevTools team members.
1414
- [Untriaged issues](https://github.com/flutter/devtools/issues?q=is%3Aopen+is%3Aissue+-label%3AP0%2CP1%2CP2%2CP3)
1515
- [Reproduce to verify issues](https://github.com/flutter/devtools/labels/reproduce%20to%20verify)
1616
(issues that need to be manually reproduced in order to verify validity)
17-
- [flutter/flutter issues related to DevTools](https://github.com/flutter/flutter/labels/d%3A%20devtools)
17+
- [flutter/flutter issues related to DevTools](https://github.com/flutter/flutter/labels/a%3A%20devtools)
1818

1919
## Triager responsibilities
2020

packages/devtools_app/benchmark/scripts/compare_benchmarks.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import 'dart:convert';
66
import 'dart:io';
77

8-
import 'package:devtools_app/src/shared/primitives/utils.dart';
98
import 'package:web_benchmarks/analysis.dart';
109

1110
import 'utils.dart';

packages/devtools_app/benchmark/scripts/dart2wasm_performance_diff.dart

Lines changed: 48 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ class CsvBuilder {
9696

9797
void writeHeaders({required int averageOf}) {
9898
writeLines([
99-
'Flutter DevTools performance benchmarks diff: dart2wasm diffed against dart2js.',
99+
'Flutter DevTools performance benchmarks diff: dart2js (baseline) vs dart2wasm (test).',
100100
'Benchmark results were averaged over $averageOf benchmark run(s).',
101101
'',
102102
'These results were auto-generated by a script:',
@@ -105,9 +105,8 @@ class CsvBuilder {
105105
]);
106106

107107
// Write the Flutter and DevTools commit hash for the benchmark run.
108-
// TODO(kenz): automatically detect these and write them to the CSV.
109-
const flutter = '<enter manually by running \'flutter --version\'>';
110-
const devtools = '<enter manually by running \'git log\'>';
108+
final flutter = _detectFlutterVersion();
109+
final devtools = _detectDevToolsCommit();
111110
writeLines([
112111
'Version info:',
113112
'Flutter: $flutter',
@@ -120,7 +119,8 @@ class CsvBuilder {
120119
writeLine([
121120
'Benchmark Name',
122121
'Metric',
123-
'Value (micros)',
122+
'Baseline (micros)',
123+
'Test (micros)',
124124
'Delta (micros)',
125125
'Delta (%)',
126126
]);
@@ -178,6 +178,49 @@ class CsvBuilder {
178178
'(Google Sheets, Excel, etc.) for viewing.',
179179
);
180180
}
181+
182+
String _detectFlutterVersion() {
183+
try {
184+
final result = Process.runSync('flutter', [
185+
'--version',
186+
'--machine',
187+
], runInShell: true);
188+
if (result.exitCode == 0) {
189+
final json =
190+
jsonDecode(result.stdout.toString()) as Map<String, Object?>;
191+
final flutterVersion = json['flutterVersion'];
192+
final frameworkRevision = json['frameworkRevision'];
193+
if (flutterVersion != null && frameworkRevision != null) {
194+
return '$flutterVersion (revision $frameworkRevision)';
195+
}
196+
return result.stdout.toString().trim();
197+
}
198+
} catch (_) {}
199+
200+
try {
201+
final result = Process.runSync('flutter', [
202+
'--version',
203+
], runInShell: true);
204+
if (result.exitCode == 0) {
205+
return result.stdout.toString().trim().split('\n').first;
206+
}
207+
} catch (_) {}
208+
209+
return '<unknown>';
210+
}
211+
212+
String _detectDevToolsCommit() {
213+
try {
214+
final result = Process.runSync('git', [
215+
'rev-parse',
216+
'HEAD',
217+
], runInShell: true);
218+
if (result.exitCode == 0) {
219+
return result.stdout.toString().trim();
220+
}
221+
} catch (_) {}
222+
return '<unknown>';
223+
}
181224
}
182225

183226
Future<BenchmarkResults> runBenchmarkOrUseExisting(

packages/devtools_app/benchmark/scripts/utils.dart

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,15 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file or at https://developers.google.com/open-source/licenses/bsd.
44

5+
import 'dart:convert';
56
import 'dart:io';
67

78
import 'package:web_benchmarks/analysis.dart';
89

10+
/// Returns a pretty-printed representation of a JSON payload.
11+
String prettyPrintJson(Object? json) =>
12+
const JsonEncoder.withIndent(' ').convert(json);
13+
914
File? checkFileExists(String path) {
1015
final testFile = File.fromUri(Uri.parse(path));
1116
if (!testFile.existsSync()) {
@@ -40,14 +45,22 @@ extension BenchmarkResultsExtension on BenchmarkResults {
4045

4146
extension BenchmarkScoreExtension on BenchmarkScore {
4247
List<String> toCsvLine() {
48+
final deltaValue = delta;
49+
final baselineValue = deltaValue != null ? value - deltaValue : null;
50+
final String deltaPercent;
51+
if (baselineValue == null) {
52+
deltaPercent = '';
53+
} else if (baselineValue == 0) {
54+
deltaPercent = 'N/A';
55+
} else {
56+
deltaPercent = (deltaValue! / baselineValue).toString();
57+
}
4358
return [
4459
metric, // Metric name
45-
value.toString(), // Value
46-
delta?.toString() ?? '', // Delta value
47-
// value - delta represents the baseline score.
48-
delta != null
49-
? (delta! / (value - delta!)).toString()
50-
: '', // Delta % value
60+
baselineValue?.toString() ?? '', // Baseline value
61+
value.toString(), // Test value
62+
deltaValue?.toString() ?? '', // Delta value
63+
deltaPercent, // Delta % value
5164
];
5265
}
5366
}

packages/devtools_app/benchmark/test_infra/common.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,9 @@
1010
/// found" in DevTools.
1111
const _benchmarkInitialPage = '';
1212

13-
const _wasmQueryParameters = {'compiler': 'wasm'};
14-
1513
String benchmarkPath({required bool useWasm}) => Uri(
1614
path: _benchmarkInitialPage,
17-
queryParameters: useWasm ? _wasmQueryParameters : null,
15+
queryParameters: {'compiler': useWasm ? 'wasm' : 'js'},
1816
).toString();
1917

2018
String generateBenchmarkEntryPoint({required bool useWasm}) {

packages/devtools_app/lib/devtools_app.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export 'src/screens/deep_link_validation/deep_links_screen.dart';
2727
export 'src/screens/dtd/dtd_tools_controller.dart';
2828
export 'src/screens/dtd/dtd_tools_screen.dart';
2929
export 'src/screens/inspector/inspector_controller.dart';
30+
export 'src/screens/inspector/inspector_errors.dart';
3031
export 'src/screens/inspector/inspector_screen.dart';
3132
export 'src/screens/inspector/inspector_screen_body.dart';
3233
export 'src/screens/inspector/inspector_screen_controller.dart';

packages/devtools_app/lib/src/framework/scaffold/status_line.dart

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@ class StatusLine extends StatelessWidget {
9090
final pageStatus = currentScreen.buildStatus(context);
9191
final widerThanXxs = screenWidth > MediaSize.xxs;
9292
final screenMetaData = ScreenMetaData.lookup(currentScreen.screenId);
93-
final showVideoTutorial = screenMetaData?.tutorialVideoTimestamp != null;
93+
final showVideoTutorial =
94+
screenMetaData?.tutorialVideoTimestamp != null ||
95+
screenMetaData?.tutorialVideoUrl != null;
9496
return [
9597
Row(
9698
mainAxisSize: MainAxisSize.min,
@@ -237,12 +239,15 @@ class DocumentationLink extends StatelessWidget {
237239
/// A widget that links to the "Dive in to DevTools" YouTube video at the
238240
/// chapter for the given [screenMetaData].
239241
class VideoTutorialLink extends StatelessWidget {
240-
const VideoTutorialLink({
242+
VideoTutorialLink({
241243
super.key,
242244
required this.screenMetaData,
243245
required this.screenWidth,
244246
required this.highlightForConnection,
245-
});
247+
}) : assert(
248+
screenMetaData.tutorialVideoTimestamp != null ||
249+
screenMetaData.tutorialVideoUrl != null,
250+
);
246251

247252
final ScreenMetaData screenMetaData;
248253

@@ -262,6 +267,7 @@ class VideoTutorialLink extends StatelessWidget {
262267
link: GaLink(
263268
display: screenWidth <= MediaSize.xs ? 'Tutorial' : 'Watch tutorial',
264269
url:
270+
screenMetaData.tutorialVideoUrl ??
265271
'$_devToolsYouTubeVideoUrl${screenMetaData.tutorialVideoTimestamp}',
266272
gaScreenName: screenMetaData.id,
267273
gaSelectedItemDescription:

packages/devtools_app/lib/src/screens/debugger/controls.dart

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,19 +64,37 @@ class _DebuggingControlsState extends State<DebuggingControls>
6464
height: defaultButtonHeight,
6565
child: Row(
6666
children: [
67-
_pauseAndResumeButtons(
68-
isPaused: serviceConnection.serviceManager.isMainIsolatePaused,
69-
resuming: resuming,
67+
// The debugging controls have no way to shrink further once their
68+
// labels have already been dropped (see
69+
// [DebuggingControls.minWidth]), so below roughly 630px the icon-only
70+
// content still does not fit and the [Row] overflows. Making the
71+
// controls scroll horizontally keeps every control reachable at any
72+
// width instead of clipping them behind an overflow error. The
73+
// libraries button stays pinned on the right, outside the scroll
74+
// view, so it does not scroll out of reach.
75+
Expanded(
76+
child: SingleChildScrollView(
77+
scrollDirection: Axis.horizontal,
78+
child: Row(
79+
children: [
80+
_pauseAndResumeButtons(
81+
isPaused:
82+
serviceConnection.serviceManager.isMainIsolatePaused,
83+
resuming: resuming,
84+
),
85+
const SizedBox(width: denseSpacing),
86+
_stepButtons(canStep: canStep),
87+
const SizedBox(width: denseSpacing),
88+
BreakOnExceptionsControl(controller: controller),
89+
if (isVmApp) ...[
90+
const SizedBox(width: denseSpacing),
91+
CodeStatisticsControls(controller: controller),
92+
],
93+
],
94+
),
95+
),
7096
),
7197
const SizedBox(width: denseSpacing),
72-
_stepButtons(canStep: canStep),
73-
const SizedBox(width: denseSpacing),
74-
BreakOnExceptionsControl(controller: controller),
75-
if (isVmApp) ...[
76-
const SizedBox(width: denseSpacing),
77-
CodeStatisticsControls(controller: controller),
78-
],
79-
const Expanded(child: SizedBox(width: denseSpacing)),
8098
_librariesButton(),
8199
],
82100
),

0 commit comments

Comments
 (0)