Commit graph

14322 commits

Author SHA1 Message Date
Yoshiya Hinosawa
e94066ff32
chore: add metadata to node compat test report (#28719) 2025-04-03 14:04:31 +09:00
David Sherret
3b52f1afd8
chore: fix flaky tests checking for ms (#28718) 2025-04-03 09:49:05 +05:30
David Sherret
8dd7c3dfb6
fix(npm): use Deno instead of Node in more cases for lifecycle scripts (#28715) 2025-04-03 02:45:58 +00:00
David Sherret
800a687951
fix(task): filter empty elements in xargs (#28714) 2025-04-02 16:38:59 -04:00
Divy Srivastava
4deeb2acf6
chore: run pre-release step for bench CI job (#28709) 2025-04-02 11:12:51 -04:00
Nayeem Rahman
a0d6411088
fix(lsp): format vscode-userdata schemed documents (#28706) 2025-04-02 11:55:08 +01:00
Divy Srivastava
73798b13bb
chore: fix pre-release CI for macOS and Windows (#28707)
- Fix `strip` after `codesign` on macOS pre-release step.
- Fix cwd assumption in windows pre-release step.
2025-04-02 06:11:16 +00:00
Divy Srivastava
e10101347c
perf: remote symbolicate stack traces (#28470)
Fixes #28136 
Closes #28415

Publish symcache to GCS and generate trace URL during panic.

```
============================================================
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: windows x86_64
Version: 2.2.5
Args: ["C:\Users\divy\.deno\bin\deno.exe"]

View stack trace at:
https://panic.deno.com/v2.2.5/aarch64-apple-darwin/gszD49_B4utrqB4vrrqBozirqB49prqBwjkwqBw_jBg31Cw5tCg5sDoo3pqB41sDgkkB
```

## Design

<img
src=https://github.com/user-attachments/assets/396d53cd-1fe7-4d88-9ecd-ea7b74a9a1ed
height=500>

Example:
`https://panic.deno.com/v2.2.3/aarch64-apple-darwin/g4couawkboxb4tbg9oHwqbw6a`

Stack walking and symbolicate code is at
https://github.com/denoland/panic/
2025-04-02 08:42:28 +05:30
Yoshiya Hinosawa
f2d73abdd7
fix(ext/node): better dns.lookup compatibility (#27936) 2025-04-02 11:38:07 +09:00
David Sherret
4131f38e90
fix(npm): further reduce duplicates with optional peers (#28705)
* https://github.com/denoland/deno_npm/pull/93

Closes
https://github.com/denoland/deno/issues/28023#issuecomment-2769944224
2025-04-01 20:00:04 -04:00
Nathan Whitaker
5e20982a30
feat(add/install): --npm and --jsr flags for deno add/install (#28666)
Flags to set the default registry for "bare" package names (no `npm:` or
`jsr:` prefix)
```
deno add --npm chalk react @types/react jsr:@std/fs
deno add --jsr @std/fs @std/async @std/fmt npm:chalk
```
2025-04-01 19:12:48 +00:00
chirsz
1e62ba12bb
fix(ext/webgpu): release current texture of surface after present (#28691)
Fixes #28207.
2025-04-01 10:07:28 -04:00
Divy Srivastava
5bc4266101
fix(ext/node): sqlite handle empty blob being NULL (#28674)
Fixes https://github.com/denoland/deno/issues/28672
2025-04-01 13:50:26 +00:00
Jake Champion
0f40ee7ff4
fix(ext/node): support the optional previousValue parameter for process.cpuUsage() (#28550) 2025-04-01 20:48:09 +09:00
Asher Gomez
b880087668
docs(README): replace deno.land/x link with JSR link (#28694)
Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
2025-04-01 06:06:58 +02:00
roman
d6d7954429
docs(readme): add bluesky badge (#28692) 2025-03-31 19:48:53 -07:00
Nayeem Rahman
d91658b45e
refactor(lsp): separate document and module storage (#28469) 2025-03-31 22:25:27 +01:00
Kenta Moriuchi
76a18a2220
fix(types): add Error.isError type (#28679) 2025-03-31 17:22:31 -04:00
Benjamin Swerdlow
cf4afb9c9c
refactor(ext/node): export GlobalsStorage (#28683) 2025-03-31 14:00:05 -04:00
David Sherret
aa1f43702d
fix(npm): reduce duplicate peers by preferring existing nv if nv anywhere in ancestor peers (#28663)
* https://github.com/denoland/deno_npm/pull/91/files

Closes https://github.com/denoland/deno/issues/26145
2025-03-28 23:42:37 +00:00
Asher Gomez
3aaa86b5c8
fix(ext/node): use primordials in ext/node/polyfills/_fs/_fs_lstat.ts (#28644)
Towards #24236
2025-03-28 10:52:33 -07:00
David Sherret
1e65d21071
fix: show referrer for Wasm module dependency errors (#28653) 2025-03-28 09:13:39 -04:00
Kenta Moriuchi
f2299353a0
fix(webgpu): move isFallbackAdapter from GPUAdapter to GPUAdapterInfo (#28650)
fix #28618

I also fixed `Deno.privateCustomInspect`, which was defined as static
methods of the classes and was not working properly.
2025-03-28 03:08:57 -07:00
Asher Gomez
9a13bafa0e
fix(ext/node): use primordials in ext/node/polyfills/_fs/_fs_realpath.ts (#28652)
Towards #24236
2025-03-28 09:48:19 +01:00
Asher Gomez
512cf558d4
fix(ext/node): use primordials in ext/node/polyfills/_fs/_fs_readv.ts (#28645)
Towards #24236
2025-03-28 09:47:36 +01:00
denobot
a1724f5d5a
chore: forward v2.2.6 release commit to main (#28657)
This is the release commit being forwarded back to main for 2.2.6

Co-authored-by: littledivy <littledivy@users.noreply.github.com>
2025-03-28 13:32:27 +05:30
Divy Srivastava
66e03a39a3
fix(ext/websocket): cancel in-flight handshake on close() (#28598)
Fixes https://github.com/denoland/deno/issues/25126

---------

Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
2025-03-28 03:43:32 +00:00
Yoshiya Hinosawa
f42b39d2cf
ci: set NODE_SKIP_FLAG_CHECK=1 in node_compat_test workflow (#28642) 2025-03-28 12:22:41 +09:00
David Sherret
e2f66d4059
fix(npm): improve optional peer dep handling (#28651) 2025-03-27 22:53:41 +00:00
Yoshiya Hinosawa
2b4de21ea0
ci: reduce the concurrency number of parallel runs to navigator.hardwareConcurrency (#28639) 2025-03-27 13:47:47 +09:00
Yoshiya Hinosawa
9a28f0eef8
ci: fix node_compat_test workflow (#28638) 2025-03-27 11:26:57 +09:00
Yoshiya Hinosawa
6c2f7835c0
fix(ext/node): emit 'close' event on ServerResponse object when client aborted the request (#28601) 2025-03-27 10:45:04 +09:00
Yoshiya Hinosawa
460e511e59
test(ext/node): run all node tests (unchanged) daily, upload reports to dl.deno.land (#28629) 2025-03-27 09:53:38 +09:00
Nathan Whitaker
b1c351de58
perf(install): keep parsed npm package info in memory cache (#28636)
Fixes #28517.

The npm package info gets requested a bunch of times by deno_npm. Before
this PR, we were loading it from the FS and parsing it each and every
time. With a lot of dependencies (and large `registry.json` files), this
can lead to massive blowups in install times.

From the repro in #28517

before this PR:

```
        Command being timed: "deno i"
        User time (seconds): 538.54
        System time (seconds): 56.49
        Percent of CPU this job got: 198%
        Elapsed (wall clock) time (h:mm:ss or m:ss): 4:59.45
        Maximum resident set size (kbytes): 378976
```

this PR:
```
        Command being timed: "deno-this-pr i"
        User time (seconds): 1.29
        System time (seconds): 1.56
        Percent of CPU this job got: 68%
        Elapsed (wall clock) time (h:mm:ss or m:ss): 0:04.16
        Maximum resident set size (kbytes): 500864
```

So roughly an improvement from 339s to 4s. You can see that the max RSS
does increase a decent amount, which is the main downside. However, this
in memory cache is cleared once we're done caching npm packages, and IMO
the performance tradeoff is well worth it.

This also has a very noticable, though less drastic, effect on fresh
installs (no deno.lock) for smaller projects. Here's a clean nextJS
template project:

```
❯ hyperfine --warmup 5 --prepare "rm -rf node_modules deno.lock" "deno i" "deno-this-pr i"
Benchmark 1: deno
  Time (mean ± σ):     765.0 ms ±  10.1 ms    [User: 622.3 ms, System: 216.4 ms]
  Range (min … max):   749.0 ms … 783.6 ms    10 runs

Benchmark 2: deno-this-pr
  Time (mean ± σ):     357.2 ms ±   9.4 ms    [User: 193.2 ms, System: 198.2 ms]
  Range (min … max):   346.4 ms … 374.1 ms    10 runs

Summary
  deno-this-pr ran
    2.14 ± 0.06 times faster than deno
```
2025-03-26 22:23:59 +00:00
Nathan Whitaker
ec4391f412
chore: downgrade warning to debug log on clonefile failure (#28637)
Ref https://github.com/denoland/deno/issues/26928.

This was originally a warning so potential bugs would be visible. Now
that the code has been working for a while without issues, and since the
warning can be triggered in a valid case (as in the issue above, where
the warnings also hid the real diagnostic), let's downgrade this from a
warning to a debug log.
2025-03-26 22:01:55 +00:00
Ryan Dahl
7aaec6a5af
chore: upgrade some dependencies (#28627) 2025-03-26 09:49:51 -07:00
Nathan Whitaker
863ab45436
fix(npm): set up bin entries for package even if it's already downloaded (#28626)
Fixes #28617
2025-03-25 22:32:15 +00:00
David Sherret
31f6c05c9c
feat(unstable/run): ability to lazily load statically analyzable dynamic imports (#28593)
This allows lazily loading statically analyzable dynamic imports when
not type checking.
2025-03-25 11:38:45 -04:00
David Sherret
c239d37d20
fix(npm): resolve non-version matching peer deps and warn instead (#28616)
This improves peer dependency resolution to be more relaxed and resolve
non-version matching ancestors similar to pnpm rather than introducing
duplicate dependencies. Deno will warn when this occurs. In the future,
we should look into introducing an option to have Deno error in this
scenario.
2025-03-25 11:10:13 -04:00
Divy Srivastava
52d528d21d
fix(ext/node): mkdir() parse file mode (#28609)
Fixes https://github.com/denoland/deno/issues/28604
2025-03-25 09:33:41 +05:30
Yoshiya Hinosawa
d07b7ea6f6
fix(ext/node): propagate 'close' event of IncomingMessage to Socket (#28582) 2025-03-24 10:56:34 +09:00
Gene Parmesan Thomas
5b5e93ff42
fix(ext/crypto): support cross-curve ECDSA sign and verify (#28574)
Fixes #20198

The Web Crypto implementation has been artificially limiting `ECDSA` to
only the “recommended” curve/hash pairs (`P‑256/SHA‑256` and
`P‑384/SHA‑384`). The underlying `ring` APIs enforced those pairs, so
any attempt to verify signatures produced with different digests (e.g.
`P‑384` with `SHA‑256`) failed with a “Not implemented” error.

This PR rewires the ECDSA sign/verify path to use RustCrypto’s `ecdsa`
crate instead of `ring`, computes digests separately, and uses the
prehash signing/verifying API so that any `sha1`, `sha256`, `sha384` or
`sha512` can be used with either curve. The JS `SubtleCrypto` bindings
were updated to drop the hard coded checks, and a new unit test
exercises `P‑384 + SHA‑256` to ensure non‑matching combos now round
trip.

---------

Signed-off-by: Gene Parmesan Thomas <201852096+gopoto@users.noreply.github.com>
Signed-off-by: gopoto <201852096+gopoto@users.noreply.github.com>
Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2025-03-22 17:17:44 +00:00
Divy Srivastava
48ccb67131
chore(ext/http): add "legacy_abort" runtime flag (#28371)
Deno.serve `Request` abort signals are aborted by default even when it
is finished successfully. This PR gates this behavior behind the
"legacy_abort" which is the default right now.

Turning the `no_legacy_abort` runtime option on is a **breaking change**
and will only abort request signals when there is a failure, thereby
cannot be used to determine if the request finished. This aligns with
`fetch` API.

Ref https://github.com/denoland/deno/issues/27005
2025-03-22 08:13:57 +05:30
c00kie17
208992ad53
fix(ext/node): sqlite error details (#28431)
Improves SQLite error reporting by including `err_code`, `err_str`,
matching Node.js behavior.

Fixes #28289
2025-03-22 07:52:22 +05:30
David Sherret
f7993280c9
fix(npm): reduce occurrences of duplicate packages due to peer dep resolution (#28586) 2025-03-21 21:12:28 +00:00
denobot
43f6137d92
chore: forward v2.2.5 release commit to main (#28579)
NOTE: Commit 27363d389 was incorrectly landed in main before the release
completed and is not included in v2.2.5. The official v2.2.5 release was made
from the v2.2 branch.
2025-03-21 06:25:03 -07:00
snek
27363d389d
refactor: internal logging utility (#28567)
`import.meta.log` enables basic log filtering through
`env_logger`/`DENO_LOG`. Log levels are supported, and filenames can
also be used. for example: `DENO_LOG=ext:deno_http::00_serve.ts=warn`
2025-03-21 12:17:50 +01:00
David Sherret
94c9681385
feat(unstable): support using a local copy of npm packages (#28512)
This adds support for using a local copy of an npm package.

```js
// deno.json
{
  "patch": [
    "../path/to/local_npm_package"
  ],
  // required until Deno 2.3, but it will still be considered unstable
  "unstable": ["npm-patch"]
}
```

1. Requires using a node_modules folder.
2. When using `"nodeModulesDir": "auto"`, it recreates the folder in the
node_modules directory on each run which will slightly increase startup
time.
3. When using the default with a package.json (`"nodeModulesDir":
"manual"`), updating the package requires running `deno install`. This
is to get the package into the node_modules directory of the current
workspace. This is necessary instead of linking because packages can
have multiple "copy packages" due to peer dep resolution.

Caveat: Specifying a local copy of an npm package or making changes to
its dependencies will purge npm packages from the lockfile. This might
cause npm resolution to resolve differently and it may end up not using
the local copy of the npm package. It's very difficult to only
invalidate resolution midway through the graph and then only rebuild
that part of the resolution, so this is just a first pass that can be
improved in the future. In practice, this probably won't be an issue for
most people.

Another limitation is this also requires the npm package name to exist
in the registry at the moment.
2025-03-21 03:09:57 +00:00
Adakite
7afdff6f6c
fix(ext/os): explicitly enable sysinfoapi feature on winapi dependency (#28568)
This pr explicitly enables the `sysinfoapi` feature flag on `winapi` in
`deno_os`, so that `deno_os` and other deno crates that rely on it can
be built independently outside of the workspace on Windows.
2025-03-21 03:04:44 +00:00
dependabot[bot]
24d20d6ec4
chore(deps): bump ring from 0.17.8 to 0.17.13 (#28423) 2025-03-20 19:21:34 -07:00