diff --git a/Cargo.toml b/Cargo.toml index 94b8ea470a..fdcef9848a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -205,6 +205,8 @@ opt-level = 3 opt-level = 3 [profile.bench.package.deno_crypto] opt-level = 3 +[profile.bench.package.deno_node] +opt-level = 3 [profile.bench.package.num-bigint-dig] opt-level = 3 [profile.bench.package.v8] @@ -263,6 +265,8 @@ opt-level = 3 opt-level = 3 [profile.release.package.deno_crypto] opt-level = 3 +[profile.release.package.deno_node] +opt-level = 3 [profile.release.package.deno_broadcast_channel] opt-level = 3 [profile.release.package.deno_fetch] diff --git a/ext/node/lib.rs b/ext/node/lib.rs index a1fa9408a3..d84b263398 100644 --- a/ext/node/lib.rs +++ b/ext/node/lib.rs @@ -193,55 +193,22 @@ pub fn init_polyfill() -> Extension { "internal_binding/async_wrap.ts", "internal_binding/buffer.ts", "internal_binding/cares_wrap.ts", - "internal_binding/config.ts", "internal_binding/connection_wrap.ts", "internal_binding/constants.ts", - "internal_binding/contextify.ts", - "internal_binding/credentials.ts", "internal_binding/crypto.ts", - "internal_binding/errors.ts", - "internal_binding/fs_dir.ts", - "internal_binding/fs_event_wrap.ts", - "internal_binding/fs.ts", "internal_binding/handle_wrap.ts", - "internal_binding/heap_utils.ts", - "internal_binding/http_parser.ts", - "internal_binding/icu.ts", - "internal_binding/inspector.ts", - "internal_binding/js_stream.ts", - "internal_binding/messaging.ts", "internal_binding/mod.ts", - "internal_binding/module_wrap.ts", - "internal_binding/native_module.ts", - "internal_binding/natives.ts", "internal_binding/node_file.ts", "internal_binding/node_options.ts", - "internal_binding/options.ts", - "internal_binding/os.ts", - "internal_binding/performance.ts", "internal_binding/pipe_wrap.ts", - "internal_binding/process_methods.ts", - "internal_binding/report.ts", - "internal_binding/serdes.ts", - "internal_binding/signal_wrap.ts", - "internal_binding/spawn_sync.ts", "internal_binding/stream_wrap.ts", "internal_binding/string_decoder.ts", "internal_binding/symbols.ts", - "internal_binding/task_queue.ts", "internal_binding/tcp_wrap.ts", - "internal_binding/timers.ts", - "internal_binding/tls_wrap.ts", - "internal_binding/trace_events.ts", - "internal_binding/tty_wrap.ts", "internal_binding/types.ts", "internal_binding/udp_wrap.ts", - "internal_binding/url.ts", "internal_binding/util.ts", "internal_binding/uv.ts", - "internal_binding/v8.ts", - "internal_binding/worker.ts", - "internal_binding/zlib.ts", "internal/assert.mjs", "internal/async_hooks.ts", "internal/blob.mjs", diff --git a/ext/node/polyfills/internal_binding/config.ts b/ext/node/polyfills/internal_binding/config.ts deleted file mode 100644 index 93e2042b0d..0000000000 --- a/ext/node/polyfills/internal_binding/config.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. - -export {}; diff --git a/ext/node/polyfills/internal_binding/contextify.ts b/ext/node/polyfills/internal_binding/contextify.ts deleted file mode 100644 index 93e2042b0d..0000000000 --- a/ext/node/polyfills/internal_binding/contextify.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. - -export {}; diff --git a/ext/node/polyfills/internal_binding/credentials.ts b/ext/node/polyfills/internal_binding/credentials.ts deleted file mode 100644 index 93e2042b0d..0000000000 --- a/ext/node/polyfills/internal_binding/credentials.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. - -export {}; diff --git a/ext/node/polyfills/internal_binding/errors.ts b/ext/node/polyfills/internal_binding/errors.ts deleted file mode 100644 index 93e2042b0d..0000000000 --- a/ext/node/polyfills/internal_binding/errors.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. - -export {}; diff --git a/ext/node/polyfills/internal_binding/fs.ts b/ext/node/polyfills/internal_binding/fs.ts deleted file mode 100644 index 93e2042b0d..0000000000 --- a/ext/node/polyfills/internal_binding/fs.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. - -export {}; diff --git a/ext/node/polyfills/internal_binding/fs_dir.ts b/ext/node/polyfills/internal_binding/fs_dir.ts deleted file mode 100644 index 93e2042b0d..0000000000 --- a/ext/node/polyfills/internal_binding/fs_dir.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. - -export {}; diff --git a/ext/node/polyfills/internal_binding/fs_event_wrap.ts b/ext/node/polyfills/internal_binding/fs_event_wrap.ts deleted file mode 100644 index 93e2042b0d..0000000000 --- a/ext/node/polyfills/internal_binding/fs_event_wrap.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. - -export {}; diff --git a/ext/node/polyfills/internal_binding/heap_utils.ts b/ext/node/polyfills/internal_binding/heap_utils.ts deleted file mode 100644 index 93e2042b0d..0000000000 --- a/ext/node/polyfills/internal_binding/heap_utils.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. - -export {}; diff --git a/ext/node/polyfills/internal_binding/http_parser.ts b/ext/node/polyfills/internal_binding/http_parser.ts deleted file mode 100644 index 93e2042b0d..0000000000 --- a/ext/node/polyfills/internal_binding/http_parser.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. - -export {}; diff --git a/ext/node/polyfills/internal_binding/icu.ts b/ext/node/polyfills/internal_binding/icu.ts deleted file mode 100644 index 93e2042b0d..0000000000 --- a/ext/node/polyfills/internal_binding/icu.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. - -export {}; diff --git a/ext/node/polyfills/internal_binding/inspector.ts b/ext/node/polyfills/internal_binding/inspector.ts deleted file mode 100644 index 93e2042b0d..0000000000 --- a/ext/node/polyfills/internal_binding/inspector.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. - -export {}; diff --git a/ext/node/polyfills/internal_binding/js_stream.ts b/ext/node/polyfills/internal_binding/js_stream.ts deleted file mode 100644 index 93e2042b0d..0000000000 --- a/ext/node/polyfills/internal_binding/js_stream.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. - -export {}; diff --git a/ext/node/polyfills/internal_binding/messaging.ts b/ext/node/polyfills/internal_binding/messaging.ts deleted file mode 100644 index 93e2042b0d..0000000000 --- a/ext/node/polyfills/internal_binding/messaging.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. - -export {}; diff --git a/ext/node/polyfills/internal_binding/mod.ts b/ext/node/polyfills/internal_binding/mod.ts index e8c2d37227..e7fde9cbce 100644 --- a/ext/node/polyfills/internal_binding/mod.ts +++ b/ext/node/polyfills/internal_binding/mod.ts @@ -1,100 +1,67 @@ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. import * as asyncWrap from "internal:deno_node/internal_binding/async_wrap.ts"; import * as buffer from "internal:deno_node/internal_binding/buffer.ts"; -import * as config from "internal:deno_node/internal_binding/config.ts"; import * as caresWrap from "internal:deno_node/internal_binding/cares_wrap.ts"; import * as constants from "internal:deno_node/internal_binding/constants.ts"; -import * as contextify from "internal:deno_node/internal_binding/contextify.ts"; import * as crypto from "internal:deno_node/internal_binding/crypto.ts"; -import * as credentials from "internal:deno_node/internal_binding/credentials.ts"; -import * as errors from "internal:deno_node/internal_binding/errors.ts"; -import * as fs from "internal:deno_node/internal_binding/fs.ts"; -import * as fsDir from "internal:deno_node/internal_binding/fs_dir.ts"; -import * as fsEventWrap from "internal:deno_node/internal_binding/fs_event_wrap.ts"; -import * as heapUtils from "internal:deno_node/internal_binding/heap_utils.ts"; -import * as httpParser from "internal:deno_node/internal_binding/http_parser.ts"; -import * as icu from "internal:deno_node/internal_binding/icu.ts"; -import * as inspector from "internal:deno_node/internal_binding/inspector.ts"; -import * as jsStream from "internal:deno_node/internal_binding/js_stream.ts"; -import * as messaging from "internal:deno_node/internal_binding/messaging.ts"; -import * as moduleWrap from "internal:deno_node/internal_binding/module_wrap.ts"; -import * as nativeModule from "internal:deno_node/internal_binding/native_module.ts"; -import * as natives from "internal:deno_node/internal_binding/natives.ts"; -import * as options from "internal:deno_node/internal_binding/options.ts"; -import * as os from "internal:deno_node/internal_binding/os.ts"; import * as pipeWrap from "internal:deno_node/internal_binding/pipe_wrap.ts"; -import * as performance from "internal:deno_node/internal_binding/performance.ts"; -import * as processMethods from "internal:deno_node/internal_binding/process_methods.ts"; -import * as report from "internal:deno_node/internal_binding/report.ts"; -import * as serdes from "internal:deno_node/internal_binding/serdes.ts"; -import * as signalWrap from "internal:deno_node/internal_binding/signal_wrap.ts"; -import * as spawnSync from "internal:deno_node/internal_binding/spawn_sync.ts"; import * as streamWrap from "internal:deno_node/internal_binding/stream_wrap.ts"; import * as stringDecoder from "internal:deno_node/internal_binding/string_decoder.ts"; import * as symbols from "internal:deno_node/internal_binding/symbols.ts"; -import * as taskQueue from "internal:deno_node/internal_binding/task_queue.ts"; import * as tcpWrap from "internal:deno_node/internal_binding/tcp_wrap.ts"; -import * as timers from "internal:deno_node/internal_binding/timers.ts"; -import * as tlsWrap from "internal:deno_node/internal_binding/tls_wrap.ts"; -import * as traceEvents from "internal:deno_node/internal_binding/trace_events.ts"; -import * as ttyWrap from "internal:deno_node/internal_binding/tty_wrap.ts"; import * as types from "internal:deno_node/internal_binding/types.ts"; import * as udpWrap from "internal:deno_node/internal_binding/udp_wrap.ts"; -import * as url from "internal:deno_node/internal_binding/url.ts"; import * as util from "internal:deno_node/internal_binding/util.ts"; import * as uv from "internal:deno_node/internal_binding/uv.ts"; -import * as v8 from "internal:deno_node/internal_binding/v8.ts"; -import * as worker from "internal:deno_node/internal_binding/worker.ts"; -import * as zlib from "internal:deno_node/internal_binding/zlib.ts"; const modules = { "async_wrap": asyncWrap, buffer, "cares_wrap": caresWrap, - config, + config: {}, constants, - contextify, - credentials, + contextify: {}, + credentials: {}, crypto, - errors, - fs, - "fs_dir": fsDir, - "fs_event_wrap": fsEventWrap, - "heap_utils": heapUtils, - "http_parser": httpParser, - icu, - inspector, - "js_stream": jsStream, - messaging, - "module_wrap": moduleWrap, - "native_module": nativeModule, - natives, - options, - os, - performance, + errors: {}, + fs: {}, + "fs_dir": {}, + "fs_event_wrap": {}, + "heap_utils": {}, + "http_parser": {}, + icu: {}, + inspector: {}, + "js_stream": {}, + messaging: {}, + "module_wrap": {}, + "native_module": {}, + natives: {}, + options: {}, + os: {}, + performance: {}, "pipe_wrap": pipeWrap, - "process_methods": processMethods, - report, - serdes, - "signal_wrap": signalWrap, - "spawn_sync": spawnSync, + "process_methods": {}, + report: {}, + serdes: {}, + "signal_wrap": {}, + "spawn_sync": {}, "stream_wrap": streamWrap, "string_decoder": stringDecoder, symbols, - "task_queue": taskQueue, + "task_queue": {}, "tcp_wrap": tcpWrap, - timers, - "tls_wrap": tlsWrap, - "trace_events": traceEvents, - "tty_wrap": ttyWrap, + timers: {}, + "tls_wrap": {}, + "trace_events": {}, + "tty_wrap": {}, types, "udp_wrap": udpWrap, - url, + url: {}, util, uv, - v8, - worker, - zlib, + v8: {}, + worker: {}, + zlib: {}, }; export type BindingName = keyof typeof modules; diff --git a/ext/node/polyfills/internal_binding/module_wrap.ts b/ext/node/polyfills/internal_binding/module_wrap.ts deleted file mode 100644 index 93e2042b0d..0000000000 --- a/ext/node/polyfills/internal_binding/module_wrap.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. - -export {}; diff --git a/ext/node/polyfills/internal_binding/native_module.ts b/ext/node/polyfills/internal_binding/native_module.ts deleted file mode 100644 index 93e2042b0d..0000000000 --- a/ext/node/polyfills/internal_binding/native_module.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. - -export {}; diff --git a/ext/node/polyfills/internal_binding/natives.ts b/ext/node/polyfills/internal_binding/natives.ts deleted file mode 100644 index 93e2042b0d..0000000000 --- a/ext/node/polyfills/internal_binding/natives.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. - -export {}; diff --git a/ext/node/polyfills/internal_binding/options.ts b/ext/node/polyfills/internal_binding/options.ts deleted file mode 100644 index 93e2042b0d..0000000000 --- a/ext/node/polyfills/internal_binding/options.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. - -export {}; diff --git a/ext/node/polyfills/internal_binding/os.ts b/ext/node/polyfills/internal_binding/os.ts deleted file mode 100644 index 93e2042b0d..0000000000 --- a/ext/node/polyfills/internal_binding/os.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. - -export {}; diff --git a/ext/node/polyfills/internal_binding/performance.ts b/ext/node/polyfills/internal_binding/performance.ts deleted file mode 100644 index 93e2042b0d..0000000000 --- a/ext/node/polyfills/internal_binding/performance.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. - -export {}; diff --git a/ext/node/polyfills/internal_binding/process_methods.ts b/ext/node/polyfills/internal_binding/process_methods.ts deleted file mode 100644 index 93e2042b0d..0000000000 --- a/ext/node/polyfills/internal_binding/process_methods.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. - -export {}; diff --git a/ext/node/polyfills/internal_binding/report.ts b/ext/node/polyfills/internal_binding/report.ts deleted file mode 100644 index 93e2042b0d..0000000000 --- a/ext/node/polyfills/internal_binding/report.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. - -export {}; diff --git a/ext/node/polyfills/internal_binding/serdes.ts b/ext/node/polyfills/internal_binding/serdes.ts deleted file mode 100644 index 93e2042b0d..0000000000 --- a/ext/node/polyfills/internal_binding/serdes.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. - -export {}; diff --git a/ext/node/polyfills/internal_binding/signal_wrap.ts b/ext/node/polyfills/internal_binding/signal_wrap.ts deleted file mode 100644 index 93e2042b0d..0000000000 --- a/ext/node/polyfills/internal_binding/signal_wrap.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. - -export {}; diff --git a/ext/node/polyfills/internal_binding/spawn_sync.ts b/ext/node/polyfills/internal_binding/spawn_sync.ts deleted file mode 100644 index 93e2042b0d..0000000000 --- a/ext/node/polyfills/internal_binding/spawn_sync.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. - -export {}; diff --git a/ext/node/polyfills/internal_binding/task_queue.ts b/ext/node/polyfills/internal_binding/task_queue.ts deleted file mode 100644 index 93e2042b0d..0000000000 --- a/ext/node/polyfills/internal_binding/task_queue.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. - -export {}; diff --git a/ext/node/polyfills/internal_binding/timers.ts b/ext/node/polyfills/internal_binding/timers.ts deleted file mode 100644 index 93e2042b0d..0000000000 --- a/ext/node/polyfills/internal_binding/timers.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. - -export {}; diff --git a/ext/node/polyfills/internal_binding/tls_wrap.ts b/ext/node/polyfills/internal_binding/tls_wrap.ts deleted file mode 100644 index 93e2042b0d..0000000000 --- a/ext/node/polyfills/internal_binding/tls_wrap.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. - -export {}; diff --git a/ext/node/polyfills/internal_binding/trace_events.ts b/ext/node/polyfills/internal_binding/trace_events.ts deleted file mode 100644 index 93e2042b0d..0000000000 --- a/ext/node/polyfills/internal_binding/trace_events.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. - -export {}; diff --git a/ext/node/polyfills/internal_binding/tty_wrap.ts b/ext/node/polyfills/internal_binding/tty_wrap.ts deleted file mode 100644 index 93e2042b0d..0000000000 --- a/ext/node/polyfills/internal_binding/tty_wrap.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. - -export {}; diff --git a/ext/node/polyfills/internal_binding/url.ts b/ext/node/polyfills/internal_binding/url.ts deleted file mode 100644 index 93e2042b0d..0000000000 --- a/ext/node/polyfills/internal_binding/url.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. - -export {}; diff --git a/ext/node/polyfills/internal_binding/v8.ts b/ext/node/polyfills/internal_binding/v8.ts deleted file mode 100644 index 93e2042b0d..0000000000 --- a/ext/node/polyfills/internal_binding/v8.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. - -export {}; diff --git a/ext/node/polyfills/internal_binding/worker.ts b/ext/node/polyfills/internal_binding/worker.ts deleted file mode 100644 index 93e2042b0d..0000000000 --- a/ext/node/polyfills/internal_binding/worker.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. - -export {}; diff --git a/ext/node/polyfills/internal_binding/zlib.ts b/ext/node/polyfills/internal_binding/zlib.ts deleted file mode 100644 index 93e2042b0d..0000000000 --- a/ext/node/polyfills/internal_binding/zlib.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. - -export {};