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

47 lines
1.5 KiB
TOML
Raw Normal View History

# Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.
[package]
name = "deno_core"
version = "0.154.0"
authors = ["the Deno authors"]
edition = "2021"
license = "MIT"
2019-04-04 09:35:52 -04:00
readme = "README.md"
repository = "https://github.com/denoland/deno"
2021-09-16 02:25:06 -04:00
description = "A modern JavaScript/TypeScript runtime built with V8, Rust, and Tokio"
[lib]
path = "lib.rs"
[features]
default = ["v8_use_custom_libcxx"]
v8_use_custom_libcxx = ["v8/use_custom_libcxx"]
[dependencies]
2022-05-05 06:41:59 -04:00
anyhow = "1.0.57"
feat(core): improve resource read & write traits (#16115) This commit introduces two new buffer wrapper types to `deno_core`. The main benefit of these new wrappers is that they can wrap a number of different underlying buffer types. This allows for a more flexible read and write API on resources that will require less copying of data between different buffer representations. - `BufView` is a read-only view onto a buffer. It can be backed by `ZeroCopyBuf`, `Vec<u8>`, and `bytes::Bytes`. - `BufViewMut` is a read-write view onto a buffer. It can be cheaply converted into a `BufView`. It can be backed by `ZeroCopyBuf` or `Vec<u8>`. Both new buffer views have a cursor. This means that the start point of the view can be constrained to write / read from just a slice of the view. Only the start point of the slice can be adjusted. The end point is fixed. To adjust the end point, the underlying buffer needs to be truncated. Readable resources have been changed to better cater to resources that do not support BYOB reads. The basic `read` method now returns a `BufView` instead of taking a `ZeroCopyBuf` to fill. This allows the operation to return buffers that the resource has already allocated, instead of forcing the caller to allocate the buffer. BYOB reads are still very useful for resources that support them, so a new `read_byob` method has been added that takes a `BufViewMut` to fill. `op_read` attempts to use `read_byob` if the resource supports it, which falls back to `read` and performs an additional copy if it does not. For Rust->JS reads this change should have no impact, but for Rust->Rust reads, this allows the caller to avoid an additional copy in many scenarios. This combined with the support for `BufView` to be backed by `bytes::Bytes` allows us to avoid one data copy when piping from a `fetch` response into an `ext/http` response. Writable resources have been changed to take a `BufView` instead of a `ZeroCopyBuf` as an argument. This allows for less copying of data in certain scenarios, as described above. Additionally a new `Resource::write_all` method has been added that takes a `BufView` and continually attempts to write the resource until the entire buffer has been written. Certain resources like files can override this method to provide a more efficient `write_all` implementation.
2022-10-09 10:49:25 -04:00
bytes = "1"
deno_ops = { path = "../ops", version = "0.32.0" }
2022-03-04 17:08:04 -05:00
futures = "0.3.21"
# Stay on 1.6 to avoid a dependency cycle in ahash https://github.com/tkaitchuck/aHash/issues/95
# Projects not depending on ahash are unafected as cargo will pull any 1.X that is >= 1.6.
indexmap = "1.6"
libc = "0.2.126"
2022-05-05 06:41:59 -04:00
log = "0.4.16"
once_cell = "1.10.0"
parking_lot = "0.12.0"
pin-project = "1.0.11"
2022-05-05 06:41:59 -04:00
serde = { version = "1.0.136", features = ["derive"] }
serde_json = { version = "1.0.79", features = ["preserve_order"] }
serde_v8 = { version = "0.65.0", path = "../serde_v8" }
2022-09-16 19:11:30 -04:00
sourcemap = "6.1"
url = { version = "2.3.1", features = ["serde", "expose_internals"] }
v8 = { version = "0.53.0", default-features = false }
2020-01-05 09:19:29 -05:00
[[example]]
name = "http_bench_json_ops"
path = "examples/http_bench_json_ops.rs"
# These dependencies are only used for the 'http_bench_*_ops' examples.
[dev-dependencies]
2022-09-07 15:06:18 -04:00
deno_ast = { version = "0.19.0", features = ["transpiling"] }
2022-09-16 19:11:30 -04:00
tokio = { version = "1.21", features = ["full"] }