summaryrefslogtreecommitdiff
path: root/cli
AgeCommit message (Collapse)Author
2024-05-23refactor: remove custom `utc_now` in favor of `chrono::Utc:now` feature ↵Felipe Baltor
(#23888) This PR removes the use of the custom `utc_now` function in favor of the `chrono` implementation. It resolves #22864. --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-05-23perf(startup): use WAL journal for sqlite databases in DENO_DIR (#23955)Bert Belder
While investigating poor cold start performance on my GCP VM (32 cores, 130GB SSD), I found that writing to the various sqlite databases in DENO_DIR was quite slow. The slowness seems to primarily be caused by excessive latency from a number of `fsync()` calls. The performance difference is best demonstrated by deleting the sqlite databases from DENO_DIR while leaving the downloaded sources in place. The benchmark (see notes below): ``` piscisaureus@bert-us:~/erofs/source$ export DENO_DIR=./.deno piscisaureus@bert-us:~/erofs/source$ hyperfine --warmup 3 \ --prepare "rm -rf .deno/*_v1*" \ "deno run -A --cached-only demo.ts" \ "eatmydata deno run -A --cached-only demo.ts" \ "~/deno/target/release/deno run -A --cached-only demo.ts" Benchmark 1: deno run -A --cached-only demo.ts Time (mean ± σ): 1.174 s ± 0.037 s [User: 0.153 s, System: 0.184 s] Range (min … max): 1.104 s … 1.212 s 10 runs Benchmark 2: eatmydata deno run -A --cached-only demo.ts Time (mean ± σ): 265.5 ms ± 3.6 ms [User: 138.5 ms, System: 135.1 ms] Range (min … max): 260.6 ms … 271.2 ms 11 runs Benchmark 3: ~/deno/target/release/deno run -A --cached-only demo.ts Time (mean ± σ): 226.2 ms ± 9.2 ms [User: 136.7 ms, System: 93.3 ms] Range (min … max): 218.8 ms … 247.1 ms 13 runs Summary ~/deno/target/release/deno run -A --cached-only demo.ts ran 1.17 ± 0.05 times faster than eatmydata deno run -A --cached-only demo.ts 5.19 ± 0.27 times faster than deno run -A --cached-only demo.ts ``` Notes: * Benchmark 1: unmodified Deno 1.43.6 * Benchmark 2: unmodified Deno 1.43.6 wrapped with `eatmydata` (which is a tool to neuter `fsync()` calls) * Benchmark 3: this PR applied on top of Deno 1.43.6 The script that got benchmarked: ```typescript // demo.ts import * as express from "npm:express@4.16.3"; import * as postgres from "https://deno.land/x/postgres/mod.ts"; let _dummy = [express, postgres]; // Force use of imports. console.log("hello world"); ```
2024-05-23feat(cli/test): `deno test --clean` (#23519)Asher Gomez
The result of the call is ignored as it throws even when the directory does not exist. Closes #23491
2024-05-23feat(ext/fetch): `Request.bytes()` and `Response.bytes()` (#23823)Asher Gomez
Closes #23790
2024-05-23feat: add lowercase `-v` version flag (#23750)David Sherret
Ref https://github.com/denoland/deno/issues/5289
2024-05-23feat(ext/fs): stabilize `Deno.FsFile.unlock[Sync]()` and ↵Asher Gomez
`Deno.FsFile.lock[Sync]()` (#23754) Related #22230 CC @dyedgreen
2024-05-23fix(runtime): use more null proto objects (#23921)Luca Casonato
This is a primordialization effort to improve resistance against users tampering with the global `Object` prototype. --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-05-22feat(ext/fs): stabilize `Deno.FsFile.syncData[Sync]()` and ↵Asher Gomez
`Deno.FsFile.sync[Sync]()` (#23733) Closes #22230
2024-05-22fix(lsp): process Fenced Code Block in JSDoc on `completion` correctly (#23822)Hajime-san
partially fixing https://github.com/denoland/deno/issues/23820 https://github.com/denoland/deno/assets/41257923/0adb5d4e-cfd5-4195-9045-19d1c0a07a43 BTW, it is out of scope on this PR that to process type of `@param` to be an code block due to it's a bit complicated.
2024-05-22feat(cli): Add slow test warning (#23874)Matt Mastracci
By default, uses a 60 second timeout, backing off 2x each time (can be overridden using the hidden `DENO_SLOW_TEST_TIMEOUT` which we implement only really for spec testing. ``` Deno.test(async function test() { await new Promise(r => setTimeout(r, 130_000)); }); ``` ``` $ target/debug/deno test /tmp/test_slow.ts Check file:///tmp/test_slow.ts running 1 test from ../../../../../../tmp/test_slow.ts test ...'test' is running very slowly (1m0s) 'test' is running very slowly (2m0s) ok (2m10s) ok | 1 passed | 0 failed (2m10s) ``` --------- Signed-off-by: Matt Mastracci <matthew@mastracci.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-05-22refactor(docs): use `@experimental` instead of `@tags unstable` (#23884)Leo Kettmeir
2024-05-22chore: forward v1.43.6 release commit to main (#23936)Bartek Iwańczuk
Bumped versions for 1.43.6 Co-authored-by: denobot <33910674+denobot@users.noreply.github.com> Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
2024-05-21fix(lsp): Fix display of JSDoc named examples (#23927)Nathan Whitaker
We were wrapping the display string in an unnecessary pair of triple backticks, breaking highlighting Before: ![Screenshot 2024-05-21 at 12 16 12 PM](https://github.com/denoland/deno/assets/17734409/1cf5a3ce-56dd-443d-9d1a-bd33625ff1f2) After: ![Screenshot 2024-05-21 at 12 16 36 PM](https://github.com/denoland/deno/assets/17734409/646c4c48-9b5a-4326-bb95-b1374627d969)
2024-05-21refactor(jupyter): use runtimelib for Jupyter structures and directory paths ↵Kyle Kelley
(#23826) This brings in [`runtimelib`](https://github.com/runtimed/runtimed) to use: ## Fully typed structs for Jupyter Messages ```rust let msg = connection.read().await?; self .send_iopub( runtimelib::Status::busy().as_child_of(msg), ) .await?; ``` ## Jupyter paths Jupyter paths are implemented in Rust, allowing the Deno kernel to be installed completely via Deno without a requirement on Python or Jupyter. Deno users will be able to install and use the kernel with just VS Code or other editors that support Jupyter. ```rust pub fn status() -> Result<(), AnyError> { let user_data_dir = user_data_dir()?; let kernel_spec_dir_path = user_data_dir.join("kernels").join("deno"); let kernel_spec_path = kernel_spec_dir_path.join("kernel.json"); if kernel_spec_path.exists() { log::info!("✅ Deno kernel already installed"); Ok(()) } else { log::warn!("ℹ️ Deno kernel is not yet installed, run `deno jupyter --install` to set it up"); Ok(()) } } ``` Closes https://github.com/denoland/deno/issues/21619
2024-05-21fix(lsp): apply import fix to missing declaration code action (#23924)Nayeem Rahman
2024-05-21chore: add test to ensure parsing only happens once on first load (#23837)David Sherret
2024-05-21fix(task): do not error if node_modules folder not exists (#23920)David Sherret
Revealed https://github.com/denoland/deno/issues/23919 Closes #23914
2024-05-21fix(cli): use CliNodeResolver::resolve() for managed node_modules (#23902)Nayeem Rahman
2024-05-21perf: resolver - skip cwd lookup if able (#23851)David Sherret
The cwd lookup was taking 2% of a flamegraph I was looking at.
2024-05-21fix(cli/coverage): invalid line id in html reporter (#23908)Simon Lecoq
2024-05-21chore: force import assertion support (#23855)Bartek Iwańczuk
https://github.com/denoland/deno/pull/23838 might accidentally disable import assertions support because of V8 12.6 unshipping it, but we want import assertions to be supported until Deno 2.
2024-05-20perf(cache): compile ts to js in parallel for `deno cache` (#23892)David Sherret
Closes https://github.com/denoland/deno/issues/23860
2024-05-19fix: add missing `URL.parse` types (#23893)Kenta Moriuchi
2024-05-18perf: analyze cjs exports and emit typescript in parallel (#23856)David Sherret
2024-05-17chore: forward v1.43.5 release commit to main (#23877)denobot
Co-authored-by: David Sherret <dsherret@gmail.com>
2024-05-17fix(npm): regression deserializing JSON for some npm packages (#23868)David Sherret
* https://github.com/denoland/deno_npm/pull/53 Closes https://github.com/denoland/deno/issues/23862
2024-05-17feat(serve): support `--port 0` to use an open port (#23846)Satya Rohith
Closes https://github.com/denoland/deno/issues/23845
2024-05-17chore: forward v1.43.4 commit to main (#23861)Bartek Iwańczuk
Co-authored-by: denobot <33910674+denobot@users.noreply.github.com> Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
2024-05-16fix(lsp): respect types dependencies for tsc roots (#23825)Nayeem Rahman
2024-05-16fix(node): seperate worker module cache (#23634)Divy Srivastava
Construct a new module graph container for workers instead of sharing it with the main worker. Fixes #17248 Fixes #23461 --------- Co-authored-by: David Sherret <dsherret@gmail.com>
2024-05-15perf(compile): Do not checksum eszip content (#23839)Arnau Orriols
Related: https://github.com/denoland/eszip/pull/181 eszip < v0.69.0 hashes all its contents to ensure data integrity. This feature is not necessary in Deno CLI as the binary integrity guarantee is deemed an external responsibility (ie it is to be assumed that, if necessary, the compiled binary will be checksumed externally prior to being executed). eszip >= v0.69.0 no longer performs this checksum by default. This reduces the cold-start time of the compiled binaries, proportionally to their size.
2024-05-16perf(jsr): download metadata files as soon as possible and in parallel (#23836)David Sherret
* https://github.com/denoland/deno_graph/pull/471 * https://github.com/denoland/deno_graph/pull/473
2024-05-15fix(doc): --lint - private ref diagnostic was displaying incorrect ↵David Sherret
information (#23834) * https://github.com/denoland/deno_doc/pull/576 Closes #23303
2024-05-15perf(lsp): Cache semantic tokens for open documents (#23799)Nathan Whitaker
VScode will typically send a `textDocument/semanticTokens/full` request followed by `textDocument/semanticTokens/range`, and occassionally request semantic tokens even when we know nothing has changed. Semantic tokens also get refreshed on each change. Computing semantic tokens is relatively heavy in TSC, so we should avoid it as much as possible. Caches the semantic tokens for open documents, to avoid making TSC do unnecessary work. Results in a noticeable improvement in local benchmarking before: ``` Starting Deno benchmark -> Start benchmarking lsp - Simple Startup/Shutdown (10 runs, mean: 383ms) - Big Document/Several Edits (5 runs, mean: 1079ms) - Find/Replace (10 runs, mean: 59ms) - Code Lens (10 runs, mean: 440ms) - deco-cx/apps Multiple Edits + Navigation (5 runs, mean: 9921ms) <- End benchmarking lsp ``` after: ``` Starting Deno benchmark -> Start benchmarking lsp - Simple Startup/Shutdown (10 runs, mean: 395ms) - Big Document/Several Edits (5 runs, mean: 1024ms) - Find/Replace (10 runs, mean: 56ms) - Code Lens (10 runs, mean: 438ms) - deco-cx/apps Multiple Edits + Navigation (5 runs, mean: 8927ms) <- End benchmarking lsp ```
2024-05-14fix(emit): regression - keep comments in emit (#23815)David Sherret
Closes https://github.com/denoland/deno/discussions/23814
2024-05-14fix(lsp): show reference code lens on methods (#23804)Nayeem Rahman
2024-05-14fix(runtime): output to stderr with colors if a tty and stdout is piped (#23813)David Sherret
This also fixes a bug where Deno would output to stderr with colours when piped and stdout was not piped.
2024-05-14fix(npm): make tarball extraction more reliable (#23759)David Sherret
1. Extracts to a directory beside the destination. 2. Renames to the destination with retries.
2024-05-14fix(publish): always include config file when publishing (#23797)David Sherret
Closes https://github.com/denoland/deno/issues/23796
2024-05-14fix(publish): error for missing version constraints on dry-publish instead ↵David Sherret
of just publish (#23798) Closes https://github.com/denoland/deno/issues/22835
2024-05-14fix: Add missing `"junction"` type for `SymlinkOptions.types` (#23756)futsuuu
Junction symlink support is added in #22762, but `SymlinkOptions` and its documents are not updated.
2024-05-14fix(doc/publish): support expando properties (#23795)David Sherret
* https://github.com/denoland/deno_graph/pull/428 * https://github.com/denoland/deno_doc/pull/575 Closes https://github.com/denoland/deno/issues/23276
2024-05-13chore(task): various small refactorings (#23793)David Sherret
2024-05-13chore: cleanup unused dependencies (#23787)Leo Kettmeir
2024-05-13fix(cli): panic with `deno coverage` (#23353)Evan
This PR directly addresses the issue raised in #23282 where Deno panics if `deno coverage` is called with `--include` regex that returns no matches. I've opted not to change the return value of `collect_summary` for simplicity and return an empty `HashMap` instead
2024-05-13refactor(lsp): reuse CliGraphResolverOptions::sloppy_imports_resolver (#23764)Nayeem Rahman
2024-05-12fix(npm): handle null fields in npm registry JSON (#23785)David Sherret
* https://github.com/denoland/deno_npm/pull/52 Closes https://github.com/denoland/deno/issues/23776
2024-05-10chore: forward v1.43.3 release commit to main (#23771)denobot
Co-authored-by: David Sherret <dsherret@gmail.com>
2024-05-09refactor(lsp): Have JS drive TSC event loop in LSP (#23565)Nathan Whitaker
2024-05-09refactor(lsp): unify caching into LspCache (#23746)Nayeem Rahman