summaryrefslogtreecommitdiff
path: root/core/extensions.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2023-03-08 07:44:54 -0400
committerGitHub <noreply@github.com>2023-03-08 12:44:54 +0100
commit72fe9bb47005e720444e65a66e91559287137780 (patch)
treed529ee7f3b2c33063ba4496f8fd3dfdbac0d1355 /core/extensions.rs
parentd24c6ea27f7dea57e3bc0cda342d6cbe59782f7d (diff)
refactor: rename InternalModuleLoader to ExtModuleLoader, use ext: scheme for snapshotted modules (#18041)
This commit renames "deno_core::InternalModuleLoader" to "ExtModuleLoader" and changes the specifiers used by the modules loaded from this loader to "ext:". "internal:" scheme was really ambiguous and it's more characters than "ext:", which should result in slightly smaller snapshot size. Closes https://github.com/denoland/deno/issues/18020
Diffstat (limited to 'core/extensions.rs')
-rw-r--r--core/extensions.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/core/extensions.rs b/core/extensions.rs
index beddce4c7..0ee6790ec 100644
--- a/core/extensions.rs
+++ b/core/extensions.rs
@@ -209,7 +209,7 @@ impl ExtensionBuilder {
// use a different result struct that `ExtensionFileSource` as it's confusing
// when (and why) the remapping happens.
js_files.into_iter().map(|file_source| ExtensionFileSource {
- specifier: format!("internal:{}/{}", self.name, file_source.specifier),
+ specifier: format!("ext:{}/{}", self.name, file_source.specifier),
code: file_source.code,
});
self.js.extend(js_files);
@@ -223,7 +223,7 @@ impl ExtensionBuilder {
// use a different result struct that `ExtensionFileSource` as it's confusing
// when (and why) the remapping happens.
.map(|file_source| ExtensionFileSource {
- specifier: format!("internal:{}/{}", self.name, file_source.specifier),
+ specifier: format!("ext:{}/{}", self.name, file_source.specifier),
code: file_source.code,
});
self.esm.extend(esm_files);
@@ -287,7 +287,7 @@ impl ExtensionBuilder {
/// Helps embed JS files in an extension. Returns a vector of
/// `ExtensionFileSource`, that represent the filename and source code. All
-/// specified files are rewritten into "internal:<extension_name>/<file_name>".
+/// specified files are rewritten into "ext:<extension_name>/<file_name>".
///
/// An optional "dir" option can be specified to prefix all files with a
/// directory name.
@@ -299,8 +299,8 @@ impl ExtensionBuilder {
/// "02_goodbye.js",
/// )
/// // Produces following specifiers:
-/// - "internal:my_extension/01_hello.js"
-/// - "internal:my_extension/02_goodbye.js"
+/// - "ext:my_extension/01_hello.js"
+/// - "ext:my_extension/02_goodbye.js"
///
/// /// Example with "dir" option (for "my_extension"):
/// ```ignore
@@ -310,8 +310,8 @@ impl ExtensionBuilder {
/// "02_goodbye.js",
/// )
/// // Produces following specifiers:
-/// - "internal:my_extension/js/01_hello.js"
-/// - "internal:my_extension/js/02_goodbye.js"
+/// - "ext:my_extension/js/01_hello.js"
+/// - "ext:my_extension/js/02_goodbye.js"
/// ```
#[cfg(not(feature = "include_js_files_for_snapshotting"))]
#[macro_export]