From 8edbcacfb07aa2d7f5fbb289b724515b300de047 Mon Sep 17 00:00:00 2001 From: MarkZ Date: Wed, 24 Jan 2024 21:22:25 +0000 Subject: [PATCH] [ddc] Removing some references to "legacy" DDC modules. "DDC" is now the accepted name for the module system. Change-Id: I655219ccc7cff7ff99b1311518ef6ed6e7d1b2a6 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348085 Reviewed-by: Jake Macdonald Commit-Queue: Mark Zhou Reviewed-by: Nicholas Shahan --- pkg/dev_compiler/lib/src/compiler/module_builder.dart | 2 -- pkg/dev_compiler/lib/src/compiler/shared_command.dart | 2 +- pkg/dev_compiler/test/worker/worker_test.dart | 4 ++-- pkg/dev_compiler/tool/ddb | 2 +- pkg/test_runner/lib/src/compiler_configuration.dart | 4 ++-- tests/dartdevc/debugger/debugger_test.dart | 2 +- utils/ddc/BUILD.gn | 8 ++++---- 7 files changed, 11 insertions(+), 13 deletions(-) diff --git a/pkg/dev_compiler/lib/src/compiler/module_builder.dart b/pkg/dev_compiler/lib/src/compiler/module_builder.dart index 5ad6ef82ace..d9d4252b348 100644 --- a/pkg/dev_compiler/lib/src/compiler/module_builder.dart +++ b/pkg/dev_compiler/lib/src/compiler/module_builder.dart @@ -82,7 +82,6 @@ void addModuleFormatOptions(ArgParser argParser, {bool hide = true}) { Program transformModuleFormat(ModuleFormat format, Program module) { switch (format) { case ModuleFormat.ddc: - // Legacy format always generates output compatible with single file mode. return DdcModuleBuilder().build(module); case ModuleFormat.common: return CommonJSModuleBuilder().build(module); @@ -108,7 +107,6 @@ Fun transformFunctionModuleFormat( List items, Fun function, ModuleFormat format) { switch (format) { case ModuleFormat.ddc: - // Legacy format always generates output compatible with single file mode. return DdcModuleBuilder().buildFunctionWithImports(items, function); case ModuleFormat.amd: return AmdModuleBuilder().buildFunctionWithImports(items, function); diff --git a/pkg/dev_compiler/lib/src/compiler/shared_command.dart b/pkg/dev_compiler/lib/src/compiler/shared_command.dart index 4b291881844..ef3f2df9297 100644 --- a/pkg/dev_compiler/lib/src/compiler/shared_command.dart +++ b/pkg/dev_compiler/lib/src/compiler/shared_command.dart @@ -304,7 +304,7 @@ Map _parseCustomSummaryModules(List summaryPaths, modulePath = summaryPath.substring(equalSign + 1); summaryPath = summaryPath.substring(0, equalSign); } else if (moduleRoot != null && p.isWithin(moduleRoot, summaryPath)) { - // TODO(jmesserly): remove this, it's legacy --module-root support. + // TODO: Determine if this logic is still needed. modulePath = p.url.joinAll( p.split(p.relative(summaryPathWithoutExt, from: moduleRoot))); } else { diff --git a/pkg/dev_compiler/test/worker/worker_test.dart b/pkg/dev_compiler/test/worker/worker_test.dart index c415e45f5ac..b6652aac85b 100644 --- a/pkg/dev_compiler/test/worker/worker_test.dart +++ b/pkg/dev_compiler/test/worker/worker_test.dart @@ -144,10 +144,10 @@ void main() { expect(outputJsFile.existsSync(), isTrue); }); - test('can compile in basic mode with "legacy" modules', () async { + test('can compile in basic mode with DDC modules', () async { var args = List.from(executableArgs) ..add('--modules') - ..add('legacy') + ..add('ddc') ..addAll(compilerArgs); var result = Process.runSync(Platform.executable, args); diff --git a/pkg/dev_compiler/tool/ddb b/pkg/dev_compiler/tool/ddb index b72a75c7e03..189a0f2691b 100755 --- a/pkg/dev_compiler/tool/ddb +++ b/pkg/dev_compiler/tool/ddb @@ -219,7 +219,7 @@ void main(List args) async { break; case 'd8': d8 = true; - mod = 'legacy'; + mod = 'ddc'; break; case 'chrome': chrome = true; diff --git a/pkg/test_runner/lib/src/compiler_configuration.dart b/pkg/test_runner/lib/src/compiler_configuration.dart index f62640559ae..968959f00f0 100644 --- a/pkg/test_runner/lib/src/compiler_configuration.dart +++ b/pkg/test_runner/lib/src/compiler_configuration.dart @@ -698,14 +698,14 @@ class DevCompilerConfiguration extends CompilerConfiguration { args.addAll([ "--ignore-unrecognized-flags", "--no-summarize", - if (d8Runtime) "--modules=legacy", + if (d8Runtime) "--modules=ddc", "-o", outputFile, inputFile, ]); if (!d8Runtime) { - // TODO(sigmund): allow caching of shared packages in legacy mode too. + // TODO(sigmund): allow caching of shared packages for DDC modules too. // Link to the summaries for the available packages, so that they don't // get recompiled into the test's own module. for (var package in testPackages) { diff --git a/tests/dartdevc/debugger/debugger_test.dart b/tests/dartdevc/debugger/debugger_test.dart index a490fec90fe..4cb46295fc3 100644 --- a/tests/dartdevc/debugger/debugger_test.dart +++ b/tests/dartdevc/debugger/debugger_test.dart @@ -57,7 +57,7 @@ List get devtoolsFormatters => _devtoolsFormatters; @JS('JSON.stringify') external stringify(value, [Function replacer, int space]); -// TODO(jacobr): this is only valid if the legacy library loader is used. +// TODO(jacobr): this is only valid if the DDC library loader is used. // We need a solution that works with all library loaders. @JS('dart_library.import') external importDartLibrary(String path); diff --git a/utils/ddc/BUILD.gn b/utils/ddc/BUILD.gn index 1ef0216e6db..faed4e85ce5 100644 --- a/utils/ddc/BUILD.gn +++ b/utils/ddc/BUILD.gn @@ -440,8 +440,8 @@ template("ddc_compile_sdk") { "$js_gen_dir/common/dart_sdk.js.map", "$js_gen_dir/es6/dart_sdk.js", "$js_gen_dir/es6/dart_sdk.js.map", - "$js_gen_dir/legacy/dart_sdk.js", - "$js_gen_dir/legacy/dart_sdk.js.map", + "$js_gen_dir/ddc/dart_sdk.js", + "$js_gen_dir/ddc/dart_sdk.js.map", ] vm_args = [ "-Dsdk_hash=$sdk_hash" ] @@ -473,9 +473,9 @@ template("ddc_compile_sdk") { "-o", rebase_path("$js_gen_dir/es6/dart_sdk.js"), "--modules", - "legacy", + "ddc", "-o", - rebase_path("$js_gen_dir/legacy/dart_sdk.js"), + rebase_path("$js_gen_dir/ddc/dart_sdk.js"), rebase_path("$platform_input"), ]