From 65e8f104562c38859a0be5c6b310b827287fc5aa Mon Sep 17 00:00:00 2001 From: Nicholas Shahan Date: Thu, 31 Jul 2025 12:53:42 -0700 Subject: [PATCH 1/8] Cleanup unused null-safety options --- .../services/expression_compiler_service.dart | 1 - .../example/web_client.dart | 1 - .../lib/src/frontend_server_client.dart | 1 - webdev/CHANGELOG.md | 2 ++ webdev/lib/src/command/configuration.dart | 20 ------------------- webdev/lib/src/command/shared.dart | 11 ++-------- webdev/test/configuration_test.dart | 7 ------- 7 files changed, 4 insertions(+), 39 deletions(-) diff --git a/dwds/lib/src/services/expression_compiler_service.dart b/dwds/lib/src/services/expression_compiler_service.dart index dfb54be95..5b690f2a1 100644 --- a/dwds/lib/src/services/expression_compiler_service.dart +++ b/dwds/lib/src/services/expression_compiler_service.dart @@ -78,7 +78,6 @@ class _Compiler { '--module-format', compilerOptions.moduleFormat.name, if (verbose) '--verbose', - '--sound-null-safety', for (final experiment in compilerOptions.experiments) '--enable-experiment=$experiment', if (compilerOptions.canaryFeatures) '--canary', diff --git a/frontend_server_client/example/web_client.dart b/frontend_server_client/example/web_client.dart index 94e2b8142..4b341aaef 100644 --- a/frontend_server_client/example/web_client.dart +++ b/frontend_server_client/example/web_client.dart @@ -27,7 +27,6 @@ void main(List args) async { '--multi-root-scheme=org-dartlang-sdk', '--modules=amd', '--module-name=dart_sdk', - '--sound-null-safety', '-o', dartSdkJs, p.url.join(sdkDir, sdkKernelPath), diff --git a/frontend_server_common/lib/src/frontend_server_client.dart b/frontend_server_common/lib/src/frontend_server_client.dart index 3c3ae3c1d..b029cbc0d 100644 --- a/frontend_server_common/lib/src/frontend_server_client.dart +++ b/frontend_server_common/lib/src/frontend_server_client.dart @@ -394,7 +394,6 @@ class ResidentCompiler { ], if (useDebuggerModuleNames) '--debugger-module-names', '--experimental-emit-debug-metadata', - '--sound-null-safety', for (final experiment in compilerOptions.experiments) '--enable-experiment=$experiment', if (compilerOptions.canaryFeatures) '--dartdevc-canary', diff --git a/webdev/CHANGELOG.md b/webdev/CHANGELOG.md index 47a6f1ef7..ef4beb1bc 100644 --- a/webdev/CHANGELOG.md +++ b/webdev/CHANGELOG.md @@ -1,4 +1,6 @@ ## 3.8.0-wip + - Remove deprecated `--null-safety` flag. All Dart 3 compiles use sound null + safety. ## 3.7.2 diff --git a/webdev/lib/src/command/configuration.dart b/webdev/lib/src/command/configuration.dart index 07f532261..3ee9cb277 100644 --- a/webdev/lib/src/command/configuration.dart +++ b/webdev/lib/src/command/configuration.dart @@ -30,10 +30,6 @@ const releaseFlag = 'release'; const requireBuildWebCompilersFlag = 'build-web-compilers'; const enableExpressionEvaluationFlag = 'enable-expression-evaluation'; const verboseFlag = 'verbose'; -const nullSafetyFlag = 'null-safety'; -const nullSafetySound = 'sound'; -const nullSafetyUnsound = 'unsound'; -const nullSafetyAuto = 'auto'; const disableDdsFlag = 'disable-dds'; const enableExperimentOption = 'enable-experiment'; const canaryFeaturesFlag = 'canary'; @@ -105,7 +101,6 @@ class Configuration { final bool? _enableExpressionEvaluation; final bool? _verbose; final bool? _disableDds; - final String? _nullSafety; final List? _experiments; final bool? _canaryFeatures; final bool? _offline; @@ -132,7 +127,6 @@ class Configuration { bool? enableExpressionEvaluation, bool? verbose, bool? disableDds, - String? nullSafety, List? experiments, bool? canaryFeatures, bool? offline, @@ -155,7 +149,6 @@ class Configuration { _disableDds = disableDds, _enableExpressionEvaluation = enableExpressionEvaluation, _verbose = verbose, - _nullSafety = nullSafety, _experiments = experiments, _canaryFeatures = canaryFeatures, _offline = offline { @@ -231,7 +224,6 @@ class Configuration { enableExpressionEvaluation: other._enableExpressionEvaluation ?? _enableExpressionEvaluation, verbose: other._verbose ?? _verbose, - nullSafety: other._nullSafety ?? _nullSafety, experiments: other._experiments ?? _experiments, canaryFeatures: other._canaryFeatures ?? _canaryFeatures, offline: other._offline ?? _offline); @@ -278,13 +270,6 @@ class Configuration { bool get verbose => _verbose ?? false; - /// Null safety mode: - /// - /// 'sound', 'unsound', or 'auto'. - /// 'auto' indicates that the default `package:build_web_compilers` - /// behavior should be used. - String get nullSafety => _nullSafety ?? 'auto'; - List get experiments => _experiments ?? []; bool get canaryFeatures => _canaryFeatures ?? false; @@ -398,10 +383,6 @@ class Configuration { ? argResults[verboseFlag] as bool? : defaultConfiguration.verbose; - final nullSafety = argResults.options.contains(nullSafetyFlag) - ? argResults[nullSafetyFlag] as String? - : defaultConfiguration.nullSafety; - final disableDds = argResults.options.contains(disableDdsFlag) ? argResults[disableDdsFlag] as bool? : defaultConfiguration.disableDds; @@ -441,7 +422,6 @@ class Configuration { disableDds: disableDds, enableExpressionEvaluation: enableExpressionEvaluation, verbose: verbose, - nullSafety: nullSafety, experiments: experiments, canaryFeatures: canaryFeatures, offline: offline, diff --git a/webdev/lib/src/command/shared.dart b/webdev/lib/src/command/shared.dart index 097a893c9..14a9beae8 100644 --- a/webdev/lib/src/command/shared.dart +++ b/webdev/lib/src/command/shared.dart @@ -30,15 +30,8 @@ void addSharedArgs(ArgParser argParser, ) ..addOption(nullSafetyFlag, abbr: 'n', - defaultsTo: nullSafetyAuto, - allowed: [nullSafetySound, nullSafetyUnsound, nullSafetyAuto], - help: - 'DEPRECATED: If "sound", `package:build_web_compilers` will be run ' - 'with sound null safety support. ' - 'If "unsound", `package:build_web_compilers` will be run without ' - 'sound null safety support. ' - 'If "auto", the default `package:build_web_compilers` ' - 'behavior is used.', + help: 'DEPRECATED: This flag is ignored and will be removed in an' + 'upcoming release.', hide: true) ..addFlag(releaseFlag, abbr: 'r', diff --git a/webdev/test/configuration_test.dart b/webdev/test/configuration_test.dart index 5fccfd2d0..9d9fa766b 100644 --- a/webdev/test/configuration_test.dart +++ b/webdev/test/configuration_test.dart @@ -12,7 +12,6 @@ void main() { argParser = ArgParser() ..addFlag('release') ..addFlag(launchInChromeFlag, defaultsTo: false) - ..addOption(nullSafetyFlag, defaultsTo: nullSafetyAuto) ..addOption(userDataDirFlag, defaultsTo: null); }); @@ -71,12 +70,6 @@ void main() { throwsA(isA())); }); - test('nullSafety defaults to auto', () { - final argResults = argParser.parse(['']); - final defaultConfiguration = Configuration.fromArgs(argResults); - expect(defaultConfiguration.nullSafety, equals(nullSafetyAuto)); - }); - test( 'must not provide debug related configuration when enableInjectedClient ' 'is false', () { From 4d7dc4fefcc6fe891f1104d640892fd496696005 Mon Sep 17 00:00:00 2001 From: Nicholas Shahan Date: Thu, 31 Jul 2025 12:57:35 -0700 Subject: [PATCH 2/8] oops missed one file in the last commit --- webdev/lib/src/command/shared.dart | 5 ----- 1 file changed, 5 deletions(-) diff --git a/webdev/lib/src/command/shared.dart b/webdev/lib/src/command/shared.dart index 14a9beae8..308c89e5e 100644 --- a/webdev/lib/src/command/shared.dart +++ b/webdev/lib/src/command/shared.dart @@ -28,11 +28,6 @@ void addSharedArgs(ArgParser argParser, 'A value of "NONE" indicates that no "--output" value should be ' 'passed to `build_runner`.', ) - ..addOption(nullSafetyFlag, - abbr: 'n', - help: 'DEPRECATED: This flag is ignored and will be removed in an' - 'upcoming release.', - hide: true) ..addFlag(releaseFlag, abbr: 'r', defaultsTo: releaseDefault, From 2f4143a4903c188f117c6b9f839e64062bc38c91 Mon Sep 17 00:00:00 2001 From: Nicholas Shahan Date: Thu, 31 Jul 2025 14:13:06 -0700 Subject: [PATCH 3/8] cleanup e2e_test --- webdev/test/e2e_test.dart | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/webdev/test/e2e_test.dart b/webdev/test/e2e_test.dart index 87c07f74d..c438440b4 100644 --- a/webdev/test/e2e_test.dart +++ b/webdev/test/e2e_test.dart @@ -153,30 +153,6 @@ void main() { skip: Platform.isWindows, ); } - test( - 'and --null-safety=sound', - () async { - final args = [ - 'build', - '-o', - 'web:${d.sandbox}', - '--no-release', - '--null-safety=sound' - ]; - - final process = await testRunner.runWebDev(args, - workingDirectory: soundExampleDirectory); - - final expectedItems = ['Built with build_runner']; - - await checkProcessStdout(process, expectedItems); - await process.shouldExit(0); - - await d.file('main.ddc.js', isNotEmpty).validate(); - }, - // https://github.com/dart-lang/webdev/issues/2489 - skip: Platform.isWindows, - ); }); group('should build with --output=NONE', () { @@ -281,7 +257,6 @@ void main() { 'daemon', 'web:$openPort', '--enable-expression-evaluation', - '--null-safety=sound', '--verbose', ]; final process = await testRunner.runWebDev(args, From cbc3e5f1eabfe1cf0cd79cd5d2ef41c518da5780 Mon Sep 17 00:00:00 2001 From: Nicholas Shahan Date: Fri, 1 Aug 2025 10:03:18 -0700 Subject: [PATCH 4/8] move diffs to other PRs --- dwds/lib/src/services/expression_compiler_service.dart | 1 + frontend_server_client/example/web_client.dart | 1 + frontend_server_common/lib/src/frontend_server_client.dart | 1 + 3 files changed, 3 insertions(+) diff --git a/dwds/lib/src/services/expression_compiler_service.dart b/dwds/lib/src/services/expression_compiler_service.dart index 5b690f2a1..dfb54be95 100644 --- a/dwds/lib/src/services/expression_compiler_service.dart +++ b/dwds/lib/src/services/expression_compiler_service.dart @@ -78,6 +78,7 @@ class _Compiler { '--module-format', compilerOptions.moduleFormat.name, if (verbose) '--verbose', + '--sound-null-safety', for (final experiment in compilerOptions.experiments) '--enable-experiment=$experiment', if (compilerOptions.canaryFeatures) '--canary', diff --git a/frontend_server_client/example/web_client.dart b/frontend_server_client/example/web_client.dart index 4b341aaef..94e2b8142 100644 --- a/frontend_server_client/example/web_client.dart +++ b/frontend_server_client/example/web_client.dart @@ -27,6 +27,7 @@ void main(List args) async { '--multi-root-scheme=org-dartlang-sdk', '--modules=amd', '--module-name=dart_sdk', + '--sound-null-safety', '-o', dartSdkJs, p.url.join(sdkDir, sdkKernelPath), diff --git a/frontend_server_common/lib/src/frontend_server_client.dart b/frontend_server_common/lib/src/frontend_server_client.dart index b029cbc0d..3c3ae3c1d 100644 --- a/frontend_server_common/lib/src/frontend_server_client.dart +++ b/frontend_server_common/lib/src/frontend_server_client.dart @@ -394,6 +394,7 @@ class ResidentCompiler { ], if (useDebuggerModuleNames) '--debugger-module-names', '--experimental-emit-debug-metadata', + '--sound-null-safety', for (final experiment in compilerOptions.experiments) '--enable-experiment=$experiment', if (compilerOptions.canaryFeatures) '--dartdevc-canary', From 804df33ea38d6be8f75bd8371d939867681d2053 Mon Sep 17 00:00:00 2001 From: Nicholas Shahan Date: Tue, 5 Aug 2025 16:39:29 -0700 Subject: [PATCH 5/8] bump major version --- webdev/CHANGELOG.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/webdev/CHANGELOG.md b/webdev/CHANGELOG.md index ef4beb1bc..940081862 100644 --- a/webdev/CHANGELOG.md +++ b/webdev/CHANGELOG.md @@ -1,6 +1,5 @@ -## 3.8.0-wip - - Remove deprecated `--null-safety` flag. All Dart 3 compiles use sound null - safety. +## 4.0.0-wip + - Remove deprecated `--null-safety` flag. Dart 3 only supports [sound null safety](https://dart.dev/null-safety). ## 3.7.2 From d6443c397a3ef245eeff7cc5a55cef7d0c77bcaf Mon Sep 17 00:00:00 2001 From: Nicholas Shahan Date: Wed, 13 Aug 2025 09:51:17 -0700 Subject: [PATCH 6/8] bump version in pubspec to 4.0.0-wip --- webdev/lib/src/version.dart | 2 +- webdev/pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/webdev/lib/src/version.dart b/webdev/lib/src/version.dart index f0d3ee90c..85487ec49 100644 --- a/webdev/lib/src/version.dart +++ b/webdev/lib/src/version.dart @@ -1,2 +1,2 @@ // Generated code. Do not modify. -const packageVersion = '3.8.0-wip'; +const packageVersion = '4.0.0-wip'; diff --git a/webdev/pubspec.yaml b/webdev/pubspec.yaml index d8730c128..a68bf7468 100644 --- a/webdev/pubspec.yaml +++ b/webdev/pubspec.yaml @@ -1,6 +1,6 @@ name: webdev # Every time this changes you need to run `dart run build_runner build`. -version: 3.8.0-wip +version: 4.0.0-wip # We should not depend on a dev SDK before publishing. # publish_to: none description: >- From ec23a7e751a63b9c99cddffd494fcb719ad67680 Mon Sep 17 00:00:00 2001 From: Nicholas Shahan Date: Wed, 13 Aug 2025 11:31:06 -0700 Subject: [PATCH 7/8] bump dwds dep and add temporary local override --- webdev/pubspec.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/webdev/pubspec.yaml b/webdev/pubspec.yaml index a68bf7468..0d9531d0f 100644 --- a/webdev/pubspec.yaml +++ b/webdev/pubspec.yaml @@ -19,7 +19,7 @@ dependencies: crypto: ^3.0.2 dds: ^4.1.0 # Pin DWDS to avoid dependency conflicts with vm_service: - dwds: 24.3.11 + dwds: 25.0.0 http: ^1.0.0 http_multi_server: ^3.2.0 io: ^1.0.3 @@ -55,3 +55,8 @@ dev_dependencies: executables: webdev: + +# REMOVE BEFORE PUBLISHING! +dependency_overrides: + dwds: + path: ../dwds \ No newline at end of file From 3bf0b876958f4ac877a74561aa92ef9bafa67d04 Mon Sep 17 00:00:00 2001 From: Nicholas Shahan Date: Thu, 14 Aug 2025 09:39:51 -0700 Subject: [PATCH 8/8] remove local dwds dep override --- webdev/pubspec.yaml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/webdev/pubspec.yaml b/webdev/pubspec.yaml index 0d9531d0f..8c19e72ec 100644 --- a/webdev/pubspec.yaml +++ b/webdev/pubspec.yaml @@ -55,8 +55,3 @@ dev_dependencies: executables: webdev: - -# REMOVE BEFORE PUBLISHING! -dependency_overrides: - dwds: - path: ../dwds \ No newline at end of file