Skip to content

Commit aa72f73

Browse files
feat: Deno 1.43 upgrade
feat: Deno 1.43 upgrade
1 parent 9b95ff3 commit aa72f73

File tree

119 files changed

+4660
-2597
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+4660
-2597
lines changed

Cargo.lock

Lines changed: 408 additions & 196 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -18,41 +18,41 @@ resolver = "2"
1818

1919
[workspace.dependencies]
2020
url = { version = "2.3.1" }
21-
eszip = "0.60.0"
21+
eszip = "=0.68.2"
2222
log = "0.4.20"
2323
anyhow = { version = "1.0.57" }
2424
libc = { version = "0.2.144" }
25-
deno_ast = { version = "0.32.0", features = ["transpiling"] }
26-
deno_broadcast_channel = { version = "0.130.0" }
27-
deno_core = { version = "0.256.0" }
28-
deno_console = { version = "0.136.0" }
29-
deno_crypto = { version = "0.150.0" }
30-
deno_fetch = { version = "0.160.0" }
31-
deno_fs = { version = "0.46.0", features = ["sync_fs"] }
32-
deno_config = "=0.9.1"
33-
deno_io = "0.46.0"
34-
deno_webgpu = "0.103.0"
35-
deno_canvas = "0.5.0"
36-
deno_graph = "=0.64.1"
37-
deno_http = { version = "0.133.0" }
38-
deno_media_type = { version = "0.1.1", features = ["module_specifier"] }
39-
deno_net = { version = "0.128.0" }
40-
deno_npm = "0.16.0"
41-
deno_url = { version = "0.136.0" }
25+
deno_ast = { version = "=0.38.1", features = ["transpiling"] }
26+
deno_broadcast_channel = { version = "0.143.0" }
27+
deno_core = { version = "0.278.0" }
28+
deno_console = { version = "0.149.0" }
29+
deno_crypto = { version = "0.163.0" }
30+
deno_fetch = { version = "0.173.0" }
31+
deno_fs = { version = "0.59.0", features = ["sync_fs"] }
32+
deno_config = "=0.16.3"
33+
deno_io = "0.59.0"
34+
deno_webgpu = "0.116.0"
35+
deno_canvas = "0.18.0"
36+
deno_graph = "=0.74.5"
37+
deno_http = { version = "0.146.0" }
38+
deno_media_type = { version = "0.1.4", features = ["module_specifier"] }
39+
deno_net = { version = "0.141.0" }
40+
deno_npm = "0.18.0"
41+
deno_url = { version = "0.149.0" }
4242
deno_semver = "0.5.4"
43-
deno_tls = { version = "0.123.0"}
44-
deno_webidl = { version = "0.136.0" }
45-
deno_web = { version = "0.167.0" }
46-
deno_websocket = { version = "0.141.0" }
47-
deno_webstorage = { version = "0.131.0" }
48-
deno_lockfile = { version = "0.18.0" }
43+
deno_tls = { version = "0.136.0"}
44+
deno_webidl = { version = "0.149.0" }
45+
deno_web = { version = "0.180.0" }
46+
deno_websocket = { version = "0.154.0" }
47+
deno_webstorage = { version = "0.144.0" }
4948
enum-as-inner = "0.6.0"
5049
serde = { version = "1.0.149", features = ["derive"] }
5150
hyper = "0.14.26"
52-
tokio = { version = "1.35", features = ["full"] }
51+
tokio = { version = "1.36.0", features = ["full"] }
5352
bytes = { version = "1.4.0" }
5453
once_cell = "1.17.1"
5554
thiserror = "1.0.40"
55+
deno_lockfile = "0.19.0"
5656
async-trait = "0.1.73"
5757
indexmap = { version = "2.0.0", features = ["serde"] }
5858
flate2 = "=1.0.26"
@@ -72,7 +72,7 @@ futures = { version = "0.3.28" }
7272
futures-util = { version = "0.3.28" }
7373
ctor = { version = "0.2.6" }
7474
fastwebsockets = { version = "0.4.4", features = ["upgrade"] }
75-
percent-encoding = "=2.3.0"
75+
percent-encoding = "=2.3.1"
7676
scopeguard = { version = "1.2.0" }
7777
glob = "0.3.1"
7878
httparse = "1.8"
@@ -81,8 +81,8 @@ faster-hex = "0.9.0"
8181
strum = "0.25"
8282

8383
# DEBUG
84-
#[patch.crates-io]
85-
#deno_core = { path = "/your/path/to/deno_core/core" }
84+
# [patch.crates-io]
85+
# deno_core = { path = "/Users/andrespirela/Documents/workspace/supabase/deno_core/core" }
8686

8787
[profile.dind]
8888
inherits = "dev"

crates/base/build.rs

