orvit
orvit
DDeno
Created by Mqx on 9/12/2023 in #help
Using Deno in Frontend.
afaik you'd deploy what esbuild emits
20 replies
DDeno
Created by Mqx on 9/12/2023 in #help
Using Deno in Frontend.
If you'd like to automate it, deno_emit, esbuild is convenient for "the web" however.
20 replies
DDeno
Created by Mqx on 9/12/2023 in #help
Using Deno in Frontend.
20 replies
DDeno
Created by Mqx on 9/12/2023 in #help
Using Deno in Frontend.
20 replies
DDeno
Created by orvit on 11/14/2022 in #help
deno_core Extension with Global Access
it works but it looks like it'd be annoying to maintain
58 replies
DDeno
Created by orvit on 11/14/2022 in #help
deno_core Extension with Global Access
use deno_core::snapshot_util;
use deno_runtime::{permissions::Permissions, *};

use std::{env, path::PathBuf};

fn main() {
if env::var("HOST").unwrap() != env::var("TARGET").unwrap() {
panic!("Cross-compiling is not supported");
}

let evo_snapshot_path = PathBuf::from(env::var("OUT_DIR").unwrap()).join("EVO_SNAPSHOT.bin");
create_evo_snapshot(evo_snapshot_path.clone());

println!(
"cargo:rustc-env=EVO_SNAPSHOT_PATH={}",
evo_snapshot_path.to_str().unwrap()
);
}

fn create_evo_snapshot(snapshot_path: PathBuf) {
// from github.com/denoland/deno/blob/master/cli/build.rs (formatted + comments removed)
let extensions = vec![
deno_webidl::init(),
deno_console::init(),
deno_url::init(),
deno_tls::init(),
deno_web::init::<Permissions>(deno_web::BlobStore::default(), Default::default()),
deno_fetch::init::<Permissions>(Default::default()),
deno_cache::init::<deno_cache::SqliteBackedCache>(None),
deno_websocket::init::<Permissions>("".to_owned(), None, None),
deno_webstorage::init(None),
deno_crypto::init(None),
deno_webgpu::init(false),
deno_broadcast_channel::init(
deno_broadcast_channel::InMemoryBroadcastChannel::default(),
false,
),
deno_node::init::<Permissions>(None),
deno_ffi::init::<Permissions>(false),
deno_net::init::<Permissions>(None, false, None),
deno_napi::init::<Permissions>(false),
deno_http::init(),
deno_flash::init::<Permissions>(false),
];

snapshot_util::create_snapshot(snapshot_util::CreateSnapshotOptions {
cargo_manifest_dir: env!("CARGO_MANIFEST_DIR"),
snapshot_path,
startup_snapshot: Some(js::deno_isolate_init()),
extensions,
extensions_with_js: vec![],
additional_files: vec![js::get_99_main()],
compression_cb: None,
});
}
use deno_core::snapshot_util;
use deno_runtime::{permissions::Permissions, *};

use std::{env, path::PathBuf};

fn main() {
if env::var("HOST").unwrap() != env::var("TARGET").unwrap() {
panic!("Cross-compiling is not supported");
}

let evo_snapshot_path = PathBuf::from(env::var("OUT_DIR").unwrap()).join("EVO_SNAPSHOT.bin");
create_evo_snapshot(evo_snapshot_path.clone());

println!(
"cargo:rustc-env=EVO_SNAPSHOT_PATH={}",
evo_snapshot_path.to_str().unwrap()
);
}

