Commit graph

164 commits

Author SHA1 Message Date
snek
bc1ced8260
refactor: allow lazy main module (#28929)
implement lazy(?) mode. an unconfigured jsruntime is created if
DENO_UNSTABLE_CONTROL_SOCK is present, and later passed into deno_runtime to be
configured and used.
2025-04-30 19:59:20 +00:00
Bartek Iwańczuk
8773b5f5b0
v2.3.1 (#29107)
Fixes wrong version printed with `deno --version`.
2025-04-30 10:48:46 +00:00
denobot
61574bb9c9
2.3.0 (#29102)
Bumped versions for 2.3.0

---------

Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2025-04-30 09:49:31 +02:00
Laurence Rowe
bc346b1825
feat(cli): support --single-threaded v8 flag (#29066) 2025-04-29 18:40:27 -04:00
snek
25b9abcdf8
feat: use new feature checker (#29091)
we need to be able to set the feature checker after creating the runtime
to support lazy init
2025-04-29 17:18:14 +02:00
David Sherret
2eeccf1045
fix(compile): use a memory mapped file for fallback (#29039) 2025-04-24 17:19:52 +00:00
Divy Srivastava
e1329df448
v2.3.0-rc.3 (#29032) 2025-04-24 09:16:26 +05:30
David Sherret
3d16eb8ff3
fix(compile): temporarily fallback to reading resource data from file on windows (#29024)
Temp hacky fix for https://github.com/denoland/deno/issues/28982
2025-04-23 22:08:15 -04:00
Divy Srivastava
4f5ac0acfc
v2.3.0-rc.2 (#29006) 2025-04-23 11:22:59 +05:30
David Sherret
edba5ff3c8
fix(compile): read resource name in executable as uppercase on Windows (#29005)
* https://github.com/denoland/sui/pull/40 (this is the fix)
* https://github.com/denoland/sui/pull/39
* https://github.com/denoland/sui/pull/38

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

---------

Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2025-04-23 04:59:59 +00:00
Bartek Iwańczuk
ff6fe8254c
v2.3.0-rc.1 (#28998) 2025-04-22 16:45:41 +02:00
David Sherret
104514b06d
fix(compile): error when cannot extract binary section (#28986)
We were silently failing on failure here.
2025-04-21 15:21:37 +00:00
denobot
9591c11633
chore: forward v2.2.11 release commit to main (#28958)
This is the release commit being forwarded back to main for 2.2.11

---------

Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2025-04-18 17:21:06 +02:00
David Sherret
16d305449d
feat(compile): support for ffi and node native addons (#28934)
This extracts out the shared libraries and `.node` native modules to a
temp file and opens them from there. **This means that this
implementation will not work in every scenario.** For example, a library
could require other files that only exist in the in-memory file system.
To solve that, we'll introduce
https://github.com/denoland/deno/issues/28918 later or adapt this
solution to solve more issues.

Additionally, this will not work when run on readonly file systems.
2025-04-17 16:01:12 -04:00
David Sherret
ef431b2336
feat(runtime): add Deno.build.standalone for telling if running in self-contained executable (#28750) 2025-04-15 17:44:28 +00:00
denobot
2e826dfc9d
chore: forward v2.2.10 release commit to main (#28897)
This is the release commit being forwarded back to main for 2.2.10

Co-authored-by: nathanwhit <nathanwhit@users.noreply.github.com>
Co-authored-by: Nathan Whitaker <nathan@deno.com>
2025-04-14 16:10:16 -07:00
Nayeem Rahman
98b7554aaf
chore: forward v2.2.9 release commit to main (#28859) 2025-04-11 22:45:54 +00: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
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
becf24c8c2
fix(compile): ensure atime/birthtime/mtime/ctime is set in vfs (#28731)
Co-authored-by: XYCode <xycode-xyc@outlook.com>
2025-04-04 09:50:44 -04:00
denobot
08274e0621
chore: forward v2.2.7 release commit to main (#28746)
This is the release commit being forwarded back to main for 2.2.7

Signed-off-by: Divy Srivastava <dj.srivastava23@gmail.com>
Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2025-04-04 16:14:30 +05:30
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
David Sherret
e2f66d4059
fix(npm): improve optional peer dep handling (#28651) 2025-03-27 22:53:41 +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
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
denobot
5f00b9700f
chore: forward v2.2.4 release commit to main (#28500) 2025-03-14 15:40:38 -07:00
David Sherret
ed2fac89eb
refactor: handle deno_media_type having Html and Sql variants (#28495) 2025-03-15 00:19:08 +09:00
David Sherret
9ea4f82643
fix(check): support types@ export conditions (#28450) 2025-03-10 13:20:48 -04:00
David Sherret
2292eb1c92
fix(node): support re-exported esm modules in cjs export analysis (#28379)
Adds support for re-exporting an ES module from a CJS one and then
importing the CJS module from ESM. Also fixes a bug where require esm
wasn't working in deno compile.
2025-03-05 16:37:46 -05:00
David Sherret
731a238d34
fix(install): support "file:" dependencies in local package.json (#28396)
This adds support for installing `file:` dependencies in a local
package.json.

In order to use these, you must not set `--node-modules-dir=...` when
using a package.json and it should use the default of
`--node-modules-dir=manual`.

Closes https://github.com/denoland/deno/issues/18701
2025-03-05 14:08:05 -05:00
denobot
d91402ae20
chore: forward v2.2.3 release commit to main (#28391)
This is the release commit being forwarded back to main for 2.2.3

Co-authored-by: littledivy <littledivy@users.noreply.github.com>
2025-03-05 05:57:04 +00:00
Dimitris Apostolou
cdf6ea32c4
chore: prefer workspace dependencies in order to avoid duplicate crates (#28281) 2025-02-26 14:55:47 +00:00
Nathan Whitaker
ee4c14a550
chore: update to rust 1.85 (#28236)
Updates to use rust 1.85. Doesn't move to the 2024 edition, as that's a
fair bit more involved.

A nice side benefit is that the new rustc version seems to lead to a
slight reduction in binary size (at least on mac):

```
    FILE SIZE   
 -------------- 
  +4.3%  +102Ki    __DATA_CONST,__const
  [NEW] +69.3Ki    __TEXT,__literals
  [NEW] +68.5Ki    Rebase Info
  +5.0% +39.9Ki    __TEXT,__unwind_info
   +57% +8.85Ki    [__TEXT]
  [NEW] +8.59Ki    Lazy Binding Info
  [NEW] +5.16Ki    __TEXT,__stub_helper
  [NEW] +3.58Ki    Export Info
  [NEW] +3.42Ki    __DATA,__la_symbol_ptr
  -0.1%    -726    [12 Others]
 -21.4% -3.10Ki    [__DATA_CONST]
 -95.8% -3.39Ki    __DATA_CONST,__got
 -20.9% -3.43Ki    [__DATA]
  -0.5% -4.52Ki    Code Signature
 -100.0% -11.6Ki    [__LINKEDIT]
  -1.0% -43.5Ki    Symbol Table
  -1.6% -44.0Ki    __TEXT,__gcc_except_tab
  -0.2% -48.1Ki    __TEXT,__const
  -3.3% -78.6Ki    __TEXT,__eh_frame
  -0.7%  -320Ki    __TEXT,__text
  -1.5%  -334Ki    String Table
  -0.5%  -586Ki    TOTAL
```
2025-02-25 08:50:01 -08:00
denobot
b9cffda7c9
chore: forward v2.2.2 release commit to main (#28292)
This is the release commit being forwarded back to main for 2.2.2

Co-authored-by: littledivy <littledivy@users.noreply.github.com>
2025-02-25 14:36:11 +05:30
Leo Kettmeir
4ba166b207
fix(http): generate OtelInfo only when otel metrics are enabled (#28286) 2025-02-24 20:27:35 -08:00
David Sherret
234deac856
fix(config): allow specifying absolute path for patch and fix panic with exports in package.json (#28279)
Closes #28250
Closes #26031
2025-02-24 17:33:01 +00:00
Leo Kettmeir
f800f5444a
chore: remove unused dependencies (#28204) 2025-02-21 02:46:56 -08:00
denobot
84fabecc9b
chore: forward v2.2.1 release commit to main (#28213)
This is the release commit being forwarded back to main for 2.2.1

Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
2025-02-21 01:35:34 +00:00
denobot
2968816863
2.2.0 (#28175)
Bumped versions for 2.2.0

---------

Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2025-02-18 23:12:17 +00:00
David Sherret
fe55e3e573
refactor: better sys trait impls (#28140) 2025-02-16 22:15:53 +01:00
denobot
4921411bb2
chore: forward v2.1.10 release commit to main (#28099)
This is the release commit being forwarded back to main for 2.1.10

---------

Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2025-02-13 08:33:19 +00:00
Nayeem Rahman
bc8554878e
fix(check): support sloppy imports with "compilerOptions.rootDirs" (#27973) 2025-02-05 23:08:10 +00:00
David Sherret
61faa32920
perf: node resolution cache (#27838)
This adds a cache for node resolution, which makes repeat lookups about
15x faster.
2025-02-03 20:25:10 -05:00
David Sherret
e46860a2fd
feat(compile): support sloppy imports (#27944)
Closes https://github.com/denoland/deno/issues/26102
2025-02-03 13:08:08 -05:00
denobot
d9db0b35e0
chore: forward v2.1.9 release commit to main (#27888)
This is the release commit being forwarded back to main for 2.1.9

Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2025-01-31 03:02:00 +01:00
denobot
1b7719c5d6
chore: forward v2.1.8 release commit to main (#27882)
This is the release commit being forwarded back to main for 2.1.8

Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2025-01-30 21:09:06 +01:00
Nayeem Rahman
0dd334b512
feat(check/lsp): support "compilerOptions.rootDirs" (#27844) 2025-01-30 00:20:25 +00:00
David Sherret
679902a108
perf(node_resolver): reduce url to/from path conversions (#27839)
Extracted out of https://github.com/denoland/deno/pull/27838/files

Reduces some allocations by accepting either a pathbuf or url for the
referrer for resolution and returning either a pathbuf or url at the
end, which the caller can then convert into to their preferred state.

This is about 4% faster when still converting the final result to a url
and 6% faster when keeping the result as a path in a benchmark I ran.
2025-01-27 15:23:20 -05:00
Divy Srivastava
8ccc05e503
fix(core): handle dyn imports exceeding call stack size (#27825)
Fixes https://github.com/denoland/deno/issues/27736
2025-01-27 09:10:12 +05:30
David Sherret
e475749935
refactor: make PackageJsonCache injectable (#27800)
This used to be complicated to do, but is now trivial.
2025-01-24 09:50:25 -05:00