summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-10-17bench: don't send data to grafana (#16324)Bartek Iwańczuk
ci / bench release ubuntu-20.04-xl (pull_request) went from 24m to 23m
2022-10-17bench: run HTTP benches for 10s (#16322)Bartek Iwańczuk
ci / bench release ubuntu-20.04-xl (pull_request) went from 27m to 24m
2022-10-17fix(ext/fetch): set accept-encoding: identity if range header is present ↵Marcos Casagrande
(#16197) https://fetch.spec.whatwg.org/#http-network-or-cache-fetch > If httpRequest’s header list contains `Range`, then append (`Accept-Encoding`, `identity`) > to httpRequest’s header list. > > This avoids a failure when handling content codings with a part of an encoded response. > Additionally, many servers mistakenly ignore `Range` headers if a non-identity encoding is accepted.
2022-10-17feat(unstable/npm): support providing npm dist-tag in npm package specifier ↵David Sherret
(#16293)
2022-10-17perf(ext/web): optimize timer cancellation (#16316)Divy Srivastava
Towards #16315 It created a bunch of Error objects and rejected the promise. This patch changes `op_sleep` to resolve with `true` if it was cancelled.
2022-10-17feat(unstable): add windowsRawArguments to SpawnOptions (#16319)Yoshiya Hinosawa
This change adds `windowsRawArguments` to `SpawnOptions`. The option enables skipping the default quoting and escaping while creating the command on windows. The option works in a similar way as `windowsVerbatimArguments` in child_process.spawn options in Node.js, and is necessary for simulating it in `std/node`. closes #8852
2022-10-17perf(ext/web): optimize `op_cancel_handle` (#16318)Divy Srivastava
Towards #16315
2022-10-17fix(lsp): treat empty import map value config as none (#16224)Tomofumi Chiba
Ref: denoland/vscode_deno#718 Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-10-17fix(build) fix linux symbols export list format (#16313)Luke Channings
Fixes the error reported in #16304. > = note: /usr/bin/ld:/home/abotella/Projects/deno/cli/generated_symbol_exports_list_linux.def:1: syntax error in dynamic list collect2: error: ld returned 1 exit status This was caused by the format of the symbols list on Linux being malformed (as the error implies). The format is documented in ld's [VERSION](https://sourceware.org/binutils/docs/ld/VERSION.html) as well as: > --export-dynamic-symbol-list=file Specify a --export-dynamic-symbol for each pattern in the file. The format of the file is the same as the version node without scope and node name. See VERSION for more information. Previously, the format for the Linux symbols list was simply a list of symbols, now it follows the format: ``` { symbol_name_a; ...; symbol_name_z }; ```
2022-10-16fix(cli/bench): skip strace table border (#16310)Marcos Casagrande
It crashes due to the table border output from `strace`, ``` % time seconds usecs/call calls errors syscall ------ ----------- ----------- --------- --------- ---------------- # this is skipped correctly 61.27 6.012053 678 8860 637 futex 0.00 0.000000 0 4 geteuid ------ ----------- ----------- --------- --------- ---------------- # this causes the crash 100.00 11.732230 25552 1205 total ``` It's flaky because that line is not always skipped from the output, for some reason that I've yet to find out.
2022-10-16fix: add error cause in recursive cause tail (#16306)Cre3per
2022-10-16fix(ext/cache): illegal constructor (#16205)Marcos Casagrande
2022-10-16refactor(core): make `borrow_mut` more explicit in the ops macro (#16025)ad hoc
2022-10-16fix(npm): disable loading native module for "fsevents" package (#16273)Bartek Iwańczuk
Currently causes a hang in Vite, disable this one specific package as remaining tests for NAPI in various modules work fine.
2022-10-16chore: upgrade rusty_v8 to 0.53.1 (#16303)Bartek Iwańczuk
This commit fixes startup time regression, caused by update to rusty_v8 v0.50.0.
2022-10-16feat: support inlay hints (#16287)Kitson Kelly
Closes: #11853
2022-10-15refactor: Add default implementation for WorkerOptions (#14860)Christian Dürr
This adds an implementation of `Default` for both `WorkerOptions` and `BootstrapOptions`. Since both of these structs are rather big, this should make it easier for people unfamiliar with the internals to focus on the options relevant to them. As a user of `deno_runtime` I feel like these should serve as good defaults, getting people them started without having to tweak the runtime. Additionally even if some changes are made, the usage of `..Default::default()` will significantly help with code clarity and verbosity.
2022-10-15feat(unstable/task): add `INIT_CWD` env var (#16110)David Sherret
2022-10-15fix(docs): Documentation improvements related to `JsRealm`. (#16247)Andreu Botella
2022-10-15refactor(build): better handle old glibc (#16238)Luke Channings
Follow-up to #16208. - Refactors build.rs behaviour to use `-exported_symbols_list` / `--export-dynamic-symbol-list` - Since all build systems now rely on a symbols list file, I have added `generate_exported_symbols_list`, which derives the symbol list file depending on the platform, which makes `tools/napi/generate_link_win.js` redundant. - Fixes a missed instance of `i8` being used instead of `c_char` Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2022-10-15refactor(core): use isolate get_data/set_data instead of slots (#16286)Bartek Iwańczuk
2022-10-15chore: fix windows-only clippy errors (#16289)David Sherret
2022-10-15bench: don't show output (#16288)Bartek Iwańczuk
Benchmarks are extremely noisy and it makes it impossible to inspect what's going on in GitHub action logger.
2022-10-15fix(ext/ffi): Fix UnsafeCallback ref'ing making Deno enter a live-loop (#16216)Aapo Alasuutari
Fixes #15136 Currently `UnsafeCallback` class' `ref()` and `unref()` methods rely on the `event_loop_middleware` implementation in core. If even a single `UnsafeCallback` is ref'ed, then the FFI event loop middleware will always return `true` to signify that there may still be more work for the event loop to do. The middleware handling in core does not wait a moment to check again, but will instead synchronously directly re-poll the event loop and middlewares for more work. This becomes a live-loop. This PR introduces a `Future` implementation for the `CallbackInfo` struct that acts as the intermediary data storage between an `UnsafeCallback` and the `libffi` C callback. Ref'ing a callback now means calling an async op that binds to the `CallbackInfo` Future and only resolves once the callback is unref'ed. The `libffi` C callback will call the waker of this Future when it fires to make sure that the main thread wakes up to receive the callback.
2022-10-15bench: avoid port collision (#16285)Bartek Iwańczuk
2022-10-15fix(ext/websocket): panic on no next ws message from an already closed ↵Aapo Alasuutari
stream (#16004)
2022-10-15fix(ext/crypto): correct HMAC get key length op (#16201)Filip Skokan
fixes #16180 `HMAC`'s `get key length` `op` uses the hash function's block size, not output size. refs https://github.com/cloudflare/workerd/issues/68#issuecomment-1271189657
2022-10-15chore: upgrade rusty_v8 to 0.53.0 (#16272)Bartek Iwańczuk
2022-10-14fix(lsp): properly handle snippets on completions (#16274)Kitson Kelly
Fixes #15367
2022-10-14fix(ext/web/streams): enqueue to second branch before closing (#16269)Marcos Casagrande
Co-authored-by: Luca Casonato <hello@lcas.dev>
2022-10-14fix(ext/fetch): throw TypeError on non-Uint8Array chunk (#16262)Marcos Casagrande
2022-10-14fix(ext/web/streams): resolve cancelPromise in ReadableStreamTee (#16266)Marcos Casagrande
2022-10-13fix(ext/ffi): Invalid 'function' return type check logic, remove U32x2 as ↵Aapo Alasuutari
unnecessary (#16259) The return type checking for `"function"` type FFI values was incorrect and presumed that functions were still being registered as objects containing a "function" key. While here, I also removed the whole return type checking logic as it was needed for optionally creating BigInts on return when needed, but serde_v8 does this automatically now (I think).
2022-10-13fix(cli): allow importMap to be an absolute URL within the deno config file ↵Mark Gibson
(#16234)
2022-10-13chore: Added onbeforeunload to window type definition (#16251)Matt Ezell
2022-10-12chore(ext/web): fix typo (#16248)Xiao Xiao
implictly -> implicitly assiging -> assigning
2022-10-12fix(ext/fetch): throw TypeError on read failure (#16219)Marcos Casagrande
2022-10-12fix(cli): skip removing the latter part if `@` appears at the beginning (#16244)Yusuke Tanaka
This commit prevents panics that `deno compile` command ran into under certain conditions from occurring. Such conditions are as follows. - the target file name begins with `@`, OR - the stem part of the target file name is equal to one of ["main", "index", "mod", "index"] && the parent directory name starts with `@` Fixes #16243
2022-10-10fix(ext/fetch): fix illegal header regex (#16236)Marcos Casagrande
This PR fixes invalid header parsing which is flaky because `g` flag is being used in the regex, which keeps track of `lastIndex` ```javascript try { new Headers([["x", "\u0000x"]]); // error } catch(e) {} new Headers([["x", "\u0000x"]]); // no error ``` This issue affects `Response` & `Request` constructors as well
2022-10-10fix sparse array inspection (#16204)sigmaSd
fix https://github.com/denoland/deno/issues/16202
2022-10-10feat(core): add Deno.core.writeAll(rid, chunk) (#16228)Luca Casonato
This commit adds a new op_write_all to core that allows writing an entire chunk in a single async op call. Internally this calls `Resource::write_all`. The `writableStreamForRid` has been moved to `06_streams.js` now, and uses this new op. Various other code paths now also use this new op. Closes #16227
2022-10-10perf(ext/cache): set journal_mode=wal (#16231)Satya Rohith
2022-10-10fix(npm): support compiling on linux/aarch64 (#16208)Luke Channings
Changes introduced in #13633 have broken the ability to compile for linux/aarch64 - specifically the use of a `i8` as a char type, which is an `u8` on linux/aarch64. This PR: - Replaces instances of `i8` with the architecture-aware wrapper type `c_char` - Skips the use of `--export-dynamic-symbol` on linux-aarch64, because the target environments often rely on older libc/binutils versions
2022-10-09feat(core): improve resource read & write traits (#16115)Luca Casonato
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-09perf(ext/crypto): optimize `getRandomValues` (#16212)Divy Srivastava
2022-10-08fix(ext/fetch): reject immediately on aborted signal (#16190)Marcos Casagrande
Enabled the following test: https://github.com/web-platform-tests/wpt/blob/edc428e8e229429acd723efc7a6d41010c94fc41/fetch/api/abort/general.any.js#L185-L201
2022-10-08test(ext/fetch): enable fetch/content-type/multipart.window WPT (#16209)Marcos Casagrande
This PR enables the following test: https://github.com/web-platform-tests/wpt/blob/master/fetch/content-type/multipart.window.js
2022-10-08fix(serde_v8): avoid creating unsound slice reference (#16189)Nugine
This commit fixes one ocurrence of unsoundness by using the newly added API (`v8::String::write_utf8_uninit`). See also [`clippy:uninit_vec`](https://rust-lang.github.io/rust-clippy/master/index.html#uninit_vec). Note that it is not actually a bug. Avoiding unsoundness improves our code quality.
2022-10-08chore(napi_sym): fix readme path (#16203)李瑞丰
2022-10-07feat(core): Reorder extension initialization (#16136)Jakub Łabor