1
0
mirror of https://github.com/dart-lang/sdk synced 2024-07-08 12:06:26 +00:00

[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 <jakemac@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
This commit is contained in:
MarkZ 2024-01-24 21:22:25 +00:00 committed by Commit Queue
parent 728e8fdd0c
commit 8edbcacfb0
7 changed files with 11 additions and 13 deletions

View File

@ -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<ModuleItem> 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);

View File

@ -304,7 +304,7 @@ Map<String, String> _parseCustomSummaryModules(List<String> 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 {

View File

@ -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<String>.from(executableArgs)
..add('--modules')
..add('legacy')
..add('ddc')
..addAll(compilerArgs);
var result = Process.runSync(Platform.executable, args);

View File

@ -219,7 +219,7 @@ void main(List<String> args) async {
break;
case 'd8':
d8 = true;
mod = 'legacy';
mod = 'ddc';
break;
case 'chrome':
chrome = true;

View File

@ -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) {

View File

@ -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);

View File

@ -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"),
]