0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-03-11 14:47:26 -04:00
deno/core
Ryan Dahl 958b374f09
upgrade serde_v8 and rusty_v8 (#12175)
* upgrade serde_v8 and rusty_v8

* rusty_v8 0.30.0

* cycle keys
2021-09-22 18:51:11 +02:00
..
examples
00_primordials.js
01_core.js perf(ext/http): optimize auto cleanup of request resource (#11978) 2021-09-10 15:47:09 -07:00
02_error.js fix(cli/fmt_errors): Abbreviate long data URLs in stack traces (#12127) 2021-09-18 15:40:04 +02:00
async_cancel.rs
async_cell.rs
bindings.rs refactor(core): Turn the wasm_streaming_feed binding into ops (#11985) 2021-09-13 14:27:54 +02:00
Cargo.toml upgrade serde_v8 and rusty_v8 (#12175) 2021-09-22 18:51:11 +02:00
encode_decode_test.js
error.rs fix(ext/web): Format terminal DOMExceptions properly (#11834) 2021-09-06 22:59:20 +02:00
error_builder_test.js
extensions.rs
flags.rs
gotham_state.rs
icudtl.dat
inspector.rs fix(doc): fix rustdoc bare_urls warning (#11921) 2021-09-05 16:22:45 +02:00
internal.d.ts
lib.deno_core.d.ts refactor(core): Turn the wasm_streaming_feed binding into ops (#11985) 2021-09-13 14:27:54 +02:00
lib.rs fix(doc): fix rustdoc bare_urls warning (#11921) 2021-09-05 16:22:45 +02:00
module_specifier.rs fix(doc): fix rustdoc bare_urls warning (#11921) 2021-09-05 16:22:45 +02:00
modules.rs fix(core): prevent multiple main module loading (#12128) 2021-09-18 03:44:53 +02:00
normalize_path.rs fix(doc): fix rustdoc bare_urls warning (#11921) 2021-09-05 16:22:45 +02:00
ops.rs
ops_builtin.rs refactor(core): Turn the wasm_streaming_feed binding into ops (#11985) 2021-09-13 14:27:54 +02:00
ops_json.rs
README.md
resources.rs
runtime.rs fix(core): prevent multiple main module loading (#12128) 2021-09-18 03:44:53 +02:00
serialize_deserialize_test.js

Deno Core Crate

crates docs

The main dependency of this crate is rusty_v8, which provides the V8-Rust bindings.

This Rust crate contains the essential V8 bindings for Deno's command-line interface (Deno CLI). The main abstraction here is the JsRuntime which provides a way to execute JavaScript.

The JsRuntime implements an event loop abstraction for the executed code that keeps track of all pending tasks (async ops, dynamic module loads). It is user's responsibility to drive that loop by using JsRuntime::run_event_loop method - it must be executed in the context of Rust's future executor (eg. tokio, smol).

In order to bind Rust functions into JavaScript, use the Deno.core.opSync() and Deno.core.opAsync() functions to trigger the "op_fn" callback in JsRuntime::register_op on Rust side. A conventional way to handle "op_fn" callbacks is to use the op_sync and op_async functions.

Documentation for this crate is thin at the moment. Please see hello_world.rs and http_bench_json_ops.rs as examples of usage.

TypeScript support and lots of other functionality are not available at this layer. See the CLI for that.