1. Removes the access check callback, which was kind of confusing.
1. Requires `CheckedPath` for everything in the `FileSystem` trait to
ensure we're always checking permissions.
This commit adds support for using
[vsock](https://man7.org/linux/man-pages/man7/vsock.7.html) transport in
fetch API on Linux and macOS.
Similar to #29154, a vsock transport can be specified in the `proxy`
field when calling `Deno.createHttpClient`.
```ts
const client = Deno.createHttpClient({
proxy: {
transport: "vsock",
cid: 2,
port: 80,
},
});
await fetch("http://localhost/ping", { client });
```
This commit adds support for using Unix socket proxies in `fetch` API.
This is facilitated by passing an appropriate `Deno.HttpClient` instance
to the `fetch` API:
```
const client = Deno.createHttpClient({
proxy: {
transport: "unix",
path: "/path/to/unix.sock",
},
});
await fetch("http://localhost/ping", { client });
```
Closes https://github.com/denoland/deno/issues/8821
---------
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
implement lazy(?) mode. an unconfigured jsruntime is created if
DENO_UNSTABLE_CONTROL_SOCK is present, and later passed into deno_runtime to be
configured and used.
This extracts out the shared libraries and `.node` native modules to a
temp file and opens them from there. **This means that this
implementation will not work in every scenario.** For example, a library
could require other files that only exist in the in-memory file system.
To solve that, we'll introduce
https://github.com/denoland/deno/issues/28918 later or adapt this
solution to solve more issues.
Additionally, this will not work when run on readonly file systems.
results on my machine (Macbook pro w/ M3 Max)
canary (hello world):
```
❯ oha -c 125 -n 4000000 --no-tui --disable-compression http://localhost:8000
Summary:
Success rate: 100.00%
Total: 31.0160 secs
Slowest: 0.0083 secs
Fastest: 0.0005 secs
Average: 0.0010 secs
Requests/sec: 128965.6454
Total data: 49.59 MiB
Size/request: 13 B
Size/sec: 1.60 MiB
```
this PR (hello world):
```
❯ oha -c 125 -n 4000000 --no-tui --disable-compression http://localhost:8000
Summary:
Success rate: 100.00%
Total: 28.4050 secs
Slowest: 0.0085 secs
Fastest: 0.0001 secs
Average: 0.0009 secs
Requests/sec: 140820.2060
Total data: 49.59 MiB
Size/request: 13 B
Size/sec: 1.75 MiB
```
---
Two changes here:
- use `opt-level` 3 for some of hyper's deps, since profile overrides
are not transitive
- As noted in the [cargo
reference](https://doc.rust-lang.org/cargo/reference/profiles.html#overrides-and-generics)
generic functions _may_ be optimized at the opt-level of the
_instantiating_ crate, rather than the defining crate. So currently it's
possible that some of the functions in `deno_http` are being compiled at
a lower optimization level. This PR ensures the generics are
instantiated in `deno_http`, which theoretically should guarantee they
actually use opt-level 3.
To allow embedders to still provide a custom property extractor, I put
this behind a feature flag.
This commit changes the TS host implementation
in the LSP to use the same snapshot as the runtime worker
and web worker use.
This is due to upcoming V8 upgrade that might require
that all isolates in the same process use the exact same
snapshot.