From 6d345a5475fb6c9808ccc8bfbb8b804432e6b74c Mon Sep 17 00:00:00 2001 From: MarkZ Date: Wed, 24 Jan 2024 16:52:16 -0800 Subject: [PATCH] Adding DDC module system targets to web SDK artifacts. (flutter/engine#47783) This is part of an ongoing effort to replace DDC's module system in Flutter Web (for hot reload support). Side effects of this change include doubling the code generated by DDC whenever this build pathway is hit (until the full module system transition lands), but this shouldn't affect debug performance. We may be able to lock this behind a build flag if this is an issue. See related issue: https://github.com/dart-lang/sdk/issues/52361 --- engine/src/flutter/web_sdk/BUILD.gn | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/engine/src/flutter/web_sdk/BUILD.gn b/engine/src/flutter/web_sdk/BUILD.gn index f58a81d859e..0c453a45b51 100644 --- a/engine/src/flutter/web_sdk/BUILD.gn +++ b/engine/src/flutter/web_sdk/BUILD.gn @@ -363,9 +363,14 @@ template("_compile_ddc_modules") { amd_js_path = "$root_out_dir/flutter_web_sdk/kernel/amd${name_suffix}/dart_sdk.js" + ddc_js_path = + "$root_out_dir/flutter_web_sdk/kernel/ddc${name_suffix}/dart_sdk.js" + outputs = [ amd_js_path, amd_js_path + ".map", + ddc_js_path, + ddc_js_path + ".map", ] if (invoker.sound_null_safety) { @@ -403,6 +408,10 @@ template("_compile_ddc_modules") { "amd", "-o", rebase_path(amd_js_path), + "--modules", + "ddc", + "-o", + rebase_path(ddc_js_path), ] if (flutter_prebuilt_dart_sdk) { args += [