Skip to content

Commit

Permalink
[ddc] Renaming dart_library.js to ddc_module_loader.js
Browse files Browse the repository at this point in the history
This also removes deprecated references to the DDC module system as the "legacy" module system.

This is part of an ongoing effort to deprecate the AMD module system: #52361

Change-Id: Ic32c6c6a0b7bf2c3bf0326be42cc9a88db8e303e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348183
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
  • Loading branch information
Markzipan authored and Commit Queue committed Jan 30, 2024
1 parent b3551c5 commit 91d22a7
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 13 deletions.
3 changes: 1 addition & 2 deletions pkg/dev_compiler/lib/src/compiler/module_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,7 @@ abstract class _ModuleBuilder {
}
}

/// Generates modules for with our DDC `dart_library.js` loading mechanism.
// TODO(jmesserly): remove this and replace with something that interoperates.
/// Generates DDC modules with our `ddc_module_loader.js` loading mechanism.
class DdcModuleBuilder extends _ModuleBuilder {
/// Build a module variable definition for [import].
///
Expand Down
4 changes: 2 additions & 2 deletions pkg/dev_compiler/lib/src/kernel/command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -734,10 +734,10 @@ JSCode jsProgramToCode(js_ast.Program moduleTree, ModuleFormat format,
text = text.replaceFirst(SharedCompiler.sourceMapLocationID, rawSourceMap);

// This is intended to be used by our build/debug tools to gather metrics.
// See pkg/dev_compiler/lib/js/legacy/dart_library.js for runtime code that
// See pkg/dev_compiler/lib/js/ddc/ddc_module_loader.js for runtime code that
// reads this.
//
// These keys (see corresponding logic in dart_library.js) include:
// These keys (see corresponding logic in ddc_module_loader.js) include:
// - dartSize: <size of Dart input code in bytes>
// - sourceMapSize: <size of JS source map in bytes>
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ class ExpressionEvaluationTestDriver {
if (!File(dartSdkPath).existsSync()) {
throw Exception('Unable to find Dart SDK at $dartSdkPath');
}
var dartLibraryPath =
escaped(p.join(ddcPath, 'lib', 'js', 'legacy', 'dart_library.js'));
var dartLibraryPath = escaped(
p.join(ddcPath, 'lib', 'js', 'ddc', 'ddc_module_loader.js'));
var outputPath = output.toFilePath();
// This is used in the DDC module system for multiapp workflows and is
// stubbed here.
Expand Down
2 changes: 1 addition & 1 deletion pkg/dev_compiler/tool/ddb
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ try {
if (await process.exitCode != 0) exit(await process.exitCode);
} else if (d8) {
var runjs = '''
load("$ddcPath/lib/js/legacy/dart_library.js");
load("$ddcPath/lib/js/ddc/ddc_module_loader.js");
load("$sdkJsPath/dart_sdk.js");
load("$out");
Expand Down
2 changes: 1 addition & 1 deletion pkg/test_runner/lib/src/compiler_configuration.dart
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ class DevCompilerConfiguration extends CompilerConfiguration {
var weakNullSafetyWarnings = !(weakNullSafetyErrors || _soundNullSafety);
var repositoryUri = Uri.directory(Repository.dir.toNativePath());
var dartLibraryPath = repositoryUri
.resolve('pkg/dev_compiler/lib/js/legacy/dart_library.js')
.resolve('pkg/dev_compiler/lib/js/ddc/ddc_module_loader.js')
.path;
var sdkJsDir =
Uri.directory(_configuration.buildDirectory).resolve('$genDir/sdk');
Expand Down
10 changes: 5 additions & 5 deletions sdk/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -585,11 +585,11 @@ copy("copy_dev_compiler_amd_require_js") {
]
}

# Copies dart_library.js to lib/dev_compiler/ddc as 'ddc_module_loader.js'.
# Used to load DDC compiled legacy/DDC modules.
copy("copy_dev_compiler_ddc_dart_library_js") {
# Copies ddc_module_loader.js to lib/dev_compiler/ddc.
# Used to manage DDC library and module loading.
copy("copy_dev_compiler_ddc_module_loader_js") {
visibility = [ ":copy_dev_compiler_sdk" ]
sources = [ "../pkg/dev_compiler/lib/js/legacy/dart_library.js" ]
sources = [ "../pkg/dev_compiler/lib/js/ddc/ddc_module_loader.js" ]
outputs = [
"$root_out_dir/$dart_sdk_output/lib/dev_compiler/ddc/ddc_module_loader.js",
]
Expand All @@ -612,7 +612,7 @@ group("copy_dev_compiler_sdk") {
visibility = [ ":create_full_sdk" ]
public_deps = [
":copy_dev_compiler_amd_require_js",
":copy_dev_compiler_ddc_dart_library_js",
":copy_dev_compiler_ddc_module_loader_js",
":copy_dev_compiler_dills",
":copy_dev_compiler_stack_trace_mapper",
]
Expand Down

0 comments on commit 91d22a7

Please sign in to comment.