Skip to content

Commit

Permalink
chore: bump deno core (denoland#22243)
Browse files Browse the repository at this point in the history
Migrations:

- Error registration no longer required for Interrupted or BadResource
(these are core exception)
 - `include_js_files!`/`ExtensionFileSource` changes
  • Loading branch information
mmastrac committed Feb 5, 2024
1 parent 0f7f987 commit 56f58a0
Show file tree
Hide file tree
Showing 10 changed files with 118 additions and 147 deletions.
12 changes: 6 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ repository = "https://github.com/denoland/deno"

[workspace.dependencies]
deno_ast = { version = "0.32.0", features = ["transpiling"] }
deno_core = { version = "0.257.0" }
deno_core = { version = "0.258.0" }

deno_bench_util = { version = "0.130.0", path = "./bench_util" }
deno_lockfile = "0.18.0"
Expand Down
22 changes: 9 additions & 13 deletions bench_util/benches/utf8.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,23 @@ use deno_bench_util::bencher::benchmark_group;
use deno_bench_util::bencher::Bencher;
use deno_bench_util::BenchOptions;
use deno_core::Extension;
use deno_core::ExtensionFileSource;
use deno_core::ExtensionFileSourceCode;

fn setup() -> Vec<Extension> {
vec![Extension {
name: "bench_setup",
js_files: std::borrow::Cow::Borrowed(&[ExtensionFileSource {
specifier: "ext:bench_setup/setup.js",
code: ExtensionFileSourceCode::IncludedInBinary(
r#"
deno_core::extension!(
bench_setup,
js = ["ext:bench_setup/setup.js" = {
source = r#"
const hello = "hello world\n";
const hello1k = hello.repeat(1e3);
const hello1m = hello.repeat(1e6);
const helloEncoded = Deno.core.encode(hello);
const hello1kEncoded = Deno.core.encode(hello1k);
const hello1mEncoded = Deno.core.encode(hello1m);
"#,
),
}]),
..Default::default()
}]
"#
}]
);

vec![bench_setup::init_ops_and_esm()]
}

fn bench_utf8_encode_12_b(b: &mut Bencher) {
Expand Down
100 changes: 50 additions & 50 deletions ext/node/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -509,56 +509,56 @@ deno_core::extension!(deno_node,
"path/separator.ts",
"readline/promises.ts",
"wasi.ts",
"assert.ts" with_specifier "node:assert",
"assert/strict.ts" with_specifier "node:assert/strict",
"async_hooks.ts" with_specifier "node:async_hooks",
"buffer.ts" with_specifier "node:buffer",
"child_process.ts" with_specifier "node:child_process",
"cluster.ts" with_specifier "node:cluster",
"console.ts" with_specifier "node:console",
"constants.ts" with_specifier "node:constants",
"crypto.ts" with_specifier "node:crypto",
"dgram.ts" with_specifier "node:dgram",
"diagnostics_channel.ts" with_specifier "node:diagnostics_channel",
"dns.ts" with_specifier "node:dns",
"dns/promises.ts" with_specifier "node:dns/promises",
"domain.ts" with_specifier "node:domain",
"events.ts" with_specifier "node:events",
"fs.ts" with_specifier "node:fs",
"fs/promises.ts" with_specifier "node:fs/promises",
"http.ts" with_specifier "node:http",
"http2.ts" with_specifier "node:http2",
"https.ts" with_specifier "node:https",
"01_require.js" with_specifier "node:module",
"net.ts" with_specifier "node:net",
"os.ts" with_specifier "node:os",
"path.ts" with_specifier "node:path",
"path/posix.ts" with_specifier "node:path/posix",
"path/win32.ts" with_specifier "node:path/win32",
"perf_hooks.ts" with_specifier "node:perf_hooks",
"process.ts" with_specifier "node:process",
"punycode.ts" with_specifier "node:punycode",
"querystring.js" with_specifier "node:querystring",
"readline.ts" with_specifier "node:readline",
"repl.ts" with_specifier "node:repl",
"stream.ts" with_specifier "node:stream",
"stream/consumers.mjs" with_specifier "node:stream/consumers",
"stream/promises.mjs" with_specifier "node:stream/promises",
"stream/web.ts" with_specifier "node:stream/web",
"string_decoder.ts" with_specifier "node:string_decoder",
"sys.ts" with_specifier "node:sys",
"testing.ts" with_specifier "node:test",
"timers.ts" with_specifier "node:timers",
"timers/promises.ts" with_specifier "node:timers/promises",
"tls.ts" with_specifier "node:tls",
"tty.js" with_specifier "node:tty",
"url.ts" with_specifier "node:url",
"util.ts" with_specifier "node:util",
"util/types.ts" with_specifier "node:util/types",
"v8.ts" with_specifier "node:v8",
"vm.ts" with_specifier "node:vm",
"worker_threads.ts" with_specifier "node:worker_threads",
"zlib.ts" with_specifier "node:zlib",
"node:assert" = "assert.ts",
"node:assert/strict" = "assert/strict.ts",
"node:async_hooks" = "async_hooks.ts",
"node:buffer" = "buffer.ts",
"node:child_process" = "child_process.ts",
"node:cluster" = "cluster.ts",
"node:console" = "console.ts",
"node:constants" = "constants.ts",
"node:crypto" = "crypto.ts",
"node:dgram" = "dgram.ts",
"node:diagnostics_channel" = "diagnostics_channel.ts",
"node:dns" = "dns.ts",
"node:dns/promises" = "dns/promises.ts",
"node:domain" = "domain.ts",
"node:events" = "events.ts",
"node:fs" = "fs.ts",
"node:fs/promises" = "fs/promises.ts",
"node:http" = "http.ts",
"node:http2" = "http2.ts",
"node:https" = "https.ts",
"node:module" = "01_require.js",
"node:net" = "net.ts",
"node:os" = "os.ts",
"node:path" = "path.ts",
"node:path/posix" = "path/posix.ts",
"node:path/win32" = "path/win32.ts",
"node:perf_hooks" = "perf_hooks.ts",
"node:process" = "process.ts",
"node:punycode" = "punycode.ts",
"node:querystring" = "querystring.js",
"node:readline" = "readline.ts",
"node:repl" = "repl.ts",
"node:stream" = "stream.ts",
"node:stream/consumers" = "stream/consumers.mjs",
"node:stream/promises" = "stream/promises.mjs",
"node:stream/web" = "stream/web.ts",
"node:string_decoder" = "string_decoder.ts",
"node:sys" = "sys.ts",
"node:test" = "testing.ts",
"node:timers" = "timers.ts",
"node:timers/promises" = "timers/promises.ts",
"node:tls" = "tls.ts",
"node:tty" = "tty.js",
"node:url" = "url.ts",
"node:util" = "util.ts",
"node:util/types" = "util/types.ts",
"node:v8" = "v8.ts",
"node:vm" = "vm.ts",
"node:worker_threads" = "worker_threads.ts",
"node:zlib" = "zlib.ts",
],
options = {
maybe_npm_resolver: Option<NpmResolverRc>,
Expand Down
28 changes: 12 additions & 16 deletions ext/url/benches/url_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,24 @@ use deno_bench_util::bencher::benchmark_group;
use deno_bench_util::bencher::Bencher;

use deno_core::Extension;
use deno_core::ExtensionFileSource;
use deno_core::ExtensionFileSourceCode;

fn setup() -> Vec<Extension> {
deno_core::extension!(
bench_setup,
esm_entry_point = "ext:bench_setup/setup",
esm = ["ext:bench_setup/setup" = {
source = r#"
import { URL } from "ext:deno_url/00_url.js";
globalThis.URL = URL;
"#
}]
);

vec![
deno_webidl::deno_webidl::init_ops_and_esm(),
deno_console::deno_console::init_ops_and_esm(),
deno_url::deno_url::init_ops_and_esm(),
Extension {
name: "bench_setup",
esm_files: std::borrow::Cow::Borrowed(&[ExtensionFileSource {
specifier: "ext:bench_setup/setup",
code: ExtensionFileSourceCode::IncludedInBinary(
r#"
import { URL } from "ext:deno_url/00_url.js";
globalThis.URL = URL;
"#,
),
}]),
esm_entry_point: Some("ext:bench_setup/setup"),
..Default::default()
},
bench_setup::init_ops_and_esm(),
]
}

Expand Down
36 changes: 16 additions & 20 deletions ext/web/benches/encoding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ use deno_bench_util::bench_or_profile;
use deno_bench_util::bencher::benchmark_group;
use deno_bench_util::bencher::Bencher;
use deno_core::Extension;
use deno_core::ExtensionFileSource;
use deno_core::ExtensionFileSourceCode;

#[derive(Clone)]
struct Permissions;
Expand All @@ -18,6 +16,21 @@ impl deno_web::TimersPermission for Permissions {
}

fn setup() -> Vec<Extension> {
deno_core::extension!(
bench_setup,
esm_entry_point = "ext:bench_setup/setup",
esm = ["ext:bench_setup/setup" = {
source = r#"
import { TextDecoder } from "ext:deno_web/08_text_encoding.js";
globalThis.TextDecoder = TextDecoder;
globalThis.hello12k = Deno.core.encode("hello world\n".repeat(1e3));
"#
}],
state = |state| {
state.put(Permissions {});
},
);

vec![
deno_webidl::deno_webidl::init_ops_and_esm(),
deno_url::deno_url::init_ops_and_esm(),
Expand All @@ -26,24 +39,7 @@ fn setup() -> Vec<Extension> {
Default::default(),
None,
),
Extension {
name: "bench_setup",
esm_files: std::borrow::Cow::Borrowed(&[ExtensionFileSource {
specifier: "ext:bench_setup/setup",
code: ExtensionFileSourceCode::IncludedInBinary(
r#"
import { TextDecoder } from "ext:deno_web/08_text_encoding.js";
globalThis.TextDecoder = TextDecoder;
globalThis.hello12k = Deno.core.encode("hello world\n".repeat(1e3));
"#,
),
}]),
esm_entry_point: Some("ext:bench_setup/setup"),
op_state_fn: Some(Box::new(|state| {
state.put(Permissions {});
})),
..Default::default()
},
bench_setup::init_ops_and_esm(),
]
}

Expand Down
36 changes: 16 additions & 20 deletions ext/web/benches/timers_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ use deno_bench_util::bench_or_profile;
use deno_bench_util::bencher::benchmark_group;
use deno_bench_util::bencher::Bencher;
use deno_core::Extension;
use deno_core::ExtensionFileSource;
use deno_core::ExtensionFileSourceCode;

#[derive(Clone)]
struct Permissions;
Expand All @@ -18,6 +16,21 @@ impl deno_web::TimersPermission for Permissions {
}

fn setup() -> Vec<Extension> {
deno_core::extension!(
bench_setup,
esm_entry_point = "ext:bench_setup/setup",
esm = ["ext:bench_setup/setup" = {
source = r#"
import { setTimeout, handleTimerMacrotask } from "ext:deno_web/02_timers.js";
globalThis.setTimeout = setTimeout;
Deno.core.setMacrotaskCallback(handleTimerMacrotask);
"#
}],
state = |state| {
state.put(Permissions {});
},
);

vec![
deno_webidl::deno_webidl::init_ops_and_esm(),
deno_url::deno_url::init_ops_and_esm(),
Expand All @@ -26,24 +39,7 @@ fn setup() -> Vec<Extension> {
Default::default(),
None,
),
Extension {
name: "bench_setup",
esm_files: std::borrow::Cow::Borrowed(&[ExtensionFileSource {
specifier: "ext:bench_setup/setup",
code: ExtensionFileSourceCode::IncludedInBinary(
r#"
import { setTimeout, handleTimerMacrotask } from "ext:deno_web/02_timers.js";
globalThis.setTimeout = setTimeout;
Deno.core.setMacrotaskCallback(handleTimerMacrotask);
"#,
),
}]),
esm_entry_point: Some("ext:bench_setup/setup"),
op_state_fn: Some(Box::new(|state| {
state.put(Permissions {});
})),
..Default::default()
},
bench_setup::init_ops_and_esm(),
]
}

Expand Down
20 changes: 7 additions & 13 deletions ext/webidl/benches/dict.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,17 @@ use deno_bench_util::bencher::benchmark_group;
use deno_bench_util::bencher::Bencher;

use deno_core::Extension;
use deno_core::ExtensionFileSource;
use deno_core::ExtensionFileSourceCode;

fn setup() -> Vec<Extension> {
deno_core::extension!(
deno_webidl_bench,
esm_entry_point = "ext:deno_webidl_bench/setup.js",
esm = ["ext:deno_webidl_bench/setup.js" = "benches/dict.js"]
);

vec![
deno_webidl::deno_webidl::init_ops_and_esm(),
Extension {
name: "deno_webidl_bench",
esm_files: std::borrow::Cow::Borrowed(&[ExtensionFileSource {
specifier: "ext:deno_webidl_bench/setup.js",
code: ExtensionFileSourceCode::IncludedInBinary(include_str!(
"dict.js"
)),
}]),
esm_entry_point: Some("ext:deno_webidl_bench/setup.js"),
..Default::default()
},
deno_webidl_bench::init_ops_and_esm(),
]
}

Expand Down
2 changes: 0 additions & 2 deletions runtime/js/99_main.js
Original file line number Diff line number Diff line change
Expand Up @@ -378,11 +378,9 @@ core.registerErrorClass("BrokenPipe", errors.BrokenPipe);
core.registerErrorClass("AlreadyExists", errors.AlreadyExists);
core.registerErrorClass("InvalidData", errors.InvalidData);
core.registerErrorClass("TimedOut", errors.TimedOut);
core.registerErrorClass("Interrupted", errors.Interrupted);
core.registerErrorClass("WouldBlock", errors.WouldBlock);
core.registerErrorClass("WriteZero", errors.WriteZero);
core.registerErrorClass("UnexpectedEof", errors.UnexpectedEof);
core.registerErrorClass("BadResource", errors.BadResource);
core.registerErrorClass("Http", errors.Http);
core.registerErrorClass("Busy", errors.Busy);
core.registerErrorClass("NotSupported", errors.NotSupported);
Expand Down

0 comments on commit 56f58a0

Please sign in to comment.