Skip to content

Commit 8c22555

Browse files
authored
Prepare Dart Debug Extension for MV3 release (#2293)
1 parent 3bb4a6a commit 8c22555

File tree

8 files changed

+12
-232
lines changed

8 files changed

+12
-232
lines changed

dwds/debug_extension_mv3/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: mv3_extension
22
publish_to: none
3-
version: 1.38.0
3+
version: 2.0.0
44
homepage: https://github.com/dart-lang/webdev
55
description: >-
66
A Chrome extension for Dart debugging.

dwds/debug_extension_mv3/tool/build_extension.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
// Run from the extension root directory:
1111
// - For dev: dart run tool/build_extension.dart
12-
// - For prod: dart run tool/build_extension.dart prod
13-
// - For MV3: dart run tool/build_extension.dart --mv3
12+
// - For prod: dart run tool/build_extension.dart --prod
13+
// - For MV2: dart run tool/build_extension.dart --mv2
1414

1515
import 'dart:convert';
1616
import 'dart:io';
@@ -19,26 +19,26 @@ import 'package:args/args.dart';
1919
import 'package:path/path.dart' as p;
2020

2121
const _prodFlag = 'prod';
22-
const _mv3Flag = 'mv3';
22+
const _mv2Flag = 'mv2';
2323

2424
void main(List<String> arguments) async {
2525
final parser = ArgParser()
2626
..addFlag(_prodFlag, negatable: true, defaultsTo: false)
27-
..addFlag(_mv3Flag, negatable: true, defaultsTo: false);
27+
..addFlag(_mv2Flag, negatable: true, defaultsTo: false);
2828
final argResults = parser.parse(arguments);
2929

3030
exitCode = await run(
3131
isProd: argResults[_prodFlag] as bool,
32-
isMV3: argResults[_mv3Flag] as bool,
32+
isMV2: argResults[_mv2Flag] as bool,
3333
);
3434
if (exitCode != 0) {
3535
_logWarning('Run terminated unexpectedly with exit code: $exitCode');
3636
}
3737
}
3838

39-
Future<int> run({required bool isProd, required bool isMV3}) async {
39+
Future<int> run({required bool isProd, required bool isMV2}) async {
4040
_logInfo(
41-
'Building ${isMV3 ? 'MV3' : 'MV2'} extension for ${isProd ? 'prod' : 'dev'}',
41+
'Building ${isMV2 ? 'MV2' : 'MV3'} extension for ${isProd ? 'prod' : 'dev'}',
4242
);
4343
_logInfo('Compiling extension with dart2js to /compiled directory');
4444
final compileStep = await Process.start(
@@ -50,7 +50,7 @@ Future<int> run({required bool isProd, required bool isMV3}) async {
5050
if (compileExitCode != 0) {
5151
return compileExitCode;
5252
}
53-
final manifestFileName = isMV3 ? 'manifest_mv3' : 'manifest_mv2';
53+
final manifestFileName = isMV2 ? 'manifest_mv2' : 'manifest_mv3';
5454
_logInfo('Copying manifest.json to /compiled directory');
5555
try {
5656
File(p.join('web', '$manifestFileName.json')).copySync(

dwds/debug_extension_mv3/web/debug_session.dart

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import 'cider_connection.dart';
2525
import 'cross_extension_communication.dart';
2626
import 'data_serializers.dart';
2727
import 'data_types.dart';
28-
import 'lifeline_ports.dart';
2928
import 'logger.dart';
3029
import 'messaging.dart';
3130
import 'storage.dart';
@@ -381,8 +380,6 @@ Future<bool> _connectToDwds({
381380
cancelOnError: true,
382381
);
383382
_debugSessions.add(debugSession);
384-
// Create a connection with the lifeline port to keep the debug session alive:
385-
await maybeCreateLifelinePort(dartAppTabId);
386383
// Send a DevtoolsRequest to the event stream:
387384
final tabUrl = await _getTabUrl(dartAppTabId);
388385
debugSession.sendEvent(
@@ -592,10 +589,7 @@ void _removeDebugSession(_DebugSession debugSession) {
592589
debugSession.sendEvent(event);
593590
debugSession.close();
594591
final removed = _debugSessions.remove(debugSession);
595-
if (removed) {
596-
// Maybe remove the corresponding lifeline connection:
597-
maybeRemoveLifelinePort(debugSession.appTabId);
598-
} else {
592+
if (!removed) {
599593
debugWarn('Could not remove debug session.');
600594
}
601595
}

dwds/debug_extension_mv3/web/lifeline_connection.dart

Lines changed: 0 additions & 27 deletions
This file was deleted.

dwds/debug_extension_mv3/web/lifeline_ports.dart

Lines changed: 0 additions & 94 deletions
This file was deleted.

dwds/debug_extension_mv3/web/manifest_mv2.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Dart Debug Extension",
3-
"version": "1.40",
3+
"version": "2.0",
44
"manifest_version": 2,
55
"devtools_page": "static_assets/devtools.html",
66
"browser_action": {

dwds/debug_extension_mv3/web/manifest_mv3.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Dart Debug Extension",
3-
"version": "1.40",
3+
"version": "2.0",
44
"manifest_version": 3,
55
"devtools_page": "static_assets/devtools.html",
66
"action": {

dwds/test/puppeteer/lifeline_test.dart

Lines changed: 0 additions & 93 deletions
This file was deleted.

0 commit comments

Comments
 (0)