From 02f33dde33477d37dacfd8edf3f2152dc5610a9b Mon Sep 17 00:00:00 2001 From: MarkZ Date: Fri, 29 May 2026 10:36:36 -0700 Subject: [PATCH 1/4] Enable DDC Library Bundle module system by default --- webdev/lib/src/command/configuration.dart | 8 +------- webdev/lib/src/command/shared.dart | 2 +- webdev/test/configuration_test.dart | 15 +-------------- webdev/test/test_utils.dart | 17 +++++++++-------- 4 files changed, 12 insertions(+), 30 deletions(-) diff --git a/webdev/lib/src/command/configuration.dart b/webdev/lib/src/command/configuration.dart index 3cae53a79..0148f116e 100644 --- a/webdev/lib/src/command/configuration.dart +++ b/webdev/lib/src/command/configuration.dart @@ -241,12 +241,6 @@ class Configuration { ); } } - - if (moduleFormat == 'ddc' && !canaryFeatures) { - throw InvalidConfiguration( - 'Flag "--$moduleFormatFlag=ddc" requires --$canaryFeaturesFlag.', - ); - } } /// Creates a new [Configuration] with all non-null fields from @@ -336,7 +330,7 @@ class Configuration { bool get webHotReload => _webHotReload ?? false; - String get moduleFormat => _moduleFormat ?? 'amd'; + String get moduleFormat => _moduleFormat ?? 'ddc'; bool get usesDdcLibraryBundle => canaryFeatures || (moduleFormat == 'ddc') || webHotReload; diff --git a/webdev/lib/src/command/shared.dart b/webdev/lib/src/command/shared.dart index ca313c812..1c6e9b4d3 100644 --- a/webdev/lib/src/command/shared.dart +++ b/webdev/lib/src/command/shared.dart @@ -98,7 +98,7 @@ void addSharedArgs( ) ..addOption( moduleFormatFlag, - defaultsTo: 'amd', + defaultsTo: 'ddc', allowed: ['amd', 'ddc'], help: 'Sets the module format DDC uses for compilation.', hide: true, diff --git a/webdev/test/configuration_test.dart b/webdev/test/configuration_test.dart index 702a48613..30e9860f4 100644 --- a/webdev/test/configuration_test.dart +++ b/webdev/test/configuration_test.dart @@ -19,6 +19,7 @@ void main() { test('default configuration is correctly applied', () { final configuration = Configuration.fromArgs(null); expect(configuration.hostname, equals('localhost')); + expect(configuration.moduleFormat, equals('ddc')); }); test('arg configuration takes precedence to default configuration', () { @@ -162,18 +163,4 @@ void main() { throwsA(isA()), ); }); - - test('moduleFormat ddc + canaryFeatures false throws', () { - expect( - () => Configuration(moduleFormat: 'ddc', canaryFeatures: false), - throwsA(isA()), - ); - }); - - test('moduleFormat ddc throws if canaryFeatures not set', () { - expect( - () => Configuration(moduleFormat: 'ddc'), - throwsA(isA()), - ); - }); } diff --git a/webdev/test/test_utils.dart b/webdev/test/test_utils.dart index 35ea5331f..d6d68372d 100644 --- a/webdev/test/test_utils.dart +++ b/webdev/test/test_utils.dart @@ -80,14 +80,15 @@ class TestRunner { } } - if (ddcModuleFormat == ModuleFormat.ddc) { - final dashDashIndex = fullArgs.indexOf('--'); - final extraArgs = ['--module-format', 'ddc']; - if (dashDashIndex != -1) { - fullArgs.insertAll(dashDashIndex, extraArgs); - } else { - fullArgs.addAll(extraArgs); - } + final moduleFormatStr = ddcModuleFormat == ModuleFormat.ddc + ? 'ddc' + : 'amd'; + final dashDashIndex = fullArgs.indexOf('--'); + final extraArgs = ['--module-format', moduleFormatStr]; + if (dashDashIndex != -1) { + fullArgs.insertAll(dashDashIndex, extraArgs); + } else { + fullArgs.addAll(extraArgs); } } From b022d0b5014e393897782bf1a94ce9edd2dc1198 Mon Sep 17 00:00:00 2001 From: MarkZ Date: Fri, 29 May 2026 16:04:23 -0700 Subject: [PATCH 2/4] Adding changelog and fixing test --- webdev/CHANGELOG.md | 5 +++++ webdev/test/test_utils.dart | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/webdev/CHANGELOG.md b/webdev/CHANGELOG.md index c6177a23f..12e0d8462 100644 --- a/webdev/CHANGELOG.md +++ b/webdev/CHANGELOG.md @@ -1,3 +1,8 @@ +## 3.10.0 +- Use the DDC Library Bundle module format to by default (instead of AMD). + - Note: opt out by passing `--module-format amd` +- Remove the requirement for the `--canary` flag when selecting the `--module-format=ddc` option. + ## 3.9.0-wip - Fix webdev failing to compile in aot mode due to missing DDS arguments. diff --git a/webdev/test/test_utils.dart b/webdev/test/test_utils.dart index d6d68372d..c37cdba22 100644 --- a/webdev/test/test_utils.dart +++ b/webdev/test/test_utils.dart @@ -61,7 +61,11 @@ class TestRunner { }) async { final fullArgs = [_webdevBin, ...args]; - if (!raw) { + // 'help' doesn't accept additional args. + final isHelp = + args.contains('help') || args.contains('--help') || args.contains('-h'); + + if (!raw && !isHelp) { if (canaryFeatures) { final dashDashIndex = fullArgs.indexOf('--'); if (dashDashIndex != -1) { From d6d72504d5aff96969769ca238c43f5fd18fe66a Mon Sep 17 00:00:00 2001 From: MarkZ Date: Mon, 1 Jun 2026 13:08:14 -0700 Subject: [PATCH 3/4] Updating changelog and versions --- webdev/CHANGELOG.md | 9 ++++----- webdev/pubspec.yaml | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/webdev/CHANGELOG.md b/webdev/CHANGELOG.md index 12e0d8462..67413c2d7 100644 --- a/webdev/CHANGELOG.md +++ b/webdev/CHANGELOG.md @@ -1,15 +1,14 @@ -## 3.10.0 -- Use the DDC Library Bundle module format to by default (instead of AMD). - - Note: opt out by passing `--module-format amd` -- Remove the requirement for the `--canary` flag when selecting the `--module-format=ddc` option. -## 3.9.0-wip +## 3.9.0 - Fix webdev failing to compile in aot mode due to missing DDS arguments. - Bump `dds` to `^5.3.0`. - Bump `dwds` to `^27.0.3`. - Fix issue where hot restarts/reloads without local file changes would sometimes cause DDC to hang. - Add 'web-hot-reload' experimental feature flag. +- Use the DDC Library Bundle module format by default. + - If your use case depends on internal details of the old (AMD) module format, you can restore it by passing`--module-format amd`. The old module format will be removed in a future release, so please let us know. +- Remove the requirement for the `--canary` flag when selecting the `--module-format=ddc` option. ## 3.8.2 diff --git a/webdev/pubspec.yaml b/webdev/pubspec.yaml index 95bb21c89..99dddfd69 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.9.0-wip +version: 3.9.0 # We should not depend on a dev SDK before publishing. # publish_to: none description: >- From d5c889f4a4f7038e6aec66ea94e718707553c712 Mon Sep 17 00:00:00 2001 From: MarkZ Date: Mon, 1 Jun 2026 13:46:40 -0700 Subject: [PATCH 4/4] Updating version.dart --- webdev/lib/src/version.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webdev/lib/src/version.dart b/webdev/lib/src/version.dart index c7f6b71b6..1164f1232 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.9.0-wip'; +const packageVersion = '3.9.0';