diff --git a/dwds/CHANGELOG.md b/dwds/CHANGELOG.md index 76e2f0504..78065a48b 100644 --- a/dwds/CHANGELOG.md +++ b/dwds/CHANGELOG.md @@ -14,8 +14,12 @@ - Pre-warm expression compiler cache to speed up Flutter Inspector loading. - Remove `ChromeProxyService.setExceptionPauseMode()`. - Display full error on failure to start DDS. -- Fix crash on processing DevTools event when starting DevTools from observatory +- Fix crash on processing DevTools event when starting DevTools from DevTools uri. +- Prepare or Dart 3 alpha breaking changes: + - Move weak null safety tests to special branch of `build_web_compilers`. + - Do not pass `--(no)-sound-null-safety` flag to build daemon. + ## 16.0.1 diff --git a/dwds/test/evaluate_common.dart b/dwds/test/evaluate_common.dart index 41b8cb51f..755655c4d 100644 --- a/dwds/test/evaluate_common.dart +++ b/dwds/test/evaluate_common.dart @@ -141,6 +141,23 @@ void testAll({ await setup.service.resume(isolateId); }); + test('uses correct null safety mode', () async { + await onBreakPoint(isolateId, mainScript, 'printLocal', () async { + final event = await stream + .firstWhere((event) => event.kind == EventKind.kPauseBreakpoint); + + final isNullSafetyEnabled = + '() { const sound = !([] is List); return sound; } ()'; + final result = await setup.service.evaluateInFrame( + isolateId, event.topFrame!.index!, isNullSafetyEnabled); + + expect( + result, + isA().having((instance) => instance.valueAsString, + 'valueAsString', '${nullSafety == NullSafety.sound}')); + }); + }); + test('does not crash if class metadata cannot be found', () async { await onBreakPoint(isolateId, mainScript, 'printStream', () async { final event = await stream diff --git a/dwds/test/fixtures/context.dart b/dwds/test/fixtures/context.dart index ff62190ad..b94a48db1 100644 --- a/dwds/test/fixtures/context.dart +++ b/dwds/test/fixtures/context.dart @@ -266,7 +266,6 @@ class TestContext { String basePath = ''; _port = await findUnusedPort(); - final soundNullSafety = nullSafety == NullSafety.sound; switch (compilationMode) { case CompilationMode.buildDaemon: { @@ -275,8 +274,6 @@ class TestContext { '--define', 'build_web_compilers|ddc=generate-full-dill=true', ], - '--define', - 'build_web_compilers:entrypoint=sound_null_safety=$soundNullSafety', '--verbose', ]; _daemonClient = diff --git a/fixtures/_test/pubspec.yaml b/fixtures/_test/pubspec.yaml index 603085b4c..b5f1c5d32 100644 --- a/fixtures/_test/pubspec.yaml +++ b/fixtures/_test/pubspec.yaml @@ -17,4 +17,8 @@ dependencies: dev_dependencies: build_runner: '>=1.6.2 <3.0.0' - build_web_compilers: '>=2.12.0 <4.0.0' + build_web_compilers: + git: + url: https://github.com/dart-lang/build.git + ref: legacy_force_opt_out + path: build_web_compilers diff --git a/fixtures/_testCircular1/pubspec.yaml b/fixtures/_testCircular1/pubspec.yaml index 1664d7ab4..6d78e2467 100644 --- a/fixtures/_testCircular1/pubspec.yaml +++ b/fixtures/_testCircular1/pubspec.yaml @@ -19,4 +19,8 @@ dependencies: dev_dependencies: build_runner: ^2.0.0 - build_web_compilers: ^3.0.0 + build_web_compilers: + git: + url: https://github.com/dart-lang/build.git + ref: legacy_force_opt_out + path: build_web_compilers diff --git a/fixtures/_testCircular2/pubspec.yaml b/fixtures/_testCircular2/pubspec.yaml index fecaf31e0..2e7e7648b 100644 --- a/fixtures/_testCircular2/pubspec.yaml +++ b/fixtures/_testCircular2/pubspec.yaml @@ -17,4 +17,8 @@ dependencies: dev_dependencies: build_runner: ^2.0.0 - build_web_compilers: ^3.0.0 + build_web_compilers: + git: + url: https://github.com/dart-lang/build.git + ref: legacy_force_opt_out + path: build_web_compilers diff --git a/fixtures/_testPackage/pubspec.yaml b/fixtures/_testPackage/pubspec.yaml index dd80f7449..534060449 100644 --- a/fixtures/_testPackage/pubspec.yaml +++ b/fixtures/_testPackage/pubspec.yaml @@ -17,4 +17,8 @@ dependencies: dev_dependencies: build_runner: ^2.0.0 - build_web_compilers: ^3.0.0 + build_web_compilers: + git: + url: https://github.com/dart-lang/build.git + ref: legacy_force_opt_out + path: build_web_compilers diff --git a/fixtures/_webdevSmoke/pubspec.yaml b/fixtures/_webdevSmoke/pubspec.yaml index 8af120f31..9f5fb7aa7 100644 --- a/fixtures/_webdevSmoke/pubspec.yaml +++ b/fixtures/_webdevSmoke/pubspec.yaml @@ -17,4 +17,8 @@ environment: dev_dependencies: build_runner: '>=1.6.2 <3.0.0' - build_web_compilers: '>=2.12.0 <4.0.0' + build_web_compilers: + git: + url: https://github.com/dart-lang/build.git + ref: legacy_force_opt_out + path: build_web_compilers diff --git a/webdev/CHANGELOG.md b/webdev/CHANGELOG.md index 8daa8a6f3..6ed0de0ad 100644 --- a/webdev/CHANGELOG.md +++ b/webdev/CHANGELOG.md @@ -2,6 +2,9 @@ - Add `--enable-experiment` flag to webdev commands and pass it to the build runner and the expression compiler service. +- Prepare or Dart 3 alpha breaking changes: + - Move weak null safety tests to special branch of `build_web_compilers`. + - Do not pass `--(no)-sound-null-safety` flag to build daemon. ## 2.7.12 diff --git a/webdev/lib/src/command/shared.dart b/webdev/lib/src/command/shared.dart index 5a781d510..816a9e27f 100644 --- a/webdev/lib/src/command/shared.dart +++ b/webdev/lib/src/command/shared.dart @@ -89,13 +89,6 @@ List buildRunnerArgs( ..add('build_web_compilers|ddc=generate-full-dill=true'); } - if (configuration.nullSafety != nullSafetyAuto) { - arguments - ..add('--define') - ..add('build_web_compilers:entrypoint=sound_null_safety=' - '${configuration.nullSafety == nullSafetySound}'); - } - for (var experiment in configuration.experiments) { arguments.add('--enable-experiment=$experiment'); } diff --git a/webdev/test/e2e_test.dart b/webdev/test/e2e_test.dart index bf7c7b1b0..73f02ef79 100644 --- a/webdev/test/e2e_test.dart +++ b/webdev/test/e2e_test.dart @@ -64,9 +64,9 @@ void main() { }); test('smoke test is configured properly', () async { - var smokeYaml = - loadYaml(await File('$exampleDirectory/pubspec.yaml').readAsString()) - as YamlMap; + var smokeYaml = loadYaml( + await File('$soundExampleDirectory/pubspec.yaml').readAsString()) + as YamlMap; var webdevYaml = loadYaml(await File('pubspec.yaml').readAsString()) as YamlMap; expect(smokeYaml['environment']['sdk'], @@ -168,32 +168,24 @@ void main() { : 'SDK does not support sound null safety', ); - test( - 'and --null-safety=unsound', - () async { - var args = [ - 'build', - '-o', - 'web:${d.sandbox}', - '--no-release', - '--null-safety=unsound' - ]; + test('and --null-safety=unsound', () async { + var args = [ + 'build', + '-o', + 'web:${d.sandbox}', + '--no-release', + '--null-safety=unsound' + ]; - var process = - await runWebDev(args, workingDirectory: soundExampleDirectory); + var process = await runWebDev(args, workingDirectory: exampleDirectory); - var expectedItems = ['Succeeded']; + var expectedItems = ['Succeeded']; - await checkProcessStdout(process, expectedItems); - await process.shouldExit(0); + await checkProcessStdout(process, expectedItems); + await process.shouldExit(0); - await d.file('main.unsound.ddc.js', isNotEmpty).validate(); - }, - skip: semver.Version.parse(Platform.version.split(' ').first) > - semver.Version.parse('2.11.0') - ? null - : 'SDK does not support sound null safety', - ); + await d.file('main.unsound.ddc.js', isNotEmpty).validate(); + }); }); group('should build with --output=NONE', () { @@ -344,14 +336,17 @@ void main() { await stream.firstWhere( (Event event) => event.kind == EventKind.kPauseBreakpoint); - var result = - await vmService.evaluateInFrame(isolateId, 0, 'true'); + final isNullSafetyEnabled = + '() { const sound = !([] is List); return sound; } ()'; + final result = await vmService.evaluateInFrame( + isolateId, 0, isNullSafetyEnabled); + expect( result, const TypeMatcher().having( (instance) => instance.valueAsString, 'valueAsString', - 'true')); + '$soundNullSafety')); } finally { await vmService?.dispose(); await exitWebdev(process);