summaryrefslogtreecommitdiff
path: root/cli
AgeCommit message (Collapse)Author
2022-10-25fix: upgrade swc_ecma_parser to 0.122.19 - deno_ast 0.20 (#16406)David Sherret
2022-10-25feat: stabilize Deno.loadavg() (#16412)Colin Ihrig
2022-10-25feat(ext/web): use ArrayBuffer.was_detached() (#16307)Marcos Casagrande
This PR adds a way to reliably check if an ArrayBuffer was detached
2022-10-25feat(lint): add a report lint config setting (#16045)Brenley Dueck
Builds off this PR to add a "report" setting to deno.json which can be "pretty", "compact", or "json".
2022-10-24perf(ext/web): add op_encode_binary_string (#16352)Marcos Casagrande
Add a new op to use in `reader.readAsBinaryString(blob)`. ``` File API binary string: 400b 35.12 µs/iter (21.93 µs … 3.27 ms) 31.87 µs 131.95 µs 217.63 µs File API binary string: 4kb 46.49 µs/iter (29.36 µs … 4.42 ms) 42.5 µs 122.48 µs 155.1 µs File API binary string: 2.2mb 4.17 ms/iter (1.75 ms … 8.54 ms) 5.48 ms 7.39 ms 8.54 ms ``` **main** ``` benchmark time (avg) (min … max) p75 p99 p995 --------------------------------------------------------------------- ----------------------------- File API binary string: 400b 56.17 µs/iter (43.09 µs … 784.52 µs) 49.6 µs 177.18 µs 241.23 µs File API binary string: 4kb 277.2 µs/iter (240.29 µs … 1.84 ms) 269.87 µs 649.79 µs 774.46 µs File API binary string: 2.2mb 180.03 ms/iter (173.32 ms … 194.35 ms) 182.54 ms 194.35 ms 194.35 ms ``` It can also handle bigger files, when encoding a 200mb file, main crashes with OOM ``` <--- Last few GCs ---> [132677:0x560504676550] 5012 ms: Scavenge 417.3 (434.6) -> 401.8 (434.6) MB, 0.1 / 0.0 ms (average mu = 0.824, current mu = 0.825) allocation failure; [132677:0x560504676550] 5038 ms: Scavenge 417.3 (434.6) -> 401.8 (434.6) MB, 0.1 / 0.0 ms (average mu = 0.824, current mu = 0.825) allocation failure; [132677:0x560504676550] 5064 ms: Scavenge 417.3 (434.6) -> 401.8 (434.6) MB, 0.1 / 0.0 ms (average mu = 0.824, current mu = 0.825) allocation failure; ```
2022-10-24fix(cli): Fixed bug where the progress bar did not clear (#16401)nasa
2022-10-24feat: Stabilize Deno.stdin.setRaw() (#16399)Bartek Iwańczuk
2022-10-24perf(ext/streams): fast path when consuming body of tee'd stream (#16329)Marcos Casagrande
Add a fast path for consuming the body of cloned `Request`/`Response`, which is very common specially when using `cache` API.
2022-10-24feat(ext/net): add reuseAddress option for UDP (#13849)Gianluca Oldani
This commit adds a `reuseAddress` option for UDP sockets. When this option is enabled, one can listen on an address even though it is already being listened on from a different process or thread. The new socket will steal the address from the existing socket. On Windows and Linux this uses the `SO_REUSEADDR` option, while on other Unixes this is done with `SO_REUSEPORT`. This behavior aligns with what libuv does. TCP sockets still unconditionally set the `SO_REUSEADDR` flag - this behavior matches Node.js and Go. This PR does not change this behaviour. Co-authored-by: Luca Casonato <hello@lcas.dev>
2022-10-24fix(ext/net): don't remove sockets on unix listen (#16394)Luca Casonato
When listening on a UNIX socket path, Deno currently tries to unlink this path prior to actually listening. The implementation of this behaviour is VERY racy, involves 2 additional syscalls, and does not match the behaviour of any other runtime (Node.js, Go, Rust, etc). This commit removes this behaviour. If a user wants to listen on an existing socket, they must now unlink the file themselves prior to listening. This change in behaviour only impacts --unstable APIs, so it is not a breaking change.
2022-10-22fix(build) assume a custom compiler will support ↵Luke Channings
--export-dynamic-symbol-list linker flag. (#16387) This PR fixes a regression that caused deno binaries produced by the CI release workflows to be larger than expected. **The problem:** The build script will determine whether the linker supports the `--export-dynamic-symbol-list` flag by looking at the glibc version installed on the system. Ubuntu 20.04 ships with glibc 2.31, which does not support this flag. Upon investigation, I discovered that the CI pipeline does not use the gcc compiler provided by the `build-essential` package, and instead uses *clang-14*, which does support the new flag. **The solution:** Whenever a custom C Compiler is configured, the build script now assumes the compiler supports the `--export-dynamic-symbol-list` flag. This is not always going to be the case (you could use clang-8, for example), but it puts the onus on the user making the override to ensure the compiler has support. This will return deno builds for Linux to their previous size of ~100MB, and also allow builds under older glibc/gcc versions to succeed. If a user is compiling deno with a custom compiler that does not support this new flag, however, their build will fail. I expect this is a rare scenario, however, and suggest we cross that bridge if and when we come to it.
2022-10-22fix(lsp): regression - error when removing file (#16388)David Sherret
2022-10-22refactor: testable update checker code (#16386)David Sherret
2022-10-21feat(upgrade): check if user has write access to deno exe (#16378)sigmaSd
2022-10-21refactor(lockfile): migrate from v1 to v2 in-memory (#16385)Bartek Iwańczuk
<!-- 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-21feat(unstable/npm): initial type checking of npm specifiers (#16332)David Sherret
2022-10-21fix(upgrade): put prompt date in the past when creating a file (#16380)Bartek Iwańczuk
2022-10-21chore(core): remove `core.opSync` (#16379)Divy Srivastava
This patch removes the last uses of `core.opSync` from Deno. The new and JIT-friendly way to call sync ops is `core.ops.op_name()`.
2022-10-21fix(ext/ffi): Use PointerValue in UnsafePointerView and UnsafeFnPointer ↵Aapo Alasuutari
types (#16354) There were still remaining bigint usages for pointers. This now finally fixes all of them, there is only the one `type PointerValue = number | bigint;` line that references `bigint` in the unstable type definition file.
2022-10-21fix(ext/ffi): Use BufferSource for FFI buffer types (#16355)Aapo Alasuutari
Potential fix for type-code mismatch in FFI buffer types. The code supports ArrayBuffers, but types only reflect TypedArray support. There's also an existing type for this sort of stuff: `BufferSource`. (Although, it uses `ArrayBufferView` which doesn't actually connect with the TypedArray interfaces specifically, but it's just a type inheritance difference and nothing more.)
2022-10-21feat(update): prompt for new version once per day (#16375)Bartek Iwańczuk
<!-- 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-20refactor(cli): update checker - use a single option instead of two (#16372)David Sherret
2022-10-20fix(lsp): allow caching deps in non-saved files (#16353)David Sherret
2022-10-20feat(cli): check for updates in background (#15974)Bert Belder
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com> Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2022-10-20feat(ext/ffi): Make op_ffi_ptr_of fast (#16297)Aapo Alasuutari
Makes `op_ffi_ptr_of` fast. One of the tests changed from printing `false` to `true` as the fast `&[u8]` slice path creates the slice with a null pointer. Thus the `op_ffi_ptr_of` will now return a null pointer value whereas previously it returned a dangling pointer value.
2022-10-20perf(ext/ffi): Fast UnsafePointerView read functions (#16351)Aapo Alasuutari
This PR makes pointer read methods of `Deno.UnsafePointerView` Fast API compliant, with the exception of `getCString` which cannot be made fast with current V8 Fast API.
2022-10-19feat: Add new lockfile format (#16349)Bartek Iwańczuk
Introduces a new lockfile format that will be used to support locking "npm" dependencies. Currently the format looks as follows: ``` // This file is automatically generated by Deno, do not edit its contents // manually. This file should be commited to your repository. { "version": "2", "remote": { "https://deno.land/std@0.160.0/http/server.ts": "asdwetsw44523asdfgfas..", "https://deno.land/std@0.160.0/http/file_server.ts": "asdwetsw44523asdfgfas.." } } ``` A follow up PR will add "npm" key that will be used to store information related to "npm" dependencies and their resolution. The new format is used when `--lock-write` is present, if user tries to load a lock file using the old format it will still work.
2022-10-18refactor: better errors in lockfile and preparation for new version (#16344)Bartek Iwańczuk
A small cleanup that improves errors in the lockfile as well as prepares for adding a new format of the lock file that will allow to provide backward compatibility with existing format (ie. "Lockfile::content" will be changed into an enum "LockfileContent" that will have "V1" and "V2" variants).
2022-10-18feat: introduce navigator.language (#12322)Luca Matei Pintilie
Link to the spec: https://html.spec.whatwg.org/multipage/system-state.html#dom-navigator-language-dev Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-10-18feat(task): remove warning about being unstable (#16281)Bartek Iwańczuk
`deno task` has been in use for a few months now. It was very well received and there are not many complaints. I feel like this warning might be discouraging for some users and we don't really plan to make drastic changes to it (besides adding support for globs in unspecified future).
2022-10-18feat(unstable/task): fail task on async command failure (#16301)David Sherret
Tests and implementation are found here: https://github.com/denoland/deno_task_shell/pull/59 This is a breaking change, but `deno task` is unstable. > This changes async commands so that on non-zero exit code they will fail the entire task. For example: > > ```jsonc > // task that asynchronously starts a server and starts a watcher for the frontend > "dev": "deno task server & deno task frontend:watch" > ``` > > Previously when running `deno task dev`, if `deno task server` failed, the entire command would not fail, which kept in line with `sh`, but it's not very practical. This change causes `deno task dev` to fail. > > To opt out, developers can add an `|| exit 0`: > > ```jsonc > "dev": "deno task server || exit 0 & deno task frontend:watch" > ```
2022-10-18test(crypto): update crypto.getRandomValues calls (#16338)Filip Skokan
[`crypto.getRandomValues`](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues) does not return a Promise.
2022-10-18fix: move generated napi symbols to cli/ (#16330)Bartek Iwańczuk
<!-- 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-18fix(ext/net): return an error from `startTls` and `serveHttp` if the ↵Yusuke Tanaka
original connection is captured elsewhere (#16242) This commit removes the calls to `expect()` on `std::rc::Rc`, which caused Deno to panic under certain situations. We now return an error if `Rc` is referenced by other variables. Fixes #9360 Fixes #13345 Fixes #13926 Fixes #16241 Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-10-17chore: upgrade internal deno_std to 0.160 (#16333)David Sherret
2022-10-17chore: forward v1.26.2 to main (#16331)Bartek Iwańczuk
Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com> <!-- 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. --> Co-authored-by: denobot <33910674+denobot@users.noreply.github.com> Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
2022-10-17perf(npm): parallelize caching of npm specifier package infos (#16323)David Sherret
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-17feat(unstable/npm): support providing npm dist-tag in npm package specifier ↵David Sherret
(#16293)
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-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: add error cause in recursive cause tail (#16306)Cre3per
2022-10-16fix(ext/cache): illegal constructor (#16205)Marcos Casagrande
2022-10-16feat: support inlay hints (#16287)Kitson Kelly
Closes: #11853
2022-10-15feat(unstable/task): add `INIT_CWD` env var (#16110)David Sherret
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-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.