From 0be38009996808553d313b9c42deaa730d70397b Mon Sep 17 00:00:00 2001 From: MarkZ Date: Wed, 10 Dec 2025 14:09:52 -0800 Subject: [PATCH 1/8] Using the DDC Library Bundle module system by default --- build_web_compilers/lib/builders.dart | 2 +- build_web_compilers/lib/src/dev_compiler_bootstrap.dart | 2 +- build_web_compilers/lib/src/dev_compiler_builder.dart | 2 +- build_web_compilers/lib/src/web_entrypoint_builder.dart | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build_web_compilers/lib/builders.dart b/build_web_compilers/lib/builders.dart index 6a41ce7df..349fae1f1 100644 --- a/build_web_compilers/lib/builders.dart +++ b/build_web_compilers/lib/builders.dart @@ -250,7 +250,7 @@ bool _readWebHotReloadOption(BuilderOptions options) { } bool _readDdcLibraryBundleOption(BuilderOptions options) { - return options.config[_ddcLibraryBundleOption] as bool? ?? false; + return options.config[_ddcLibraryBundleOption] as bool? ?? true; } bool _readUseUiLibrariesOption(BuilderOptions options) { diff --git a/build_web_compilers/lib/src/dev_compiler_bootstrap.dart b/build_web_compilers/lib/src/dev_compiler_bootstrap.dart index 6ded491fe..c92e1c283 100644 --- a/build_web_compilers/lib/src/dev_compiler_bootstrap.dart +++ b/build_web_compilers/lib/src/dev_compiler_bootstrap.dart @@ -37,7 +37,7 @@ Future bootstrapDdc( String entrypointExtension = jsEntrypointExtension, required bool? nativeNullAssertions, bool usesWebHotReload = false, - bool ddcLibraryBundle = false, + bool ddcLibraryBundle = true, bool unsafeAllowUnsupportedModules = false, }) async { // Ensures that the sdk resources are built and available. diff --git a/build_web_compilers/lib/src/dev_compiler_builder.dart b/build_web_compilers/lib/src/dev_compiler_builder.dart index 3ca325b73..b3cbe9677 100644 --- a/build_web_compilers/lib/src/dev_compiler_builder.dart +++ b/build_web_compilers/lib/src/dev_compiler_builder.dart @@ -74,7 +74,7 @@ class DevCompilerBuilder implements Builder { this.generateFullDill = false, this.emitDebugSymbols = false, this.canaryFeatures = false, - this.ddcLibraryBundle = false, + this.ddcLibraryBundle = true, this.trackUnusedInputs = false, required this.platform, String? sdkKernelPath, diff --git a/build_web_compilers/lib/src/web_entrypoint_builder.dart b/build_web_compilers/lib/src/web_entrypoint_builder.dart index 0c6d1f396..741e07b8d 100644 --- a/build_web_compilers/lib/src/web_entrypoint_builder.dart +++ b/build_web_compilers/lib/src/web_entrypoint_builder.dart @@ -149,7 +149,7 @@ final class EntrypointBuilderOptions { this.nativeNullAssertions, this.loaderExtension, this.usesWebHotReload = false, - this.ddcLibraryBundle = false, + this.ddcLibraryBundle = true, this.librariesPath, this.unsafeAllowUnsupportedModules = false, }); @@ -281,8 +281,8 @@ final class EntrypointBuilderOptions { config.containsKey(loaderOption) ? config[loaderOption] as String? : defaultLoaderOption, - usesWebHotReload: usesWebHotReload ?? false, - ddcLibraryBundle: usesDdcLibraryBundle ?? false, + usesWebHotReload: usesWebHotReload ?? true, + ddcLibraryBundle: usesDdcLibraryBundle ?? true, librariesPath: librariesPath, unsafeAllowUnsupportedModules: unsafeAllowUnsupportedModules ?? false, ); From 29182f7692436f23c5924c26ee18d52f8332dfa5 Mon Sep 17 00:00:00 2001 From: MarkZ Date: Wed, 10 Dec 2025 14:43:39 -0800 Subject: [PATCH 2/8] updating tests --- .../test/dev_compiler_bootstrap_test.dart | 42 ++++++++---------- .../test/dev_compiler_builder_test.dart | 44 +++++++++++++------ 2 files changed, 50 insertions(+), 36 deletions(-) diff --git a/build_web_compilers/test/dev_compiler_bootstrap_test.dart b/build_web_compilers/test/dev_compiler_bootstrap_test.dart index 7891275d1..1c76db443 100644 --- a/build_web_compilers/test/dev_compiler_bootstrap_test.dart +++ b/build_web_compilers/test/dev_compiler_bootstrap_test.dart @@ -12,18 +12,24 @@ import 'package:build_web_compilers/builders.dart'; import 'package:file/memory.dart'; import 'package:test/test.dart'; +final defaultBuilderOptions = const BuilderOptions({ + 'compiler': 'dartdevc', + 'ddc-library-bundle': false, + 'native_null_assertions': false, +}); + void main() { initializePlatforms(); final startingBuilders = { // Uses the real sdk copy builder to copy required files from the SDK. sdkJsCopyRequirejs(const BuilderOptions({})), - sdkJsCompile(const BuilderOptions({})), + sdkJsCompile(defaultBuilderOptions), const ModuleLibraryBuilder(), MetaModuleBuilder(ddcPlatform), MetaModuleCleanBuilder(ddcPlatform), ModuleBuilder(ddcPlatform), ddcKernelBuilder(const BuilderOptions({})), - DevCompilerBuilder(platform: ddcPlatform), + DevCompilerBuilder(platform: ddcPlatform, ddcLibraryBundle: false), }; group('simple project', () { @@ -85,12 +91,7 @@ void main() { test('can bootstrap dart entrypoints', () async { // Just do some basic sanity checking, integration tests will validate // things actually work. - final builder = WebEntrypointBuilder.fromOptions( - const BuilderOptions({ - 'compiler': 'dartdevc', - 'native_null_assertions': false, - }), - ); + final builder = WebEntrypointBuilder.fromOptions(defaultBuilderOptions); final expectedOutputs = Map.of(startingExpectedOutputs)..addAll({ 'a|web/index.dart.bootstrap.js': decodedMatches( allOf([ @@ -122,12 +123,7 @@ void main() { }); group('regression tests', () { test('root dart file is not the primary source, #2269', () async { - final builder = WebEntrypointBuilder.fromOptions( - const BuilderOptions({ - 'compiler': 'dartdevc', - 'native_null_assertions': false, - }), - ); + final builder = WebEntrypointBuilder.fromOptions(defaultBuilderOptions); final assets = { // Becomes the primary source for the module, since it we alpha-sort. 'a|web/a.dart': ''' @@ -187,12 +183,7 @@ void main() { }); test('root dart file is under lib', () async { - final builder = WebEntrypointBuilder.fromOptions( - const BuilderOptions({ - 'compiler': 'dartdevc', - 'native_null_assertions': false, - }), - ); + final builder = WebEntrypointBuilder.fromOptions(defaultBuilderOptions); final assets = { 'a|lib/app.dart': 'void main() {}', // Add a fake asset so that the build_web_compilers package exists. @@ -235,7 +226,9 @@ void main() { }); test('can enable canary features for SDK', () async { - final builder = sdkJsCompile(const BuilderOptions({'canary': true})); + final builder = sdkJsCompile( + const BuilderOptions({'canary': true, 'ddc-library-bundle': false}), + ); final sdkAssets = {'build_web_compilers|fake.txt': ''}; final expectedOutputs = { 'build_web_compilers|lib/src/dev_compiler/dart_sdk.js': decodedMatches( @@ -247,7 +240,7 @@ void main() { }); test('does not enable canary features for SDK by default', () async { - final builder = sdkJsCompile(const BuilderOptions({})); + final builder = sdkJsCompile(defaultBuilderOptions); final sdkAssets = {'build_web_compilers|fake.txt': ''}; final expectedOutputs = { 'build_web_compilers|lib/src/dev_compiler/dart_sdk.js': decodedMatches( @@ -260,7 +253,10 @@ void main() { test('can use prebuilt sdk from path', () async { final builder = sdkJsCompile( - const BuilderOptions({'use-prebuilt-sdk-from-path': 'path/to/sdk'}), + const BuilderOptions({ + 'use-prebuilt-sdk-from-path': 'path/to/sdk', + 'ddc-library-bundle': false, + }), ); final sdkAssets = {'build_web_compilers|fake.txt': ''}; final expectedOutputs = { diff --git a/build_web_compilers/test/dev_compiler_builder_test.dart b/build_web_compilers/test/dev_compiler_builder_test.dart index 235bdd3b7..60e166217 100644 --- a/build_web_compilers/test/dev_compiler_builder_test.dart +++ b/build_web_compilers/test/dev_compiler_builder_test.dart @@ -10,6 +10,11 @@ import 'package:build_web_compilers/builders.dart'; import 'package:logging/logging.dart'; import 'package:test/test.dart'; +final builderOptions = const BuilderOptions({ + 'track-unused-inputs': false, + 'ddc-library-bundle': true, +}); + void main() { initializePlatforms(); @@ -37,7 +42,7 @@ void main() { MetaModuleBuilder(ddcPlatform), MetaModuleCleanBuilder(ddcPlatform), ModuleBuilder(ddcPlatform), - ddcKernelBuilder(const BuilderOptions({'track-unused-inputs': false})), + ddcKernelBuilder(builderOptions), ]; final startingExpectedOutputs = { 'a|lib/.ddc.meta_module.clean': isNotNull, @@ -78,6 +83,7 @@ void main() { platform: ddcPlatform, useIncrementalCompiler: trackUnusedInputs, trackUnusedInputs: trackUnusedInputs, + ddcLibraryBundle: false, ); final expectedOutputs = Map.of(startingExpectedOutputs)..addAll({ @@ -125,6 +131,7 @@ void main() { final builder = DevCompilerBuilder( platform: ddcPlatform, environment: {'foo': 'zap'}, + ddcLibraryBundle: false, ); final expectedOutputs = Map.of(startingExpectedOutputs)..addAll({ 'a|lib/a$jsModuleExtension': isNotNull, @@ -150,6 +157,7 @@ void main() { final builder = DevCompilerBuilder( platform: ddcPlatform, canaryFeatures: true, + ddcLibraryBundle: false, ); final expectedOutputs = Map.of(startingExpectedOutputs)..addAll({ 'a|lib/a$jsModuleExtension': decodedMatches(contains('canary')), @@ -170,7 +178,10 @@ void main() { }); test('does not enable DDC canary features by default', () async { - final builder = DevCompilerBuilder(platform: ddcPlatform); + final builder = DevCompilerBuilder( + platform: ddcPlatform, + ddcLibraryBundle: false, + ); final expectedOutputs = Map.of(startingExpectedOutputs)..addAll({ 'a|lib/a$jsModuleExtension': decodedMatches(isNot(contains('canary'))), 'a|lib/a$jsSourceMapExtension': isNotNull, @@ -193,6 +204,7 @@ void main() { final builder = DevCompilerBuilder( platform: ddcPlatform, generateFullDill: true, + ddcLibraryBundle: false, ); final expectedOutputs = Map.of(startingExpectedOutputs)..addAll({ 'a|lib/a$fullKernelExtension': isNotNull, @@ -216,7 +228,10 @@ void main() { }); test('does not generate full dill by default', () async { - final builder = DevCompilerBuilder(platform: ddcPlatform); + final builder = DevCompilerBuilder( + platform: ddcPlatform, + ddcLibraryBundle: false, + ); final expectedOutputs = Map.of(startingExpectedOutputs)..addAll({ 'a|lib/a$jsModuleExtension': isNotNull, 'a|lib/a$jsSourceMapExtension': isNotNull, @@ -239,6 +254,7 @@ void main() { final builder = DevCompilerBuilder( platform: ddcPlatform, emitDebugSymbols: true, + ddcLibraryBundle: false, ); final expectedOutputs = Map.of(startingExpectedOutputs)..addAll({ 'a|lib/a$jsModuleExtension': isNotNull, @@ -262,7 +278,10 @@ void main() { }); test('does not emit debug symbols by default', () async { - final builder = DevCompilerBuilder(platform: ddcPlatform); + final builder = DevCompilerBuilder( + platform: ddcPlatform, + ddcLibraryBundle: false, + ); final expectedOutputs = Map.of(startingExpectedOutputs)..addAll({ 'b|lib/b$jsModuleExtension': isNotNull, 'b|lib/b$jsSourceMapExtension': isNotNull, @@ -282,7 +301,10 @@ void main() { }); test('strips scratch paths from metadata', () async { - final builder = DevCompilerBuilder(platform: ddcPlatform); + final builder = DevCompilerBuilder( + platform: ddcPlatform, + ddcLibraryBundle: false, + ); final expectedOutputs = Map.of(startingExpectedOutputs)..addAll({ 'a|lib/a$jsModuleExtension': isNotNull, 'a|lib/a$jsSourceMapExtension': isNotNull, @@ -330,10 +352,8 @@ void main() { MetaModuleBuilder(ddcPlatform), MetaModuleCleanBuilder(ddcPlatform), ModuleBuilder(ddcPlatform), - ddcKernelBuilder( - const BuilderOptions({'track-unused-inputs': false}), - ), - DevCompilerBuilder(platform: ddcPlatform), + ddcKernelBuilder(builderOptions), + DevCompilerBuilder(platform: ddcPlatform, ddcLibraryBundle: false), ], assets, outputs: expectedOutputs, @@ -378,10 +398,8 @@ void main() { MetaModuleBuilder(ddcPlatform), MetaModuleCleanBuilder(ddcPlatform), ModuleBuilder(ddcPlatform), - ddcKernelBuilder( - const BuilderOptions({'track-unused-inputs': false}), - ), - DevCompilerBuilder(platform: ddcPlatform), + ddcKernelBuilder(builderOptions), + DevCompilerBuilder(platform: ddcPlatform, ddcLibraryBundle: false), ], assets, outputs: expectedOutputs, From 999e81e0ff6c7cea28227e8c8ba2b885a8bc7cf6 Mon Sep 17 00:00:00 2001 From: MarkZ Date: Wed, 10 Dec 2025 14:54:13 -0800 Subject: [PATCH 3/8] updating logic --- .../lib/src/web_entrypoint_builder.dart | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/build_web_compilers/lib/src/web_entrypoint_builder.dart b/build_web_compilers/lib/src/web_entrypoint_builder.dart index 741e07b8d..a3266d3fd 100644 --- a/build_web_compilers/lib/src/web_entrypoint_builder.dart +++ b/build_web_compilers/lib/src/web_entrypoint_builder.dart @@ -188,9 +188,11 @@ final class EntrypointBuilderOptions { final config = options.config; final nativeNullAssertions = options.config[nativeNullAssertionsOption] as bool?; - final usesWebHotReload = options.config[webHotReloadOption] as bool?; + final usesWebHotReload = + options.config[webHotReloadOption] as bool? ?? false; final usesDdcLibraryBundle = - usesWebHotReload ?? options.config[ddcLibraryBundleOption] as bool?; + usesWebHotReload || + (options.config[ddcLibraryBundleOption] as bool? ?? true); final librariesPath = options.config[librariesPathOption] as String?; final unsafeAllowUnsupportedModules = options.config[unsafeAllowUnsupportedModulesOption] as bool?; @@ -281,8 +283,8 @@ final class EntrypointBuilderOptions { config.containsKey(loaderOption) ? config[loaderOption] as String? : defaultLoaderOption, - usesWebHotReload: usesWebHotReload ?? true, - ddcLibraryBundle: usesDdcLibraryBundle ?? true, + usesWebHotReload: usesWebHotReload, + ddcLibraryBundle: usesDdcLibraryBundle, librariesPath: librariesPath, unsafeAllowUnsupportedModules: unsafeAllowUnsupportedModules ?? false, ); From 5a7eb35f76ab1bac867a0198465e35d934b734a4 Mon Sep 17 00:00:00 2001 From: MarkZ Date: Wed, 10 Dec 2025 15:10:53 -0800 Subject: [PATCH 4/8] cleaning up build_web_compilers for easier ddc library bundle flag flip --- build_web_compilers/lib/builders.dart | 2 +- .../lib/src/dev_compiler_bootstrap.dart | 2 +- .../lib/src/web_entrypoint_builder.dart | 4 +-- .../ddc_library_bundle_bootstrap_test.dart | 9 ++++-- .../test/ddc_library_bundle_builder_test.dart | 32 ++++++++++++------- .../test/dev_compiler_bootstrap_test.dart | 9 ++++-- .../test/dev_compiler_builder_test.dart | 32 ++++++++++++------- 7 files changed, 58 insertions(+), 32 deletions(-) diff --git a/build_web_compilers/lib/builders.dart b/build_web_compilers/lib/builders.dart index 349fae1f1..6a41ce7df 100644 --- a/build_web_compilers/lib/builders.dart +++ b/build_web_compilers/lib/builders.dart @@ -250,7 +250,7 @@ bool _readWebHotReloadOption(BuilderOptions options) { } bool _readDdcLibraryBundleOption(BuilderOptions options) { - return options.config[_ddcLibraryBundleOption] as bool? ?? true; + return options.config[_ddcLibraryBundleOption] as bool? ?? false; } bool _readUseUiLibrariesOption(BuilderOptions options) { diff --git a/build_web_compilers/lib/src/dev_compiler_bootstrap.dart b/build_web_compilers/lib/src/dev_compiler_bootstrap.dart index c92e1c283..6ded491fe 100644 --- a/build_web_compilers/lib/src/dev_compiler_bootstrap.dart +++ b/build_web_compilers/lib/src/dev_compiler_bootstrap.dart @@ -37,7 +37,7 @@ Future bootstrapDdc( String entrypointExtension = jsEntrypointExtension, required bool? nativeNullAssertions, bool usesWebHotReload = false, - bool ddcLibraryBundle = true, + bool ddcLibraryBundle = false, bool unsafeAllowUnsupportedModules = false, }) async { // Ensures that the sdk resources are built and available. diff --git a/build_web_compilers/lib/src/web_entrypoint_builder.dart b/build_web_compilers/lib/src/web_entrypoint_builder.dart index a3266d3fd..68e814e21 100644 --- a/build_web_compilers/lib/src/web_entrypoint_builder.dart +++ b/build_web_compilers/lib/src/web_entrypoint_builder.dart @@ -149,7 +149,7 @@ final class EntrypointBuilderOptions { this.nativeNullAssertions, this.loaderExtension, this.usesWebHotReload = false, - this.ddcLibraryBundle = true, + this.ddcLibraryBundle = false, this.librariesPath, this.unsafeAllowUnsupportedModules = false, }); @@ -192,7 +192,7 @@ final class EntrypointBuilderOptions { options.config[webHotReloadOption] as bool? ?? false; final usesDdcLibraryBundle = usesWebHotReload || - (options.config[ddcLibraryBundleOption] as bool? ?? true); + (options.config[ddcLibraryBundleOption] as bool? ?? false); final librariesPath = options.config[librariesPathOption] as String?; final unsafeAllowUnsupportedModules = options.config[unsafeAllowUnsupportedModulesOption] as bool?; diff --git a/build_web_compilers/test/ddc_library_bundle_bootstrap_test.dart b/build_web_compilers/test/ddc_library_bundle_bootstrap_test.dart index c0274305a..b0aa4e901 100644 --- a/build_web_compilers/test/ddc_library_bundle_bootstrap_test.dart +++ b/build_web_compilers/test/ddc_library_bundle_bootstrap_test.dart @@ -9,9 +9,11 @@ import 'package:build_web_compilers/build_web_compilers.dart'; import 'package:build_web_compilers/builders.dart'; import 'package:test/test.dart'; +const ddcLibraryBundle = true; + final defaultBuilderOptions = const BuilderOptions({ 'compiler': 'dartdevc', - 'ddc-library-bundle': true, + 'ddc-library-bundle': ddcLibraryBundle, 'native_null_assertions': false, }); @@ -27,7 +29,10 @@ void main() { MetaModuleCleanBuilder(ddcPlatform), ModuleBuilder(ddcPlatform), ddcKernelBuilder(const BuilderOptions({})), - DevCompilerBuilder(platform: ddcPlatform, ddcLibraryBundle: true), + DevCompilerBuilder( + platform: ddcPlatform, + ddcLibraryBundle: ddcLibraryBundle, + ), }; group('DDC Library Bundle:', () { group('simple project', () { diff --git a/build_web_compilers/test/ddc_library_bundle_builder_test.dart b/build_web_compilers/test/ddc_library_bundle_builder_test.dart index b6b16fde4..2fd73cf20 100644 --- a/build_web_compilers/test/ddc_library_bundle_builder_test.dart +++ b/build_web_compilers/test/ddc_library_bundle_builder_test.dart @@ -10,9 +10,11 @@ import 'package:build_web_compilers/builders.dart'; import 'package:logging/logging.dart'; import 'package:test/test.dart'; +const ddcLibraryBundle = true; + final builderOptions = const BuilderOptions({ 'track-unused-inputs': false, - 'ddc-library-bundle': true, + 'ddc-library-bundle': ddcLibraryBundle, }); void main() { @@ -84,7 +86,7 @@ void main() { platform: ddcPlatform, useIncrementalCompiler: trackUnusedInputs, trackUnusedInputs: trackUnusedInputs, - ddcLibraryBundle: true, + ddcLibraryBundle: ddcLibraryBundle, ); final expectedOutputs = Map.of(startingExpectedOutputs)..addAll({ @@ -132,7 +134,7 @@ void main() { final builder = DevCompilerBuilder( platform: ddcPlatform, environment: {'foo': 'zap'}, - ddcLibraryBundle: true, + ddcLibraryBundle: ddcLibraryBundle, ); final expectedOutputs = Map.of(startingExpectedOutputs)..addAll({ 'a|lib/a$jsModuleExtension': isNotNull, @@ -158,7 +160,7 @@ void main() { final builder = DevCompilerBuilder( platform: ddcPlatform, canaryFeatures: true, - ddcLibraryBundle: true, + ddcLibraryBundle: ddcLibraryBundle, ); final expectedOutputs = Map.of(startingExpectedOutputs)..addAll({ 'a|lib/a$jsModuleExtension': decodedMatches(contains('canary')), @@ -183,7 +185,7 @@ void main() { () async { final builder = DevCompilerBuilder( platform: ddcPlatform, - ddcLibraryBundle: true, + ddcLibraryBundle: ddcLibraryBundle, ); final expectedOutputs = Map.of(startingExpectedOutputs)..addAll({ 'a|lib/a$jsModuleExtension': decodedMatches( @@ -213,7 +215,7 @@ void main() { final builder = DevCompilerBuilder( platform: ddcPlatform, generateFullDill: true, - ddcLibraryBundle: true, + ddcLibraryBundle: ddcLibraryBundle, ); final expectedOutputs = Map.of(startingExpectedOutputs)..addAll({ 'a|lib/a$fullKernelExtension': isNotNull, @@ -239,7 +241,7 @@ void main() { test('does not generate full dill by default', () async { final builder = DevCompilerBuilder( platform: ddcPlatform, - ddcLibraryBundle: true, + ddcLibraryBundle: ddcLibraryBundle, ); final expectedOutputs = Map.of(startingExpectedOutputs)..addAll({ 'a|lib/a$jsModuleExtension': isNotNull, @@ -263,7 +265,7 @@ void main() { final builder = DevCompilerBuilder( platform: ddcPlatform, emitDebugSymbols: true, - ddcLibraryBundle: true, + ddcLibraryBundle: ddcLibraryBundle, ); final expectedOutputs = Map.of(startingExpectedOutputs)..addAll({ 'a|lib/a$jsModuleExtension': isNotNull, @@ -289,7 +291,7 @@ void main() { test('does not emit debug symbols by default', () async { final builder = DevCompilerBuilder( platform: ddcPlatform, - ddcLibraryBundle: true, + ddcLibraryBundle: ddcLibraryBundle, ); final expectedOutputs = Map.of(startingExpectedOutputs)..addAll({ 'b|lib/b$jsModuleExtension': isNotNull, @@ -312,7 +314,7 @@ void main() { test('strips scratch paths from metadata', () async { final builder = DevCompilerBuilder( platform: ddcPlatform, - ddcLibraryBundle: true, + ddcLibraryBundle: ddcLibraryBundle, ); final expectedOutputs = Map.of(startingExpectedOutputs)..addAll({ 'a|lib/a$jsModuleExtension': isNotNull, @@ -366,7 +368,10 @@ void main() { MetaModuleCleanBuilder(ddcPlatform), ModuleBuilder(ddcPlatform), ddcKernelBuilder(builderOptions), - DevCompilerBuilder(platform: ddcPlatform, ddcLibraryBundle: true), + DevCompilerBuilder( + platform: ddcPlatform, + ddcLibraryBundle: ddcLibraryBundle, + ), ], assets, outputs: expectedOutputs, @@ -412,7 +417,10 @@ void main() { MetaModuleCleanBuilder(ddcPlatform), ModuleBuilder(ddcPlatform), ddcKernelBuilder(builderOptions), - DevCompilerBuilder(platform: ddcPlatform, ddcLibraryBundle: true), + DevCompilerBuilder( + platform: ddcPlatform, + ddcLibraryBundle: ddcLibraryBundle, + ), ], assets, outputs: expectedOutputs, diff --git a/build_web_compilers/test/dev_compiler_bootstrap_test.dart b/build_web_compilers/test/dev_compiler_bootstrap_test.dart index 1c76db443..79a1d0f79 100644 --- a/build_web_compilers/test/dev_compiler_bootstrap_test.dart +++ b/build_web_compilers/test/dev_compiler_bootstrap_test.dart @@ -12,9 +12,11 @@ import 'package:build_web_compilers/builders.dart'; import 'package:file/memory.dart'; import 'package:test/test.dart'; +const ddcLibraryBundle = false; + final defaultBuilderOptions = const BuilderOptions({ 'compiler': 'dartdevc', - 'ddc-library-bundle': false, + 'ddc-library-bundle': ddcLibraryBundle, 'native_null_assertions': false, }); @@ -29,7 +31,10 @@ void main() { MetaModuleCleanBuilder(ddcPlatform), ModuleBuilder(ddcPlatform), ddcKernelBuilder(const BuilderOptions({})), - DevCompilerBuilder(platform: ddcPlatform, ddcLibraryBundle: false), + DevCompilerBuilder( + platform: ddcPlatform, + ddcLibraryBundle: ddcLibraryBundle, + ), }; group('simple project', () { diff --git a/build_web_compilers/test/dev_compiler_builder_test.dart b/build_web_compilers/test/dev_compiler_builder_test.dart index 60e166217..530387954 100644 --- a/build_web_compilers/test/dev_compiler_builder_test.dart +++ b/build_web_compilers/test/dev_compiler_builder_test.dart @@ -10,9 +10,11 @@ import 'package:build_web_compilers/builders.dart'; import 'package:logging/logging.dart'; import 'package:test/test.dart'; +const ddcLibraryBundle = false; + final builderOptions = const BuilderOptions({ 'track-unused-inputs': false, - 'ddc-library-bundle': true, + 'ddc-library-bundle': ddcLibraryBundle, }); void main() { @@ -83,7 +85,7 @@ void main() { platform: ddcPlatform, useIncrementalCompiler: trackUnusedInputs, trackUnusedInputs: trackUnusedInputs, - ddcLibraryBundle: false, + ddcLibraryBundle: ddcLibraryBundle, ); final expectedOutputs = Map.of(startingExpectedOutputs)..addAll({ @@ -131,7 +133,7 @@ void main() { final builder = DevCompilerBuilder( platform: ddcPlatform, environment: {'foo': 'zap'}, - ddcLibraryBundle: false, + ddcLibraryBundle: ddcLibraryBundle, ); final expectedOutputs = Map.of(startingExpectedOutputs)..addAll({ 'a|lib/a$jsModuleExtension': isNotNull, @@ -157,7 +159,7 @@ void main() { final builder = DevCompilerBuilder( platform: ddcPlatform, canaryFeatures: true, - ddcLibraryBundle: false, + ddcLibraryBundle: ddcLibraryBundle, ); final expectedOutputs = Map.of(startingExpectedOutputs)..addAll({ 'a|lib/a$jsModuleExtension': decodedMatches(contains('canary')), @@ -180,7 +182,7 @@ void main() { test('does not enable DDC canary features by default', () async { final builder = DevCompilerBuilder( platform: ddcPlatform, - ddcLibraryBundle: false, + ddcLibraryBundle: ddcLibraryBundle, ); final expectedOutputs = Map.of(startingExpectedOutputs)..addAll({ 'a|lib/a$jsModuleExtension': decodedMatches(isNot(contains('canary'))), @@ -204,7 +206,7 @@ void main() { final builder = DevCompilerBuilder( platform: ddcPlatform, generateFullDill: true, - ddcLibraryBundle: false, + ddcLibraryBundle: ddcLibraryBundle, ); final expectedOutputs = Map.of(startingExpectedOutputs)..addAll({ 'a|lib/a$fullKernelExtension': isNotNull, @@ -230,7 +232,7 @@ void main() { test('does not generate full dill by default', () async { final builder = DevCompilerBuilder( platform: ddcPlatform, - ddcLibraryBundle: false, + ddcLibraryBundle: ddcLibraryBundle, ); final expectedOutputs = Map.of(startingExpectedOutputs)..addAll({ 'a|lib/a$jsModuleExtension': isNotNull, @@ -254,7 +256,7 @@ void main() { final builder = DevCompilerBuilder( platform: ddcPlatform, emitDebugSymbols: true, - ddcLibraryBundle: false, + ddcLibraryBundle: ddcLibraryBundle, ); final expectedOutputs = Map.of(startingExpectedOutputs)..addAll({ 'a|lib/a$jsModuleExtension': isNotNull, @@ -280,7 +282,7 @@ void main() { test('does not emit debug symbols by default', () async { final builder = DevCompilerBuilder( platform: ddcPlatform, - ddcLibraryBundle: false, + ddcLibraryBundle: ddcLibraryBundle, ); final expectedOutputs = Map.of(startingExpectedOutputs)..addAll({ 'b|lib/b$jsModuleExtension': isNotNull, @@ -303,7 +305,7 @@ void main() { test('strips scratch paths from metadata', () async { final builder = DevCompilerBuilder( platform: ddcPlatform, - ddcLibraryBundle: false, + ddcLibraryBundle: ddcLibraryBundle, ); final expectedOutputs = Map.of(startingExpectedOutputs)..addAll({ 'a|lib/a$jsModuleExtension': isNotNull, @@ -353,7 +355,10 @@ void main() { MetaModuleCleanBuilder(ddcPlatform), ModuleBuilder(ddcPlatform), ddcKernelBuilder(builderOptions), - DevCompilerBuilder(platform: ddcPlatform, ddcLibraryBundle: false), + DevCompilerBuilder( + platform: ddcPlatform, + ddcLibraryBundle: ddcLibraryBundle, + ), ], assets, outputs: expectedOutputs, @@ -399,7 +404,10 @@ void main() { MetaModuleCleanBuilder(ddcPlatform), ModuleBuilder(ddcPlatform), ddcKernelBuilder(builderOptions), - DevCompilerBuilder(platform: ddcPlatform, ddcLibraryBundle: false), + DevCompilerBuilder( + platform: ddcPlatform, + ddcLibraryBundle: ddcLibraryBundle, + ), ], assets, outputs: expectedOutputs, From fb2c82acc9935570c0aa355f90cdf7fad37284e1 Mon Sep 17 00:00:00 2001 From: MarkZ Date: Wed, 10 Dec 2025 15:16:39 -0800 Subject: [PATCH 5/8] adding wip ver --- build_web_compilers/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_web_compilers/pubspec.yaml b/build_web_compilers/pubspec.yaml index 1a03e75b6..c1487b5d6 100644 --- a/build_web_compilers/pubspec.yaml +++ b/build_web_compilers/pubspec.yaml @@ -1,5 +1,5 @@ name: build_web_compilers -version: 4.4.6 +version: 4.4.7-wip description: Builder implementations wrapping the dart2js and DDC compilers. repository: https://github.com/dart-lang/build/tree/master/build_web_compilers resolution: workspace From bcf918236e28a908aaf46301c648187f8d3ab722 Mon Sep 17 00:00:00 2001 From: MarkZ Date: Wed, 10 Dec 2025 15:19:44 -0800 Subject: [PATCH 6/8] fixing ver --- build_web_compilers/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_web_compilers/pubspec.yaml b/build_web_compilers/pubspec.yaml index c1487b5d6..c9e60fb45 100644 --- a/build_web_compilers/pubspec.yaml +++ b/build_web_compilers/pubspec.yaml @@ -1,5 +1,5 @@ name: build_web_compilers -version: 4.4.7-wip +version: 4.4.8-wip description: Builder implementations wrapping the dart2js and DDC compilers. repository: https://github.com/dart-lang/build/tree/master/build_web_compilers resolution: workspace From 3d079456c2d94476aa80b1db2cf6cdbfd3b2ed1a Mon Sep 17 00:00:00 2001 From: MarkZ Date: Wed, 10 Dec 2025 15:32:31 -0800 Subject: [PATCH 7/8] clog --- build_web_compilers/CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build_web_compilers/CHANGELOG.md b/build_web_compilers/CHANGELOG.md index 30aa5f2e1..27e7ae028 100644 --- a/build_web_compilers/CHANGELOG.md +++ b/build_web_compilers/CHANGELOG.md @@ -1,3 +1,6 @@ +## 4.4.8-wip +- Minor updates to flag resolution logic. + ## 4.4.7 - Add support for DDC's Library Bundle module system, which is compatible with web hot reload. This is not yet enabled by default. From c0bda0362425262073ba906bd50882293dfca299 Mon Sep 17 00:00:00 2001 From: MarkZ Date: Mon, 29 Dec 2025 09:14:56 -0800 Subject: [PATCH 8/8] updating versions --- build_web_compilers/CHANGELOG.md | 4 +--- build_web_compilers/pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/build_web_compilers/CHANGELOG.md b/build_web_compilers/CHANGELOG.md index 27e7ae028..4f8e00965 100644 --- a/build_web_compilers/CHANGELOG.md +++ b/build_web_compilers/CHANGELOG.md @@ -1,8 +1,6 @@ -## 4.4.8-wip -- Minor updates to flag resolution logic. - ## 4.4.7 - Add support for DDC's Library Bundle module system, which is compatible with web hot reload. This is not yet enabled by default. +- Minor updates to flag resolution logic. ## 4.4.6 - Add build options to customize the SDK used for compiling to js and wasm. diff --git a/build_web_compilers/pubspec.yaml b/build_web_compilers/pubspec.yaml index c9e60fb45..62ad361f9 100644 --- a/build_web_compilers/pubspec.yaml +++ b/build_web_compilers/pubspec.yaml @@ -1,5 +1,5 @@ name: build_web_compilers -version: 4.4.8-wip +version: 4.4.7 description: Builder implementations wrapping the dart2js and DDC compilers. repository: https://github.com/dart-lang/build/tree/master/build_web_compilers resolution: workspace