Lines changed: 44 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ use std::path::PathBuf;
55
mod supabase_startup_snapshot {
66
use super::*;
77
use deno_core::error::AnyError;
8-
use deno_core::snapshot_util::*;
8+
use deno_core::snapshot::{create_snapshot, CreateSnapshotOptions};
99
use deno_core::Extension;
1010
use deno_fs::OpenOptions;
1111
use deno_http::DefaultHttpPropertyExtractor;
12+
use deno_io::fs::FsError;
1213
use event_worker::js_interceptors::sb_events_js_interceptors;
1314
use event_worker::sb_user_event_worker;
1415
use sb_ai::sb_ai;
@@ -22,7 +23,10 @@ mod supabase_startup_snapshot {
2223
use sb_env::sb_env;
2324
use sb_node::deno_node;
2425
use sb_workers::sb_user_workers;
26+
use std::borrow::Cow;
27+
use std::io::Write;
2528
use std::path::Path;
29+
use std::rc::Rc;
2630
use std::sync::Arc;
2731
use url::Url;
2832

@@ -90,6 +94,17 @@ mod supabase_startup_snapshot {
9094
}
9195

9296
impl deno_fs::FsPermissions for Permissions {
97+
fn check_open<'a>(
98+
&mut self,
99+
_resolved: bool,
100+
_read: bool,
101+
_write: bool,
102+
path: &'a Path,
103+
_api_name: &str,
104+
) -> Result<Cow<'a, Path>, FsError> {
105+
Ok(Cow::Borrowed(path))
106+
}
107+
93108
fn check_read(&mut self, _path: &Path, _api_name: &str) -> Result<(), AnyError> {
94109
unreachable!("snapshotting!")
95110
}
@@ -128,12 +143,13 @@ mod supabase_startup_snapshot {
128143
unreachable!("snapshotting!")
129144
}
130145

131-
fn check(
146+
fn check<'a>(
132147
&mut self,
148+
_resolved: bool,
133149
_open_options: &OpenOptions,
134-
_path: &Path,
150+
_path: &'a Path,
135151
_api_name: &str,
136-
) -> Result<(), AnyError> {
152+
) -> Result<std::borrow::Cow<'a, Path>, FsError> {
137153
unreachable!("snapshotting!")
138154
}
139155
}
@@ -171,7 +187,7 @@ mod supabase_startup_snapshot {
171187
pub fn create_runtime_snapshot(snapshot_path: PathBuf) {
172188
let user_agent = String::from("supabase");
173189
let fs = Arc::new(deno_fs::RealFs);
174-
let mut extensions: Vec<Extension> = vec![
190+
let extensions: Vec<Extension> = vec![
175191
sb_core_permissions::init_ops_and_esm(false),
176192
deno_webidl::deno_webidl::init_ops_and_esm(),
177193
deno_console::deno_console::init_ops_and_esm(),
@@ -212,24 +228,28 @@ mod supabase_startup_snapshot {
212228
sb_core_runtime::init_ops_and_esm(None),
213229
];
214230

215-
for extension in &mut extensions {
216-
for source in extension.esm_files.to_mut() {
217-
let _ = maybe_transpile_source(source).unwrap();
218-
}
219-
for source in extension.js_files.to_mut() {
220-
let _ = maybe_transpile_source(source).unwrap();
221-
}
222-
}
223-
224-
let _ = create_snapshot(CreateSnapshotOptions {
225-
cargo_manifest_dir: env!("CARGO_MANIFEST_DIR"),
226-
snapshot_path,
227-
startup_snapshot: None,
228-
skip_op_registration: false,
229-
extensions,
230-
compression_cb: None,
231-
with_runtime_cb: None,
232-
});
231+
let snapshot = create_snapshot(
232+
CreateSnapshotOptions {
233+
cargo_manifest_dir: env!("CARGO_MANIFEST_DIR"),
234+
startup_snapshot: None,
235+
extensions,
236+
extension_transpiler: Some(Rc::new(|specifier, source| {
237+
maybe_transpile_source(specifier, source)
238+
})),
239+
skip_op_registration: false,
240+
with_runtime_cb: None,
241+
},
242+
None,
243+
);
244+
245+
let output = snapshot.unwrap();
246+
247+
let mut snapshot = std::fs::File::create(snapshot_path).unwrap();
248+
snapshot.write_all(&output.output).unwrap();
249+
250+
for path in output.files_loaded_during_snapshot {
251+
println!("cargo:rerun-if-changed={}", path.display());
252+
}
233253
}
234254
}
235255

@@ -242,5 +262,5 @@ fn main() {
242262
// Main snapshot
243263
let runtime_snapshot_path = o.join("RUNTIME_SNAPSHOT.bin");
244264

245-
supabase_startup_snapshot::create_runtime_snapshot(runtime_snapshot_path)
265+
supabase_startup_snapshot::create_runtime_snapshot(runtime_snapshot_path.clone());
246266
}

0 commit comments

Comments
 (0)