fn create_evo_snapshot(snapshot_path: PathBuf) {
// from github.com/denoland/deno/blob/master/cli/build.rs (formatted + comments removed)
let extensions = vec![
deno_webidl::init(),
deno_console::init(),
deno_url::init(),
deno_tls::init(),
deno_web::init::<Permissions>(deno_web::BlobStore::default(), Default::default()),
deno_fetch::init::<Permissions>(Default::default()),
deno_cache::init::<deno_cache::SqliteBackedCache>(None),
deno_websocket::init::<Permissions>("".to_owned(), None, None),
deno_webstorage::init(None),
deno_crypto::init(None),
deno_webgpu::init(false),
deno_broadcast_channel::init(
deno_broadcast_channel::InMemoryBroadcastChannel::default(),
false,
),
deno_node::init::<Permissions>(None),
deno_ffi::init::<Permissions>(false),
deno_net::init::<Permissions>(None, false, None),
deno_napi::init::<Permissions>(false),
deno_http::init(),
deno_flash::init::<Permissions>(false),
];

snapshot_util::create_snapshot(snapshot_util::CreateSnapshotOptions {
cargo_manifest_dir: env!("CARGO_MANIFEST_DIR"),
snapshot_path,
startup_snapshot: Some(js::deno_isolate_init()),
extensions,
extensions_with_js: vec![],
additional_files: vec![js::get_99_main()],
compression_cb: None,
});
}
58 replies
DDeno
Created by orvit on 11/14/2022 in #help
deno_core Extension with Global Access
ah
58 replies
DDeno
Created by orvit on 11/14/2022 in #help
deno_core Extension with Global Access
Also, any specific reason why runtime defines all the default runtime extensions as extensions_with_js instead of just extensions like in the cli?
58 replies
DDeno
Created by orvit on 11/14/2022 in #help
deno_core Extension with Global Access
The only that would work with everything would be to create an ext module that re-exports everything but I don't see that being a good solution to a small problem
58 replies
DDeno
Created by orvit on 11/14/2022 in #help
deno_core Extension with Global Access
That was the idea I had, but unless you want to do that in deno_core or made a new package for that, you couldn't access it in the runtime build script
58 replies
DDeno
Created by orvit on 11/14/2022 in #help
deno_core Extension with Global Access
Yet again, the cli also includes all those extensions, so a function would allow one list for the runtime and cli to use. runtime build script cant access runtime nvm
58 replies
DDeno
Created by orvit on 11/14/2022 in #help
deno_core Extension with Global Access
The only solution I could think of for improving maintainability is making a function to get all default extensions built into deno_runtime, but that seems like an unnecessary solution to something that isn't much of a problem.
58 replies
DDeno
Created by orvit on 11/14/2022 in #help
deno_core Extension with Global Access
I mean it wouldn't be challenging to add all the extensions to my project, it's just maintaining that list would be frustrating.
58 replies
DDeno
Created by orvit on 11/14/2022 in #help
deno_core Extension with Global Access
It seems you have to include every single extension the runtime uses for a successful build. Seems kinda frustrating, and would make maintaining the list frustrating.
58 replies
DDeno
Created by orvit on 11/14/2022 in #help
deno_core Extension with Global Access
@crowlkats it errors out if you leave extensions as a vec. Is this intended?
58 replies
DDeno
Created by orvit on 11/14/2022 in #help
deno_core Extension with Global Access
use deno_core::snapshot_util;
use std::path::PathBuf;

fn main() {
let snapshot_path = PathBuf::from(std::env::var_os("OUT_DIR").unwrap()).join("EVO_SNAPSHOT.bin");
create_snapshot(snapshot_path.clone());

println!("cargo:rustc-env=EVO_SNAPSHOT_PATH={}", snapshot_path.to_str().unwrap());
}

fn create_snapshot(snapshot_path: PathBuf) {
snapshot_util::create_snapshot(snapshot_util::CreateSnapshotOptions {
cargo_manifest_dir: env!("CARGO_MANIFEST_DIR"),
snapshot_path,
startup_snapshot: Some(deno_runtime::js::deno_isolate_init()),
extensions: vec![],
extensions_with_js: vec![],
additional_files: vec![deno_runtime::js::get_99_main()],
compression_cb: None,
});
}
use deno_core::snapshot_util;
use std::path::PathBuf;

fn main() {
let snapshot_path = PathBuf::from(std::env::var_os("OUT_DIR").unwrap()).join("EVO_SNAPSHOT.bin");
create_snapshot(snapshot_path.clone());

println!("cargo:rustc-env=EVO_SNAPSHOT_PATH={}", snapshot_path.to_str().unwrap());
}

fn create_snapshot(snapshot_path: PathBuf) {
snapshot_util::create_snapshot(snapshot_util::CreateSnapshotOptions {
cargo_manifest_dir: env!("CARGO_MANIFEST_DIR"),
snapshot_path,
startup_snapshot: Some(deno_runtime::js::deno_isolate_init()),
extensions: vec![],
extensions_with_js: vec![],
additional_files: vec![deno_runtime::js::get_99_main()],
compression_cb: None,
});
}
58 replies
DDeno
Created by orvit on 11/14/2022 in #help
deno_core Extension with Global Access
error: failed to run custom build command for `runtime v0.1.0 (/workspaces/runtime)`

Caused by:
process didn't exit successfully: `/workspaces/runtime/target/debug/build/runtime-7279b5b14e8d927f/build-script-build` (signal: 5, SIGTRAP: trace/breakpoint trap)
--- stderr
Unknown external reference 0x21.
<unresolved>
error: failed to run custom build command for `runtime v0.1.0 (/workspaces/runtime)`

Caused by:
process didn't exit successfully: `/workspaces/runtime/target/debug/build/runtime-7279b5b14e8d927f/build-script-build` (signal: 5, SIGTRAP: trace/breakpoint trap)
--- stderr
Unknown external reference 0x21.
<unresolved>
hmm
58 replies
DDeno
Created by orvit on 11/14/2022 in #help
deno_core Extension with Global Access
If I want all the default extensions in the cli, would I have to add those myself?
58 replies
DDeno
Created by orvit on 11/14/2022 in #help
deno_core Extension with Global Access
Thank you 😄
58 replies
DDeno
Created by orvit on 11/14/2022 in #help
deno_core Extension with Global Access
Could I have this please?
58 replies