summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
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
2022-10-07fix(ext/fetch): support empty formdata (#16165)Marcos Casagrande
This PR adds support for empty `FormData` parsing in `Response`/`Request` ```js new Response(new FormData()).formData() ``` ref: https://github.com/web-platform-tests/wpt/issues/28607
2022-10-07perf(napi): optimize primitive napi functions (#16163)Divy Srivastava
This optimization applies on `napi_get_undefined`, `napi_get_null` & `napi_get_boolean`. ``` # main benchmark time (avg) (min … max) p75 p99 p995 ---------------------------------------------------------- ----------------------------- warmup 482.55 ps/iter (462.5 ps … 15.67 ns) 475 ps 525 ps 829.1 ps napi_get_undefined 25.07 ns/iter (24.03 ns … 36.87 ns) 25.37 ns 27.09 ns 34.85 ns ``` ``` # This patch benchmark time (avg) (min … max) p75 p99 p995 ---------------------------------------------------------- ----------------------------- warmup 484.78 ps/iter (462.5 ps … 14.4 ns) 475 ps 554.1 ps 583.3 ps napi_get_undefined 15.52 ns/iter (15.35 ns … 22.14 ns) 15.41 ns 17.18 ns 20.02 ns ```
2022-10-07chore(napi): Add README explainer for cli/napi_sym and cli/napi (#16187)Divy Srivastava
2022-10-07fix(ext/ffi): Fix usize and isize FFI callback parameters missing match arm ↵Aapo Alasuutari
(#16172) Mea culpa. Back when I re-introduced parameter and return value types to FFI callbacks I failed to properly account for the change in match arm logic. As a result, usize and isize parameters in FFI callbacks currently enter the branch meant for void only. This PR changes the match arms to all be explicit, making sure that void is the only arm marked unreachable and that it stays that way.
2022-10-07chore: upgrade rusty_v8 to 0.52.0 (#16183)Bartek Iwańczuk
2022-10-07fix(napi): move napi symbols file (#16179)Colin Ihrig
The current location was causing failures during v1.26.1 publication. <!-- Before submitting a PR, please read http://deno.land/manual/contributing 1. Give the PR a descriptive title. Examples of good title: - fix(std/http): Fix race condition in server - docs(console): Update docstrings - feat(doc): Handle nested reexports Examples of bad title: - fix #7123 - update docs - fix bugs 2. Ensure there is a related issue and it is referenced in the PR text. 3. Ensure there are tests that cover the changes. 4. Ensure `cargo test` passes. 5. Ensure `./tools/format.js` passes without changing files. 6. Ensure `./tools/lint.js` passes. -->
2022-10-07refactor(napi): simplify `napi_value` interface (#16170)Divy Srivastava
2022-10-06chore: forward v1.26.1 release commit to main (#16178)denobot
This is the release commit being forwarded back to main for 1.26.1 Please ensure: - [x] Everything looks ok in the PR - [x] The release has been published To make edits to this PR: ```shell git fetch upstream forward_v1.26.1 && git checkout -b forward_v1.26.1 upstream/forward_v1.26.1 ``` Don't need this PR? Close it. cc @cjihrig Co-authored-by: cjihrig <cjihrig@users.noreply.github.com>
2022-10-06fix(build): don't export all symbols to dynamic symbol table (#16171)Divy Srivastava
Currently, we use `-rdynamic` for exporting Node API symbols to the symbol table. `-rdynamic` will export *all* symbols, that means previously unused functions will not be optimized away introducing a lot of binary bloat. This patch uses `-exported_symbol` and `--export-dynamic-symbol` link flags (not as universal as `-rdynamic`) to only mark Node API symbols to be put in the dynamic symbol table.
2022-10-05fix(node): add dns/promises and stream/consumers (#16169)David Sherret
2022-10-05refactor(ext/fetch): simplify parseContentDisposition (#16162)Marcos Casagrande
Replaced `forEach`, `map`, `filter`, `map` with a single `for` loop
2022-10-05feat(npm): implement Node API (#13633)Divy Srivastava
This PR implements the NAPI for loading native modules into Deno. Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com> Co-authored-by: DjDeveloper <43033058+DjDeveloperr@users.noreply.github.com> Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
2022-10-05fix(ext/cache): prevent cache insert if body is not fully written (#16138)Marcos Casagrande
2022-10-05fix(ext/flash): Avoid sending Content-Length when status code is 204 (#15901)ayame113
Currently Content-Length is sent when the status code is 204. However, according to the spec, this should not be sent. Modify the if statement below to prevent the Content-Length from being sent.
2022-10-04refactor: remove old Node compat code (#16142)Bartek Iwańczuk
This code was introduced in 808f797633ba82c0e9198481ddd742284a03cb9c and was needed for "compat mode". Since "compat mode" was removed in v1.26, this code is no longer needed.
2022-10-04perf(ext/fetch): consume body using ops (#16038)Marcos Casagrande
This commit adds a fast path to `Request` and `Response` that make consuming request bodies much faster when using `Body#text`, `Body#arrayBuffer`, and `Body#blob`, if the body is a FastStream. Because the response bodies for `fetch` are FastStream, this speeds up consuming `fetch` response bodies significantly.
2022-10-04chore: remove 'fix_exotic_specifier' test (#16143)Bartek Iwańczuk
It's a test that's been flaky for a week, and after offline discussion, we're no longer sure what it's testing.
2022-10-04fix(ext/crypto): interoperable import/export (#16153)Filip Skokan
This PR updates RSA key import/export to a state which is interoperable with other implementations. For RSA the only OID in and out is `rsaEncryption`. For EC the only OID in and out is `id-ecpublickey` (fixed in #16152). see https://github.com/w3c/webcrypto/issues/307#issuecomment-995813032 see https://github.com/w3c/webcrypto/issues/307 see https://github.com/w3c/webcrypto/pull/305 see https://github.com/nodejs/node/pull/42816
2022-10-04fix(ext/crypto): ecdh spki key import/export roundtrip (#16152)Filip Skokan
2022-10-04fix(ext/crypto): ECDH and X25519 non byte length and 0 length fixes (#16146)Filip Skokan
2022-10-03fix(ext/crypto): deriveBits for ECDH not taking length into account (#16128)Aurélien Bertron
Fixes #16047
2022-10-03fix(ext/crypto): curve25519 import export (#16140)Filip Skokan
2022-10-03feat(unstable): add support for npm specifier cli arguments for 'deno cache' ↵Bartek Iwańczuk
(#16141) This commit adds support for npm specifier in "deno cache" subcommand. ``` $ deno cache --unstable npm:vite npm:chalk https://deno.land/std/http/file_server.ts ``` Besides downloading requested npm package(s), it will also download necessary code from "std/node/".
2022-10-03fix(npm): better error is version is specified after subpath (#16131)Bartek Iwańczuk
2022-10-03fix(npm): panic on invalid package name (#16123)Bartek Iwańczuk