Commit graph

13433 commits

Author SHA1 Message Date
denobot
0c816f302b Cherry-pick version bump commit with conflicts 2025-04-11 19:23:21 +00:00
snek
e73ed03373
fix: vsock nits (#28851) 2025-04-11 12:11:03 -07:00
David Sherret
5b25eeda57
fix(task): support backticks and basic tilde expansion (#28832)
* https://github.com/denoland/deno_task_shell/pull/147
* https://github.com/denoland/deno_task_shell/pull/146

Closes https://github.com/denoland/deno/issues/26676
Closes https://github.com/denoland/deno/issues/28807
2025-04-11 15:48:14 +00:00
Divy Srivastava
d74a6943a5
fix(ext/node): verbose zlib error messages (#28831) 2025-04-11 17:17:32 +05:30
snek
9da231dc7a
feat: support linux vsock (#28725)
impl support for vsock
https://man7.org/linux/man-pages/man7/vsock.7.html
2025-04-11 07:35:05 +02:00
Nathan Whitaker
7218113d24
fix(lockfile): handling of peer deps when migrating to lockfile v5 (#28844) 2025-04-10 22:29:44 +00:00
Nathan Whitaker
4dbe803e2b
fix(lockfile): omit tarball url from lockfile if it's the default (#28842)
This is where deno_lockfile gets the info for the transform from 4->5.
So while we were doing this optimization on new v5 lockfiles, we weren't
doing it correctly for ones migrated from earlier versions.

Testing this is kinda hard because our tests don't use the default
registry, hmm
2025-04-10 14:45:46 -07:00
Nayeem Rahman
95eb216801
fix(lsp): exclude unmapped npm cache paths from auto-imports (#28841) 2025-04-10 19:13:34 +00:00
Kenta Moriuchi
a84c699101
refactor: sorted out Cargo.toml (#28678) 2025-04-10 11:36:55 -07:00
Nathan Whitaker
ce5b9da11b
fix(install): handle when bin entry info isn't present in package.json but is in registry (#28822)
Apparently things like the `bin` field can appear in the version info
from the registry, but not the package's `package.json`. I'm still not
sure how you actually achieve this, but it's the case for
`esbuild-wasm`. This fixes the following panic:

```
❯ deno i --node-modules-dir npm:esbuild-wasm
Add npm:esbuild-wasm@0.25.2
Initialize ⣯ [00:00]
 - esbuild-wasm@0.25.2



============================================================
Deno has panicked. This is a bug in Deno. Please report this
at https://github.com/denoland/deno/issues/new.
If you can reliably reproduce this panic, include the
reproduction steps and re-run with the RUST_BACKTRACE=1 env
var set and include the backtrace in your report.

Platform: macos aarch64
Version: 2.2.8+58c6c0b
Args: ["deno", "i", "--node-modules-dir", "npm:esbuild-wasm"]

View stack trace at:
https://panic.deno.com/v2.2.8+58c6c0bc9c1b4ee08645be936ff9268f17028f0f/aarch64-apple-darwin/g4h6Jo393pB4k4kqBo-3kqBg6klqBogtyLg13yLw_t0Lw549Hgj8-Hgw__H428-F4yv_HgjkpKww7gIon4gIw54rKwi5MorzMw5y7G42g7Iw---I40s-I4vu4Jw2rEw8z7Dwnr6J4tp7Bo_vvK

thread 'main' panicked at cli/npm/installer/common/bin_entries.rs:108:30:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```
2025-04-10 09:36:26 -07:00
Marvin Hagemeister
ac5c6018a8
fix(unstable): add missing decorators nodes in lint ast (#28834)
Support for decorators in the lint plugin AST was a bit half baked. This
PR goes through all the places where decorators can be set in TS and
supports these.

Fixes https://github.com/denoland/deno/issues/28830
2025-04-10 17:49:05 +02:00
Divy Srivastava
cedf5c4f6a
fix(ext/node): implement Buffer.copyBytesFrom (#28829)
Enables the full `parallel/test-buffer-from.js` test
2025-04-10 12:05:49 +00:00
Divy Srivastava
0d72316fbf
fix(ext/node): implement finished() for web streams (#28600)
Fixes https://github.com/denoland/deno/issues/28590
2025-04-10 17:23:50 +05:30
Divy Srivastava
1e50c7981b
refactor(ext/node): rewrite HandleWrap in Rust (#28765)
Ports `HandleWrap` and `AsyncWrap` to Rust.
2025-04-10 17:20:25 +05:30
Divy Srivastava
b26c30d938
fix(ext/node): return Buffer from crypto cipher APIs (#28826)
Fixes https://github.com/denoland/deno/issues/28633
2025-04-10 08:01:30 +00:00
Arsh
447b5038c0
fix(ext/node): alias shake-128 and shake-256 hash algorithms (#28451)
Fixes #28442

---------

Signed-off-by: Arsh <69170106+lilnasy@users.noreply.github.com>
Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2025-04-10 07:58:44 +00:00
Divy Srivastava
561097dd63
fix(ext/node): implement process.loadEnvFile (#28824)
Fixes https://github.com/denoland/deno/issues/28017
2025-04-10 07:43:29 +00:00
Marvin Hagemeister
25e3a17bd9
fix(unstable): lint .parent property not traversing over groups (#28803)
In our JS lint plugin API each node has a `.parent` property to access
its parent. But I forgot to skip group nodes, which lead to an invalid
node being returned.

Fixes: https://github.com/denoland/deno/issues/28799
2025-04-10 09:17:42 +02:00
Yoshiya Hinosawa
8e42ea015d
chore: simplify node compat chat message (#28825) 2025-04-10 16:15:01 +09:00
Hajime-san
1513550d66
fix(ext/canvas): handle integer overflow in createImageBitmap (#28764)
fixes https://github.com/denoland/deno/issues/28732
2025-04-10 11:16:14 +05:30
Divy Srivastava
58c6c0bc9c
fix: dont strip n-api symbols in denort on mac (#28800)
Fixes https://github.com/denoland/deno/issues/24614
2025-04-09 23:14:29 +05:30
Divy Srivastava
c394f1c432
fix(build): upgrade libffi to 4.0.0 (#28816) 2025-04-09 19:20:31 +05:30
Divy Srivastava
c8a0f6b1cd
fix: use full SHA for canary panic URLs (#28819) 2025-04-09 04:51:59 -07:00
Yoshiya Hinosawa
cb00561e97
fix(ext/node): support input option in spawnSync (#28792) 2025-04-09 13:42:12 +09:00
0hmX
9bc9faff49
fix(ext/node): add support for --no- prefix (allowNegative option) in parseArgs() (#28811) 2025-04-09 12:24:02 +09:00
Bartek Iwańczuk
c8291e6926
feat: enable explicit resource management for JavaScript (#28119)
This commit enabled [explicit resource management]
(https://github.com/tc39/proposal-explicit-resource-management)
proposal for JavaScript code.

This is done by upgrading `deno_ast` to a version that no longer
transpiles TS files with `using` keyword, and instead enables
a V8 flag that provides native support.

Closes https://github.com/denoland/deno/issues/20821

---------

Co-authored-by: Luca Casonato <hello@lcas.dev>
Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2025-04-08 15:12:10 -07:00
Nathan Whitaker
96571854e0
chore: box some more large futures (#28806)
These both were >20KB. Also added `clippy::large_futures` to `lint.js`
so we catch this
2025-04-08 20:54:48 +00:00
Marvin Hagemeister
ee4c4a0a63
fix(unstable): add parent types to lint ast nodes (#28802)
Noticed that the `.parent` type was missing for AST nodes for our JS
lint API. Whenever possible I've only specified the limited
possibilities of parent types, but when it's too complex I defaulted to
just `Node`.
2025-04-08 16:51:09 +00:00
Divy Srivastava
a69b5e16b1
fix(compile): multi icon ordering on windows (#28771)
Fixes https://github.com/denoland/deno/issues/26400. Correctly handle
multi-icon icos in `deno compile --icon`.

Ref
bf318ea9c8

## Explanation

Icons in PE are very sensitive to resource table ordering. Here's what
works:

<img width=320
src=https://github.com/user-attachments/assets/8f3e5a18-5f00-42d6-a366-16b6194c711c></img>

We can't use `editpe`'s builtin `set_icon` because it lays out `Icon`
and `Icon Group` together before/after the `RCData`. Instead, we need a
custom implementation that places RCData between the icon entries.

This means we defer `Icon Group` to always happen during
`PortableExecutable::build`. After the fix:

<img width=440
src=https://github.com/user-attachments/assets/73a9b347-64c2-41e1-a314-918231ba7276></img>
2025-04-08 21:59:10 +05:30
Yoshiya Hinosawa
c6ecd179ad
chore: post node test results to slack (#28795) 2025-04-08 23:14:38 +09:00
Yoshiya Hinosawa
41005f8cd4
chore: fix node_compat_test workflow summary job (#28793) 2025-04-08 23:14:02 +09:00
Nathan Whitaker
6d33141d8d
fix(node): add reset method to event loop delay histogram (#28788)
Fixes https://github.com/denoland/deno/issues/28767

Don't love the `RefCell`, but don't really see a (safe) way around it.
2025-04-07 22:05:53 -07:00
Yoshiya Hinosawa
9bc3b07819
chore: create monthly summary of node test runs (#28778) 2025-04-08 12:12:27 +09:00
Nathan Whitaker
780b741555
perf(npm): load npm resolution snapshot directly from lockfile (#28647)
Fixes #27264. Fixes https://github.com/denoland/deno/issues/28161.

Currently the new lockfile version is gated behind an unstable flag
(`--unstable-lockfile-v5`) until the next minor release, where it will
become the default.

The main motivation here is that it improves startup performance when
using the global cache or `--node-modules-dir=auto`.

In a create-next-app project, running an empty file:
```
❯ hyperfine --warmup 25 -N --setup "rm -f deno.lock" "deno run --node-modules-dir=auto -A empty.js" "deno-this-pr run --node-modules-dir=auto -A empty.js" "deno-this-pr run --node-modules-dir=auto --unstable-lockfile-v5 empty.js" "deno run --node-modules-dir=manual -A empty.js" "deno-this-pr run --node-modules-dir=manual -A empty.js"
Benchmark 1: deno run --node-modules-dir=auto -A empty.js
  Time (mean ± σ):     247.6 ms ±   1.7 ms    [User: 228.7 ms, System: 19.0 ms]
  Range (min … max):   245.5 ms … 251.5 ms    12 runs

Benchmark 2: deno-this-pr run --node-modules-dir=auto -A empty.js
  Time (mean ± σ):     169.8 ms ±   1.0 ms    [User: 152.9 ms, System: 17.9 ms]
  Range (min … max):   168.9 ms … 172.5 ms    17 runs

Benchmark 3: deno-this-pr run --node-modules-dir=auto --unstable-lockfile-v5 empty.js
  Time (mean ± σ):      16.2 ms ±   0.7 ms    [User: 12.3 ms, System: 5.7 ms]
  Range (min … max):    15.2 ms …  19.2 ms    185 runs

Benchmark 4: deno run --node-modules-dir=manual -A empty.js
  Time (mean ± σ):      16.2 ms ±   0.8 ms    [User: 11.6 ms, System: 5.5 ms]
  Range (min … max):    14.9 ms …  19.7 ms    187 runs

Benchmark 5: deno-this-pr run --node-modules-dir=manual -A empty.js
  Time (mean ± σ):      16.0 ms ±   0.9 ms    [User: 12.0 ms, System: 5.5 ms]
  Range (min … max):    14.8 ms …  22.3 ms    190 runs

  Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options.

Summary
  deno-this-pr run --node-modules-dir=manual -A empty.js ran
    1.01 ± 0.08 times faster than deno run --node-modules-dir=manual -A empty.js
    1.01 ± 0.07 times faster than deno-this-pr run --node-modules-dir=auto --unstable-lockfile-v5 empty.js
   10.64 ± 0.60 times faster than deno-this-pr run --node-modules-dir=auto -A empty.js
   15.51 ± 0.88 times faster than deno run --node-modules-dir=auto -A empty.js
```

When using the new lockfile version, this leads to a 15.5x faster
startup time compared to the current deno version.

Install times benefit as well, though to a lesser degree.

`deno install` on a create-next-app project, with everything cached
(just setting up node_modules from scratch):

```
❯ hyperfine --warmup 5 -N --prepare "rm -rf node_modules" --setup "rm -rf deno.lock" "deno i" "deno-this-pr i" "deno-this-pr i --unstable-lockfile-v5"
Benchmark 1: deno i
  Time (mean ± σ):     464.4 ms ±   8.8 ms    [User: 227.7 ms, System: 217.3 ms]
  Range (min … max):   452.6 ms … 478.3 ms    10 runs

Benchmark 2: deno-this-pr i
  Time (mean ± σ):     368.8 ms ±  22.0 ms    [User: 150.8 ms, System: 198.1 ms]
  Range (min … max):   344.8 ms … 397.6 ms    10 runs

Benchmark 3: deno-this-pr i --unstable-lockfile-v5
  Time (mean ± σ):     211.9 ms ±  17.1 ms    [User: 7.1 ms, System: 177.2 ms]
  Range (min … max):   191.3 ms … 233.4 ms    10 runs

Summary
  deno-this-pr i --unstable-lockfile-v5 ran
    1.74 ± 0.17 times faster than deno-this-pr i
    2.19 ± 0.18 times faster than deno i
```

With lockfile v5, a 2.19x faster install time compared to the current
deno.
2025-04-08 02:06:17 +00:00
Asher Gomez
52d9fc1499
fix(ext/node): use primordials in ext/node/polyfills/path/separator.ts (#28669) 2025-04-08 10:42:58 +09:00
David Sherret
47c05ff70d
fix(install): regression where Deno not used when postinstall script ran script without file extension (#28786)
`node scripts/postinstall` was not running with Deno anymore and it
previously was.

Closes https://github.com/denoland/deno/issues/28780
2025-04-08 00:59:48 +00:00
David Sherret
874f4fc5ae
chore: skip explicit_start_and_end_low_precision test on ci (#28789)
It's gotten too flaky.
2025-04-07 17:55:18 -07:00
David Sherret
63901aac83
chore: skip updating release-latest.txt when current version not greater than latest version (#28787)
Signed-off-by: David Sherret <dsherret@users.noreply.github.com>
2025-04-08 00:06:59 +00:00
David Sherret
96b06c64a5
fix(compile): do not panic including node_modules directory (#28782)
Closes https://github.com/denoland/deno/issues/28773
2025-04-07 16:43:34 -07:00
David Sherret
f621182577
chore: make statSync unit test less flaky (#28785) 2025-04-07 22:55:05 +00:00
Sebastien Guillemot
e2341c7949
fix(ext/node): add createReadStream & createWriteStream methods to the FileHandle class (#28700)
Co-authored-by: Nikolay Karadzhov <nkaradzhov89@gmail.com>
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2025-04-07 17:13:32 +09:00
Asher Gomez
ec8e4af85b
fix(ext/node): use primordials in ext/node/polyfills/path/_win32.ts (#28668) 2025-04-07 16:54:54 +09:00
Asher Gomez
0934841fcc
fix(ext/node): use primordials in ext/node/polyfills/path/_posix.ts (#28665) 2025-04-07 16:49:52 +09:00
Divy Srivastava
6f406c1cd6
fix(ci): missing release symcache (#28774)
Probably caused by copy-pasting from the canary upload job.
2025-04-06 15:42:42 +00:00
denobot
1086a75cc9
chore: forward v2.2.8 release commit to main (#28762)
Co-authored-by: dsherret <dsherret@users.noreply.github.com>
2025-04-05 03:09:25 +00:00
David Sherret
a19230159e
ci: improve verify_pr_title script (#28759)
Ref https://github.com/denoland/deno/pull/28697
2025-04-05 08:24:29 +05:30
Nathan Whitaker
457bfc9066
fix: only strip local and debug symbols from macOS binary (#28758)
Fixes #28757.

We need to retain the napi symbols in the binary. `strip` with no flags
on macos strips all symbols out of the binary (including global
symbols).

Only strip out the local and debug symbols from the binary, retaining
the global symbols (which include the napi ones)
2025-04-05 00:29:59 +00:00
David Sherret
9d841987ef
refactor(lsp): internally expose and use LspScopedResolver (#28755)
Reduces some repeat hashmap lookups by exposing the `LspScopedResolver`.
2025-04-04 21:48:04 +00:00
Nayeem Rahman
37b760e3c6
fix(lsp): filter scheme in semantic tokens registration options (#28756) 2025-04-04 21:27:20 +00:00
Nayeem Rahman
757ef462f7
fix(lint): resolve plugin paths from proper config specifier (#28752) 2025-04-04 19:30:27 +00:00