diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2023-03-04 22:31:38 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-05 02:31:38 +0000 |
commit | b40086fd7da3729d1d59b312c89ee57747fc66a9 (patch) | |
tree | 991583010635feab13fae77e7c8a35fef0a09095 /ext/node/polyfills/module_all.ts | |
parent | 01028fcdf4f379a7285cc15079306e3ac31edcc1 (diff) |
refactor(core): include_js_files! 'dir' option doesn't change specifiers (#18019)
This commit changes "include_js_files!" macro from "deno_core"
in a way that "dir" option doesn't cause specifiers to be rewritten
to include it.
Example:
```
include_js_files! {
dir "js",
"hello.js",
}
```
The above definition required embedders to use:
`import ... from "internal:<ext_name>/js/hello.js"`.
But with this change, the "js" directory in which the files are stored
is an implementation detail, which for embedders results in:
`import ... from "internal:<ext_name>/hello.js"`.
The directory the files are stored in, is an implementation detail and
in some cases might result in a significant size difference for the
snapshot. As an example, in "deno_node" extension, we store the
source code in "polyfills" directory; which resulted in each specifier
to look like "internal:deno_node/polyfills/<module_name>", but with
this change it's "internal:deno_node/<module_name>".
Given that "deno_node" has over 100 files, many of them having
several import specifiers to the same extension, this change removes
10 characters from each import specifier.
Diffstat (limited to 'ext/node/polyfills/module_all.ts')
-rw-r--r-- | ext/node/polyfills/module_all.ts | 174 |
1 files changed, 87 insertions, 87 deletions
diff --git a/ext/node/polyfills/module_all.ts b/ext/node/polyfills/module_all.ts index 989ce55a8..35762882b 100644 --- a/ext/node/polyfills/module_all.ts +++ b/ext/node/polyfills/module_all.ts @@ -1,92 +1,92 @@ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. const internals = globalThis.__bootstrap.internals; -import _httpAgent from "internal:deno_node/polyfills/_http_agent.mjs"; -import _httpOutgoing from "internal:deno_node/polyfills/_http_outgoing.ts"; -import _streamDuplex from "internal:deno_node/polyfills/internal/streams/duplex.mjs"; -import _streamPassthrough from "internal:deno_node/polyfills/internal/streams/passthrough.mjs"; -import _streamReadable from "internal:deno_node/polyfills/internal/streams/readable.mjs"; -import _streamTransform from "internal:deno_node/polyfills/internal/streams/transform.mjs"; -import _streamWritable from "internal:deno_node/polyfills/internal/streams/writable.mjs"; -import assert from "internal:deno_node/polyfills/assert.ts"; -import assertStrict from "internal:deno_node/polyfills/assert/strict.ts"; -import asyncHooks from "internal:deno_node/polyfills/async_hooks.ts"; -import buffer from "internal:deno_node/polyfills/buffer.ts"; -import childProcess from "internal:deno_node/polyfills/child_process.ts"; -import cluster from "internal:deno_node/polyfills/cluster.ts"; -import console from "internal:deno_node/polyfills/console.ts"; -import constants from "internal:deno_node/polyfills/constants.ts"; -import crypto from "internal:deno_node/polyfills/crypto.ts"; -import dgram from "internal:deno_node/polyfills/dgram.ts"; -import diagnosticsChannel from "internal:deno_node/polyfills/diagnostics_channel.ts"; -import dns from "internal:deno_node/polyfills/dns.ts"; -import dnsPromises from "internal:deno_node/polyfills/dns/promises.ts"; -import domain from "internal:deno_node/polyfills/domain.ts"; -import events from "internal:deno_node/polyfills/events.ts"; -import fs from "internal:deno_node/polyfills/fs.ts"; -import fsPromises from "internal:deno_node/polyfills/fs/promises.ts"; -import http from "internal:deno_node/polyfills/http.ts"; -import http2 from "internal:deno_node/polyfills/http2.ts"; -import https from "internal:deno_node/polyfills/https.ts"; -import inspector from "internal:deno_node/polyfills/inspector.ts"; -import internalCp from "internal:deno_node/polyfills/internal/child_process.ts"; -import internalCryptoCertificate from "internal:deno_node/polyfills/internal/crypto/certificate.ts"; -import internalCryptoCipher from "internal:deno_node/polyfills/internal/crypto/cipher.ts"; -import internalCryptoDiffiehellman from "internal:deno_node/polyfills/internal/crypto/diffiehellman.ts"; -import internalCryptoHash from "internal:deno_node/polyfills/internal/crypto/hash.ts"; -import internalCryptoHkdf from "internal:deno_node/polyfills/internal/crypto/hkdf.ts"; -import internalCryptoKeygen from "internal:deno_node/polyfills/internal/crypto/keygen.ts"; -import internalCryptoKeys from "internal:deno_node/polyfills/internal/crypto/keys.ts"; -import internalCryptoPbkdf2 from "internal:deno_node/polyfills/internal/crypto/pbkdf2.ts"; -import internalCryptoRandom from "internal:deno_node/polyfills/internal/crypto/random.ts"; -import internalCryptoScrypt from "internal:deno_node/polyfills/internal/crypto/scrypt.ts"; -import internalCryptoSig from "internal:deno_node/polyfills/internal/crypto/sig.ts"; -import internalCryptoUtil from "internal:deno_node/polyfills/internal/crypto/util.ts"; -import internalCryptoX509 from "internal:deno_node/polyfills/internal/crypto/x509.ts"; -import internalDgram from "internal:deno_node/polyfills/internal/dgram.ts"; -import internalDnsPromises from "internal:deno_node/polyfills/internal/dns/promises.ts"; -import internalErrors from "internal:deno_node/polyfills/internal/errors.ts"; -import internalEventTarget from "internal:deno_node/polyfills/internal/event_target.mjs"; -import internalFsUtils from "internal:deno_node/polyfills/internal/fs/utils.mjs"; -import internalHttp from "internal:deno_node/polyfills/internal/http.ts"; -import internalReadlineUtils from "internal:deno_node/polyfills/internal/readline/utils.mjs"; -import internalStreamsAddAbortSignal from "internal:deno_node/polyfills/internal/streams/add-abort-signal.mjs"; -import internalStreamsBufferList from "internal:deno_node/polyfills/internal/streams/buffer_list.mjs"; -import internalStreamsLazyTransform from "internal:deno_node/polyfills/internal/streams/lazy_transform.mjs"; -import internalStreamsState from "internal:deno_node/polyfills/internal/streams/state.mjs"; -import internalTestBinding from "internal:deno_node/polyfills/internal/test/binding.ts"; -import internalTimers from "internal:deno_node/polyfills/internal/timers.mjs"; -import internalUtil from "internal:deno_node/polyfills/internal/util.mjs"; -import internalUtilInspect from "internal:deno_node/polyfills/internal/util/inspect.mjs"; -import net from "internal:deno_node/polyfills/net.ts"; -import os from "internal:deno_node/polyfills/os.ts"; -import pathPosix from "internal:deno_node/polyfills/path/posix.ts"; -import pathWin32 from "internal:deno_node/polyfills/path/win32.ts"; -import path from "internal:deno_node/polyfills/path.ts"; -import perfHooks from "internal:deno_node/polyfills/perf_hooks.ts"; -import punycode from "internal:deno_node/polyfills/punycode.ts"; -import process from "internal:deno_node/polyfills/process.ts"; -import querystring from "internal:deno_node/polyfills/querystring.ts"; -import readline from "internal:deno_node/polyfills/readline.ts"; -import readlinePromises from "internal:deno_node/polyfills/readline/promises.ts"; -import repl from "internal:deno_node/polyfills/repl.ts"; -import stream from "internal:deno_node/polyfills/stream.ts"; -import streamConsumers from "internal:deno_node/polyfills/stream/consumers.mjs"; -import streamPromises from "internal:deno_node/polyfills/stream/promises.mjs"; -import streamWeb from "internal:deno_node/polyfills/stream/web.ts"; -import stringDecoder from "internal:deno_node/polyfills/string_decoder.ts"; -import sys from "internal:deno_node/polyfills/sys.ts"; -import timers from "internal:deno_node/polyfills/timers.ts"; -import timersPromises from "internal:deno_node/polyfills/timers/promises.ts"; -import tls from "internal:deno_node/polyfills/tls.ts"; -import tty from "internal:deno_node/polyfills/tty.ts"; -import url from "internal:deno_node/polyfills/url.ts"; -import utilTypes from "internal:deno_node/polyfills/util/types.ts"; -import util from "internal:deno_node/polyfills/util.ts"; -import v8 from "internal:deno_node/polyfills/v8.ts"; -import vm from "internal:deno_node/polyfills/vm.ts"; -import workerThreads from "internal:deno_node/polyfills/worker_threads.ts"; -import wasi from "internal:deno_node/polyfills/wasi.ts"; -import zlib from "internal:deno_node/polyfills/zlib.ts"; +import _httpAgent from "internal:deno_node/_http_agent.mjs"; +import _httpOutgoing from "internal:deno_node/_http_outgoing.ts"; +import _streamDuplex from "internal:deno_node/internal/streams/duplex.mjs"; +import _streamPassthrough from "internal:deno_node/internal/streams/passthrough.mjs"; +import _streamReadable from "internal:deno_node/internal/streams/readable.mjs"; +import _streamTransform from "internal:deno_node/internal/streams/transform.mjs"; +import _streamWritable from "internal:deno_node/internal/streams/writable.mjs"; +import assert from "internal:deno_node/assert.ts"; +import assertStrict from "internal:deno_node/assert/strict.ts"; +import asyncHooks from "internal:deno_node/async_hooks.ts"; +import buffer from "internal:deno_node/buffer.ts"; +import childProcess from "internal:deno_node/child_process.ts"; +import cluster from "internal:deno_node/cluster.ts"; +import console from "internal:deno_node/console.ts"; +import constants from "internal:deno_node/constants.ts"; +import crypto from "internal:deno_node/crypto.ts"; +import dgram from "internal:deno_node/dgram.ts"; +import diagnosticsChannel from "internal:deno_node/diagnostics_channel.ts"; +import dns from "internal:deno_node/dns.ts"; +import dnsPromises from "internal:deno_node/dns/promises.ts"; +import domain from "internal:deno_node/domain.ts"; +import events from "internal:deno_node/events.ts"; +import fs from "internal:deno_node/fs.ts"; +import fsPromises from "internal:deno_node/fs/promises.ts"; +import http from "internal:deno_node/http.ts"; +import http2 from "internal:deno_node/http2.ts"; +import https from "internal:deno_node/https.ts"; +import inspector from "internal:deno_node/inspector.ts"; +import internalCp from "internal:deno_node/internal/child_process.ts"; +import internalCryptoCertificate from "internal:deno_node/internal/crypto/certificate.ts"; +import internalCryptoCipher from "internal:deno_node/internal/crypto/cipher.ts"; +import internalCryptoDiffiehellman from "internal:deno_node/internal/crypto/diffiehellman.ts"; +import internalCryptoHash from "internal:deno_node/internal/crypto/hash.ts"; +import internalCryptoHkdf from "internal:deno_node/internal/crypto/hkdf.ts"; +import internalCryptoKeygen from "internal:deno_node/internal/crypto/keygen.ts"; +import internalCryptoKeys from "internal:deno_node/internal/crypto/keys.ts"; +import internalCryptoPbkdf2 from "internal:deno_node/internal/crypto/pbkdf2.ts"; +import internalCryptoRandom from "internal:deno_node/internal/crypto/random.ts"; +import internalCryptoScrypt from "internal:deno_node/internal/crypto/scrypt.ts"; +import internalCryptoSig from "internal:deno_node/internal/crypto/sig.ts"; +import internalCryptoUtil from "internal:deno_node/internal/crypto/util.ts"; +import internalCryptoX509 from "internal:deno_node/internal/crypto/x509.ts"; +import internalDgram from "internal:deno_node/internal/dgram.ts"; +import internalDnsPromises from "internal:deno_node/internal/dns/promises.ts"; +import internalErrors from "internal:deno_node/internal/errors.ts"; +import internalEventTarget from "internal:deno_node/internal/event_target.mjs"; +import internalFsUtils from "internal:deno_node/internal/fs/utils.mjs"; +import internalHttp from "internal:deno_node/internal/http.ts"; +import internalReadlineUtils from "internal:deno_node/internal/readline/utils.mjs"; +import internalStreamsAddAbortSignal from "internal:deno_node/internal/streams/add-abort-signal.mjs"; +import internalStreamsBufferList from "internal:deno_node/internal/streams/buffer_list.mjs"; +import internalStreamsLazyTransform from "internal:deno_node/internal/streams/lazy_transform.mjs"; +import internalStreamsState from "internal:deno_node/internal/streams/state.mjs"; +import internalTestBinding from "internal:deno_node/internal/test/binding.ts"; +import internalTimers from "internal:deno_node/internal/timers.mjs"; +import internalUtil from "internal:deno_node/internal/util.mjs"; +import internalUtilInspect from "internal:deno_node/internal/util/inspect.mjs"; +import net from "internal:deno_node/net.ts"; +import os from "internal:deno_node/os.ts"; +import pathPosix from "internal:deno_node/path/posix.ts"; +import pathWin32 from "internal:deno_node/path/win32.ts"; +import path from "internal:deno_node/path.ts"; +import perfHooks from "internal:deno_node/perf_hooks.ts"; +import punycode from "internal:deno_node/punycode.ts"; +import process from "internal:deno_node/process.ts"; +import querystring from "internal:deno_node/querystring.ts"; +import readline from "internal:deno_node/readline.ts"; +import readlinePromises from "internal:deno_node/readline/promises.ts"; +import repl from "internal:deno_node/repl.ts"; +import stream from "internal:deno_node/stream.ts"; +import streamConsumers from "internal:deno_node/stream/consumers.mjs"; +import streamPromises from "internal:deno_node/stream/promises.mjs"; +import streamWeb from "internal:deno_node/stream/web.ts"; +import stringDecoder from "internal:deno_node/string_decoder.ts"; +import sys from "internal:deno_node/sys.ts"; +import timers from "internal:deno_node/timers.ts"; +import timersPromises from "internal:deno_node/timers/promises.ts"; +import tls from "internal:deno_node/tls.ts"; +import tty from "internal:deno_node/tty.ts"; +import url from "internal:deno_node/url.ts"; +import utilTypes from "internal:deno_node/util/types.ts"; +import util from "internal:deno_node/util.ts"; +import v8 from "internal:deno_node/v8.ts"; +import vm from "internal:deno_node/vm.ts"; +import workerThreads from "internal:deno_node/worker_threads.ts"; +import wasi from "internal:deno_node/wasi.ts"; +import zlib from "internal:deno_node/zlib.ts"; // Canonical mapping of supported modules const moduleAll = { |