Skip to content

Commit ee65f5c

Browse files
authored
Update minimum sdk version required to 3.7.0 (#2590)
* Update minimum sdk version required to 3.7.0 * Format. * Fix analyzer warnings. * Fix trailing commas. * Update version to 24.3.6-dev instead of 24.3.6-wip * Format.
1 parent 718c39c commit ee65f5c

File tree

150 files changed

+8871
-7991
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

150 files changed

+8871
-7991
lines changed

dwds/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 24.3.6-dev
2+
3+
- Bump minimum sdk version to 3.7.0
4+
15
## 24.3.5
26
- Allow clients to specify the `packageConfigPath` in `LoadStrategy` class and associated providers.
37

dwds/analysis_options.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,3 @@ analyzer:
1010
linter:
1111
rules:
1212
- always_use_package_imports
13-
- require_trailing_commas

dwds/debug_extension/tool/build_extension.dart

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,37 +20,38 @@ import 'package:path/path.dart' as p;
2020
const _prodFlag = 'prod';
2121

2222
void main(List<String> arguments) async {
23-
final parser = ArgParser()
24-
..addFlag(_prodFlag, negatable: true, defaultsTo: false);
23+
final parser =
24+
ArgParser()..addFlag(_prodFlag, negatable: true, defaultsTo: false);
2525
final argResults = parser.parse(arguments);
2626

27-
exitCode = await run(
28-
isProd: argResults[_prodFlag] as bool,
29-
);
27+
exitCode = await run(isProd: argResults[_prodFlag] as bool);
3028
if (exitCode != 0) {
3129
_logWarning('Run terminated unexpectedly with exit code: $exitCode');
3230
}
3331
}
3432

3533
Future<int> run({required bool isProd}) async {
36-
_logInfo(
37-
'Building extension for ${isProd ? 'prod' : 'dev'}',
38-
);
34+
_logInfo('Building extension for ${isProd ? 'prod' : 'dev'}');
3935
_logInfo('Compiling extension with dart2js to /compiled directory');
40-
final compileStep = await Process.start(
41-
'dart',
42-
['run', 'build_runner', 'build', 'web', '--output', 'build', '--release'],
43-
);
36+
final compileStep = await Process.start('dart', [
37+
'run',
38+
'build_runner',
39+
'build',
40+
'web',
41+
'--output',
42+
'build',
43+
'--release',
44+
]);
4445
final compileExitCode = await _handleProcess(compileStep);
4546
// Terminate early if compilation failed:
4647
if (compileExitCode != 0) {
4748
return compileExitCode;
4849
}
4950
_logInfo('Copying manifest.json to /compiled directory');
5051
try {
51-
File(p.join('web', 'manifest.json')).copySync(
52-
p.join('compiled', 'manifest.json'),
53-
);
52+
File(
53+
p.join('web', 'manifest.json'),
54+
).copySync(p.join('compiled', 'manifest.json'));
5455
} catch (error) {
5556
_logWarning('Copying manifest file failed: $error');
5657
// Return non-zero exit code to indicate failure:
@@ -60,10 +61,9 @@ Future<int> run({required bool isProd}) async {
6061
if (isProd) return 0;
6162
// Update manifest.json for dev:
6263
_logInfo('Updating manifest.json in /compiled directory.');
63-
final updateStep = await Process.start(
64-
'dart',
65-
[p.join('tool', 'update_dev_files.dart')],
66-
);
64+
final updateStep = await Process.start('dart', [
65+
p.join('tool', 'update_dev_files.dart'),
66+
]);
6767
final updateExitCode = await _handleProcess(updateStep);
6868
// Return exit code (0 indicates success):
6969
return updateExitCode;

dwds/debug_extension/tool/copy_builder.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ Builder copyBuilder(_) => _CopyBuilder();
1010
class _CopyBuilder extends Builder {
1111
@override
1212
Map<String, List<String>> get buildExtensions => {
13-
'web/{{}}.dart.js': ['compiled/{{}}.dart.js'],
14-
'web/static_assets/{{}}.png': ['compiled/static_assets/{{}}.png'],
15-
'web/static_assets/{{}}.html': ['compiled/static_assets/{{}}.html'],
16-
'web/static_assets/{{}}.css': ['compiled/static_assets/{{}}.css'],
17-
'web/manifest.json': ['compiled/manifest.json'],
18-
};
13+
'web/{{}}.dart.js': ['compiled/{{}}.dart.js'],
14+
'web/static_assets/{{}}.png': ['compiled/static_assets/{{}}.png'],
15+
'web/static_assets/{{}}.html': ['compiled/static_assets/{{}}.html'],
16+
'web/static_assets/{{}}.css': ['compiled/static_assets/{{}}.css'],
17+
'web/manifest.json': ['compiled/manifest.json'],
18+
};
1919

2020
@override
2121
Future<void> build(BuildStep buildStep) async {

dwds/debug_extension/tool/update_dev_files.dart

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ void main() async {
1212
Future<void> _updateManifestJson() async {
1313
final manifestJson = File('compiled/manifest.json');
1414
final extensionKeyTxt = File('extension_key.txt');
15-
final extensionKey = await extensionKeyTxt.exists()
16-
? await extensionKeyTxt.readAsString()
17-
: null;
15+
final extensionKey =
16+
await extensionKeyTxt.exists()
17+
? await extensionKeyTxt.readAsString()
18+
: null;
1819
return _transformDevFile(manifestJson, (line) {
1920
if (_matchesKey(line: line, key: 'name')) {
2021
return [
@@ -24,11 +25,7 @@ Future<void> _updateManifestJson() async {
2425
newValue: '[DEV] Dart Debug Extension',
2526
),
2627
if (extensionKey != null)
27-
_newKeyValue(
28-
oldLine: line,
29-
newKey: 'key',
30-
newValue: extensionKey,
31-
),
28+
_newKeyValue(oldLine: line, newKey: 'key', newValue: extensionKey),
3229
];
3330
} else if (_matchesKey(line: line, key: 'default_icon')) {
3431
return [

dwds/debug_extension/web/background.dart

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
library;
77

88
import 'package:dwds/data/debug_info.dart';
9+
// TODO: https://github.com/dart-lang/webdev/issues/2508
10+
// ignore: deprecated_member_use
911
import 'package:js/js.dart';
1012

1113
import 'chrome_api.dart';
@@ -23,9 +25,7 @@ void main() {
2325
}
2426

2527
void _registerListeners() {
26-
chrome.runtime.onMessage.addListener(
27-
allowInterop(_handleRuntimeMessages),
28-
);
28+
chrome.runtime.onMessage.addListener(allowInterop(_handleRuntimeMessages));
2929
// The only extension allowed to send messages to this extension is the
3030
// AngularDart DevTools extension. Its permission is set in the manifest.json
3131
// externally_connectable field.
@@ -34,8 +34,9 @@ void _registerListeners() {
3434
);
3535
// The only external service that sends messages to the Dart Debug Extension
3636
// is Cider.
37-
chrome.runtime.onConnectExternal
38-
.addListener(allowInterop(handleCiderConnectRequest));
37+
chrome.runtime.onConnectExternal.addListener(
38+
allowInterop(handleCiderConnectRequest),
39+
);
3940
// Update the extension icon on tab navigation:
4041
chrome.tabs.onActivated.addListener(
4142
allowInterop((ActiveInfo info) async {
@@ -50,11 +51,13 @@ void _registerListeners() {
5051
}
5152
}),
5253
);
53-
chrome.webNavigation.onCommitted
54-
.addListener(allowInterop(_detectNavigationAwayFromDartApp));
54+
chrome.webNavigation.onCommitted.addListener(
55+
allowInterop(_detectNavigationAwayFromDartApp),
56+
);
5557

56-
chrome.commands.onCommand
57-
.addListener(allowInterop(_maybeSendCopyAppIdRequest));
58+
chrome.commands.onCommand.addListener(
59+
allowInterop(_maybeSendCopyAppIdRequest),
60+
);
5861
}
5962

6063
Future<void> _handleRuntimeMessages(
@@ -214,19 +217,20 @@ bool _isInternalNavigation(NavigationInfo navigationInfo) {
214217

215218
DebugInfo _addTabInfo(DebugInfo debugInfo, {required Tab tab}) {
216219
return DebugInfo(
217-
(b) => b
218-
..appEntrypointPath = debugInfo.appEntrypointPath
219-
..appId = debugInfo.appId
220-
..appInstanceId = debugInfo.appInstanceId
221-
..appOrigin = debugInfo.appOrigin
222-
..appUrl = debugInfo.appUrl
223-
..authUrl = debugInfo.authUrl
224-
..extensionUrl = debugInfo.extensionUrl
225-
..isInternalBuild = debugInfo.isInternalBuild
226-
..isFlutterApp = debugInfo.isFlutterApp
227-
..workspaceName = debugInfo.workspaceName
228-
..tabUrl = tab.url
229-
..tabId = tab.id,
220+
(b) =>
221+
b
222+
..appEntrypointPath = debugInfo.appEntrypointPath
223+
..appId = debugInfo.appId
224+
..appInstanceId = debugInfo.appInstanceId
225+
..appOrigin = debugInfo.appOrigin
226+
..appUrl = debugInfo.appUrl
227+
..authUrl = debugInfo.authUrl
228+
..extensionUrl = debugInfo.extensionUrl
229+
..isInternalBuild = debugInfo.isInternalBuild
230+
..isFlutterApp = debugInfo.isFlutterApp
231+
..workspaceName = debugInfo.workspaceName
232+
..tabUrl = tab.url
233+
..tabId = tab.id,
230234
);
231235
}
232236

@@ -279,9 +283,7 @@ void _setDefaultIcon(int tabId) {
279283
final iconPath =
280284
isDevMode ? 'static_assets/dart_dev.png' : 'static_assets/dart_grey.png';
281285
setExtensionIcon(IconInfo(path: iconPath));
282-
setExtensionPopup(
283-
PopupDetails(popup: '', tabId: tabId),
284-
);
286+
setExtensionPopup(PopupDetails(popup: '', tabId: tabId));
285287
}
286288

287289
Future<DebugInfo?> _fetchDebugInfo(int tabId) {

dwds/debug_extension/web/chrome_api.dart

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
// ignore: deprecated_member_use
77
import 'dart:html';
88

9+
// TODO: https://github.com/dart-lang/webdev/issues/2508
10+
// ignore: deprecated_member_use
911
import 'package:js/js.dart';
1012

1113
@JS()
@@ -158,9 +160,7 @@ class Notifications {
158160
@JS()
159161
@anonymous
160162
class OnClickedHandler {
161-
external void addListener(
162-
void Function(String) callback,
163-
);
163+
external void addListener(void Function(String) callback);
164164
}
165165

166166
@JS()
@@ -233,9 +233,7 @@ class Port {
233233
@JS()
234234
@anonymous
235235
class OnPortMessageHandler {
236-
external void addListener(
237-
void Function(dynamic, Port) callback,
238-
);
236+
external void addListener(void Function(dynamic, Port) callback);
239237
}
240238

241239
@JS()

dwds/debug_extension/web/cider_connection.dart

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import 'dart:convert';
1010
// ignore: deprecated_member_use
1111
import 'dart:js_util';
1212

13+
// TODO: https://github.com/dart-lang/webdev/issues/2508
14+
// ignore: deprecated_member_use
1315
import 'package:js/js.dart';
1416

1517
import 'chrome_api.dart';
@@ -44,11 +46,7 @@ enum CiderMessageType {
4446
///
4547
/// The types must match those defined by ChromeExtensionErrorType in the
4648
/// Cider extension.
47-
enum CiderErrorType {
48-
internalError,
49-
invalidRequest,
50-
noAppId,
51-
}
49+
enum CiderErrorType { internalError, invalidRequest, noAppId }
5250

5351
const _ciderPortName = 'cider';
5452
Port? _ciderPort;
@@ -62,9 +60,7 @@ void handleCiderConnectRequest(Port port) {
6260
debugLog('Received connect request from Cider', verbose: true);
6361
_ciderPort = port;
6462

65-
port.onMessage.addListener(
66-
allowInterop(_handleMessageFromCider),
67-
);
63+
port.onMessage.addListener(allowInterop(_handleMessageFromCider));
6864

6965
sendMessageToCider(messageType: CiderMessageType.connected);
7066
}
@@ -99,10 +95,7 @@ void sendErrorMessageToCider({
9995
}
10096

10197
void _sendMessageToCider(String json) {
102-
final message = {
103-
'key': _ciderDartMessageKey,
104-
'json': json,
105-
};
98+
final message = {'key': _ciderDartMessageKey, 'json': json};
10699
_ciderPort!.postMessage(jsify(message));
107100
}
108101

@@ -177,7 +170,8 @@ Future<void> _sendInspectorUrl({String? appId}) async {
177170
if (!alreadyDebugging) {
178171
sendErrorMessageToCider(
179172
errorType: CiderErrorType.invalidRequest,
180-
errorDetails: 'Cannot send the inspector URL before '
173+
errorDetails:
174+
'Cannot send the inspector URL before '
181175
'the debugger has been attached.',
182176
);
183177
return;
@@ -195,10 +189,7 @@ Future<void> _sendInspectorUrl({String? appId}) async {
195189
}
196190
final inspectorUrl = addQueryParameters(
197191
devToolsUri,
198-
queryParameters: {
199-
'embed': 'true',
200-
'page': 'inspector',
201-
},
192+
queryParameters: {'embed': 'true', 'page': 'inspector'},
202193
);
203194
sendMessageToCider(
204195
messageType: CiderMessageType.inspectorUrlResponse,

dwds/debug_extension/web/copier.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ library;
99
// ignore: deprecated_member_use
1010
import 'dart:html';
1111

12+
// TODO: https://github.com/dart-lang/webdev/issues/2508
13+
// ignore: deprecated_member_use
1214
import 'package:js/js.dart';
1315

1416
import 'chrome_api.dart';
@@ -19,9 +21,7 @@ void main() {
1921
}
2022

2123
void _registerListeners() {
22-
chrome.runtime.onMessage.addListener(
23-
allowInterop(_handleRuntimeMessages),
24-
);
24+
chrome.runtime.onMessage.addListener(allowInterop(_handleRuntimeMessages));
2525
}
2626

2727
void _handleRuntimeMessages(
@@ -49,8 +49,8 @@ void _copyAppId(String appId) {
4949
}
5050

5151
Future<bool> _notifyCopiedSuccess(String appId) => sendRuntimeMessage(
52-
type: MessageType.appId,
53-
body: appId,
54-
sender: Script.copier,
55-
recipient: Script.background,
56-
);
52+
type: MessageType.appId,
53+
body: appId,
54+
sender: Script.copier,
55+
recipient: Script.background,
56+
);

0 commit comments

Comments
 (0)