1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-21 15:04:11 -05:00

chore: bump deno core (#22243)

Migrations:

- Error registration no longer required for Interrupted or BadResource
(these are core exception)
 - `include_js_files!`/`ExtensionFileSource` changes
This commit is contained in:
Matt Mastracci 2024-02-04 17:03:14 -07:00 committed by GitHub
parent 0f7f987951
commit 56f58a047e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 118 additions and 147 deletions

12
Cargo.lock generated
View file

@ -1195,9 +1195,9 @@ dependencies = [
[[package]] [[package]]
name = "deno_core" name = "deno_core"
version = "0.257.0" version = "0.258.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2a9283383b7fe9712396c09407cbfb41c90778168f67d2ad1112a00a9df2e8f4" checksum = "f200cdc161745281e4ec56e3b0e563058d2cc50a824ac901823ed0720b481619"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bit-set", "bit-set",
@ -1645,9 +1645,9 @@ dependencies = [
[[package]] [[package]]
name = "deno_ops" name = "deno_ops"
version = "0.133.0" version = "0.134.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ecf506732df72384bed194ce601bc6b77a5508d2de5da197c97c0a112013d504" checksum = "fe122714b90abf065a746f452f69beae37324436a1541118ca4078b9b9d2b260"
dependencies = [ dependencies = [
"proc-macro-rules", "proc-macro-rules",
"proc-macro2", "proc-macro2",
@ -5407,9 +5407,9 @@ dependencies = [
[[package]] [[package]]
name = "serde_v8" name = "serde_v8"
version = "0.166.0" version = "0.167.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3cdf59dc8e11fc49804a1b677b41859fc4b24efbcd1cb162ebc4f0f39e15d2e1" checksum = "cc6b38f6831f968e3813a480ca5a236c9a0972d9dcf0bb241f193ba524e4cf4e"
dependencies = [ dependencies = [
"bytes", "bytes",
"derive_more", "derive_more",

View file

@ -42,7 +42,7 @@ repository = "https://github.com/denoland/deno"
[workspace.dependencies] [workspace.dependencies]
deno_ast = { version = "0.32.0", features = ["transpiling"] } 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_bench_util = { version = "0.130.0", path = "./bench_util" }
deno_lockfile = "0.18.0" deno_lockfile = "0.18.0"

View file

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

View file

@ -509,56 +509,56 @@ deno_core::extension!(deno_node,
"path/separator.ts", "path/separator.ts",
"readline/promises.ts", "readline/promises.ts",
"wasi.ts", "wasi.ts",
"assert.ts" with_specifier "node:assert", "node:assert" = "assert.ts",
"assert/strict.ts" with_specifier "node:assert/strict", "node:assert/strict" = "assert/strict.ts",
"async_hooks.ts" with_specifier "node:async_hooks", "node:async_hooks" = "async_hooks.ts",
"buffer.ts" with_specifier "node:buffer", "node:buffer" = "buffer.ts",
"child_process.ts" with_specifier "node:child_process", "node:child_process" = "child_process.ts",
"cluster.ts" with_specifier "node:cluster", "node:cluster" = "cluster.ts",
"console.ts" with_specifier "node:console", "node:console" = "console.ts",
"constants.ts" with_specifier "node:constants", "node:constants" = "constants.ts",
"crypto.ts" with_specifier "node:crypto", "node:crypto" = "crypto.ts",
"dgram.ts" with_specifier "node:dgram", "node:dgram" = "dgram.ts",
"diagnostics_channel.ts" with_specifier "node:diagnostics_channel", "node:diagnostics_channel" = "diagnostics_channel.ts",
"dns.ts" with_specifier "node:dns", "node:dns" = "dns.ts",
"dns/promises.ts" with_specifier "node:dns/promises", "node:dns/promises" = "dns/promises.ts",
"domain.ts" with_specifier "node:domain", "node:domain" = "domain.ts",
"events.ts" with_specifier "node:events", "node:events" = "events.ts",
"fs.ts" with_specifier "node:fs", "node:fs" = "fs.ts",
"fs/promises.ts" with_specifier "node:fs/promises", "node:fs/promises" = "fs/promises.ts",
"http.ts" with_specifier "node:http", "node:http" = "http.ts",
"http2.ts" with_specifier "node:http2", "node:http2" = "http2.ts",
"https.ts" with_specifier "node:https", "node:https" = "https.ts",
"01_require.js" with_specifier "node:module", "node:module" = "01_require.js",
"net.ts" with_specifier "node:net", "node:net" = "net.ts",
"os.ts" with_specifier "node:os", "node:os" = "os.ts",
"path.ts" with_specifier "node:path", "node:path" = "path.ts",
"path/posix.ts" with_specifier "node:path/posix", "node:path/posix" = "path/posix.ts",
"path/win32.ts" with_specifier "node:path/win32", "node:path/win32" = "path/win32.ts",
"perf_hooks.ts" with_specifier "node:perf_hooks", "node:perf_hooks" = "perf_hooks.ts",
"process.ts" with_specifier "node:process", "node:process" = "process.ts",
"punycode.ts" with_specifier "node:punycode", "node:punycode" = "punycode.ts",
"querystring.js" with_specifier "node:querystring", "node:querystring" = "querystring.js",
"readline.ts" with_specifier "node:readline", "node:readline" = "readline.ts",
"repl.ts" with_specifier "node:repl", "node:repl" = "repl.ts",
"stream.ts" with_specifier "node:stream", "node:stream" = "stream.ts",
"stream/consumers.mjs" with_specifier "node:stream/consumers", "node:stream/consumers" = "stream/consumers.mjs",
"stream/promises.mjs" with_specifier "node:stream/promises", "node:stream/promises" = "stream/promises.mjs",
"stream/web.ts" with_specifier "node:stream/web", "node:stream/web" = "stream/web.ts",
"string_decoder.ts" with_specifier "node:string_decoder", "node:string_decoder" = "string_decoder.ts",
"sys.ts" with_specifier "node:sys", "node:sys" = "sys.ts",
"testing.ts" with_specifier "node:test", "node:test" = "testing.ts",
"timers.ts" with_specifier "node:timers", "node:timers" = "timers.ts",
"timers/promises.ts" with_specifier "node:timers/promises", "node:timers/promises" = "timers/promises.ts",
"tls.ts" with_specifier "node:tls", "node:tls" = "tls.ts",
"tty.js" with_specifier "node:tty", "node:tty" = "tty.js",
"url.ts" with_specifier "node:url", "node:url" = "url.ts",
"util.ts" with_specifier "node:util", "node:util" = "util.ts",
"util/types.ts" with_specifier "node:util/types", "node:util/types" = "util/types.ts",
"v8.ts" with_specifier "node:v8", "node:v8" = "v8.ts",
"vm.ts" with_specifier "node:vm", "node:vm" = "vm.ts",
"worker_threads.ts" with_specifier "node:worker_threads", "node:worker_threads" = "worker_threads.ts",
"zlib.ts" with_specifier "node:zlib", "node:zlib" = "zlib.ts",
], ],
options = { options = {
maybe_npm_resolver: Option<NpmResolverRc>, maybe_npm_resolver: Option<NpmResolverRc>,

View file

@ -6,28 +6,24 @@ use deno_bench_util::bencher::benchmark_group;
use deno_bench_util::bencher::Bencher; use deno_bench_util::bencher::Bencher;
use deno_core::Extension; use deno_core::Extension;
use deno_core::ExtensionFileSource;
use deno_core::ExtensionFileSourceCode;
fn setup() -> Vec<Extension> { 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![ vec![
deno_webidl::deno_webidl::init_ops_and_esm(), deno_webidl::deno_webidl::init_ops_and_esm(),
deno_console::deno_console::init_ops_and_esm(), deno_console::deno_console::init_ops_and_esm(),
deno_url::deno_url::init_ops_and_esm(), deno_url::deno_url::init_ops_and_esm(),
Extension { bench_setup::init_ops_and_esm(),
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()
},
] ]
} }

View file

@ -5,8 +5,6 @@ use deno_bench_util::bench_or_profile;
use deno_bench_util::bencher::benchmark_group; use deno_bench_util::bencher::benchmark_group;
use deno_bench_util::bencher::Bencher; use deno_bench_util::bencher::Bencher;
use deno_core::Extension; use deno_core::Extension;
use deno_core::ExtensionFileSource;
use deno_core::ExtensionFileSourceCode;
#[derive(Clone)] #[derive(Clone)]
struct Permissions; struct Permissions;
@ -18,6 +16,21 @@ impl deno_web::TimersPermission for Permissions {
} }
fn setup() -> Vec<Extension> { 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![ vec![
deno_webidl::deno_webidl::init_ops_and_esm(), deno_webidl::deno_webidl::init_ops_and_esm(),
deno_url::deno_url::init_ops_and_esm(), deno_url::deno_url::init_ops_and_esm(),
@ -26,24 +39,7 @@ fn setup() -> Vec<Extension> {
Default::default(), Default::default(),
None, None,
), ),
Extension { bench_setup::init_ops_and_esm(),
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()
},
] ]
} }

View file

@ -5,8 +5,6 @@ use deno_bench_util::bench_or_profile;
use deno_bench_util::bencher::benchmark_group; use deno_bench_util::bencher::benchmark_group;
use deno_bench_util::bencher::Bencher; use deno_bench_util::bencher::Bencher;
use deno_core::Extension; use deno_core::Extension;
use deno_core::ExtensionFileSource;
use deno_core::ExtensionFileSourceCode;
#[derive(Clone)] #[derive(Clone)]
struct Permissions; struct Permissions;
@ -18,6 +16,21 @@ impl deno_web::TimersPermission for Permissions {
} }
fn setup() -> Vec<Extension> { 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![ vec![
deno_webidl::deno_webidl::init_ops_and_esm(), deno_webidl::deno_webidl::init_ops_and_esm(),
deno_url::deno_url::init_ops_and_esm(), deno_url::deno_url::init_ops_and_esm(),
@ -26,24 +39,7 @@ fn setup() -> Vec<Extension> {
Default::default(), Default::default(),
None, None,
), ),
Extension { bench_setup::init_ops_and_esm(),
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()
},
] ]
} }

View file

@ -6,23 +6,17 @@ use deno_bench_util::bencher::benchmark_group;
use deno_bench_util::bencher::Bencher; use deno_bench_util::bencher::Bencher;
use deno_core::Extension; use deno_core::Extension;
use deno_core::ExtensionFileSource;
use deno_core::ExtensionFileSourceCode;
fn setup() -> Vec<Extension> { 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![ vec![
deno_webidl::deno_webidl::init_ops_and_esm(), deno_webidl::deno_webidl::init_ops_and_esm(),
Extension { deno_webidl_bench::init_ops_and_esm(),
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()
},
] ]
} }

View file

@ -378,11 +378,9 @@ core.registerErrorClass("BrokenPipe", errors.BrokenPipe);
core.registerErrorClass("AlreadyExists", errors.AlreadyExists); core.registerErrorClass("AlreadyExists", errors.AlreadyExists);
core.registerErrorClass("InvalidData", errors.InvalidData); core.registerErrorClass("InvalidData", errors.InvalidData);
core.registerErrorClass("TimedOut", errors.TimedOut); core.registerErrorClass("TimedOut", errors.TimedOut);
core.registerErrorClass("Interrupted", errors.Interrupted);
core.registerErrorClass("WouldBlock", errors.WouldBlock); core.registerErrorClass("WouldBlock", errors.WouldBlock);
core.registerErrorClass("WriteZero", errors.WriteZero); core.registerErrorClass("WriteZero", errors.WriteZero);
core.registerErrorClass("UnexpectedEof", errors.UnexpectedEof); core.registerErrorClass("UnexpectedEof", errors.UnexpectedEof);
core.registerErrorClass("BadResource", errors.BadResource);
core.registerErrorClass("Http", errors.Http); core.registerErrorClass("Http", errors.Http);
core.registerErrorClass("Busy", errors.Busy); core.registerErrorClass("Busy", errors.Busy);
core.registerErrorClass("NotSupported", errors.NotSupported); core.registerErrorClass("NotSupported", errors.NotSupported);

View file

@ -56,12 +56,7 @@ extension!(runtime,
customizer = |ext: &mut Extension| { customizer = |ext: &mut Extension| {
#[cfg(not(feature = "exclude_runtime_main_js"))] #[cfg(not(feature = "exclude_runtime_main_js"))]
{ {
ext.esm_files.to_mut().push(ExtensionFileSource { ext.esm_files.to_mut().push(ExtensionFileSource::new("ext:runtime_main/js/99_main.js", include_str!("./js/99_main.js")));
specifier: "ext:runtime_main/js/99_main.js",
code: ExtensionFileSourceCode::IncludedInBinary(
include_str!("./js/99_main.js"),
),
});
ext.esm_entry_point = Some("ext:runtime_main/js/99_main.js"); ext.esm_entry_point = Some("ext:runtime_main/js/99_main.js");
} }
} }