1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-22 06:09:25 -05:00
Commit graph

12981 commits

Author SHA1 Message Date
Benjamin Swerdlow
428456681f
refactor(node_resolver): make conditions_from_resolution_mode configurable (#27596) 2025-01-16 23:32:09 +01:00
Nayeem Rahman
6fc6f5ebee
fix(lsp): handle pathless untitled URIs (#27637) 2025-01-16 23:32:09 +01:00
Yoshiya Hinosawa
25e0a2e567
fix(ext/node): apply @npmcli/agent workaround to npm-check-updates (#27639)
See the comment
https://github.com/denoland/deno/pull/25470#issuecomment-2435077722 for
the reason why we do this workaround to make `make-fetch-happen` work in
Deno

This PR applies the same workaround to `npm-check-updates` package.
`npm-check-updates` internally uses
[`npm-registry-fetch`](https://www.npmjs.com/package/npm-registry-fetch)
which uses
[`make-fetch-happen`](https://www.npmjs.com/package/make-fetch-happen)
(the problematic package) for making http request to npm registry.

The detection of `make-fetch-happen` doesn't work for
`npm-check-updates` because we use call stack at `net.Socket`
constructor to check if it's called from `make-fetch-happen`, but
`npm-check-updates` bundles its dependency and the check doesn't work.

This PR adds the check of `npm-check-updates` string in call stack in
net.Socket constructor to trigger the workaroud.

closes #27629
2025-01-16 23:32:09 +01:00
Nathan Whitaker
53d7f039ef
fix(lsp/check): don't resolve unknown media types to a .js extension (#27631)
Fixes https://github.com/denoland/deno/issues/25762. Note that some of
the things in that issue are not resolved (vite/client types not working
properly which has other root causes), but the wildcard module
augmentation specifically is fixed by this.

We were telling TSC that files with unknown media types had an extension
of `.js`, so the ambient module declarations weren't applying. Instead,
just don't resolve them, so the ambient declaration applies.
2025-01-16 23:32:09 +01:00
David Sherret
95c130baa1
fix(regression): show bare-node-builtin hint when using an import map (#27632) 2025-01-16 23:32:09 +01:00
David Sherret
62cf8fca69
refactor: remove CliNpmReqResolver trait in deno_resolver (#27616) 2025-01-16 23:32:09 +01:00
Rajhans Jadhao
d82c1ecdac
fix(ext/node): use primordials in ext/node/polyfills/_fs_common.ts (#27589)
Related to #24236
2025-01-16 23:32:08 +01:00
David Sherret
42bf54914d
refactor: implement NpmPackageFolderResolver in deno_resolver (#27614) 2025-01-16 23:32:08 +01:00
David Sherret
a9da90a44d
refactor(npm): move SloppyImportsCachedFs to deno_resolver (#27610) 2025-01-16 23:32:08 +01:00
David Sherret
d15a95e28b
chore: fix publish (#27612) 2025-01-09 15:55:14 -05:00
denobot
e842e5a59f
2.1.5 (#27611)
Co-authored-by: dsherret <dsherret@users.noreply.github.com>
2025-01-09 15:27:39 -05:00
Ryan Dahl
c624497b48 docs: added jsdoc for window.close() (#27608) 2025-01-09 15:19:21 -05:00
David Sherret
0e42884a4c refactor(npm): move InNpmPackageChecker code to deno_resolver (#27609)
As title. Will allow consumers to create this struct and use our
behaviour.

Closes #27409
2025-01-09 15:19:21 -05:00
Nayeem Rahman
2a508da4d4 fix(lsp): use verbatim specifier for URL auto-imports (#27605) 2025-01-09 15:19:21 -05:00
David Sherret
f3e851927c refactor(npm): extract out some npm fs resolution code from the cli (#27607)
Moves the npm fs resolvers into the deno_resolution crate.

This does not entirely move things out, but is a step in that direction.
2025-01-09 15:19:21 -05:00
David Sherret
7c1d8736d8 refactor(npm): split some resolution from installation (#27595)
This splits away some npm resolution code from installation. It will
allow for more easily extracting out resolution code in the future.
2025-01-09 15:19:21 -05:00
Leo Kettmeir
5064e9051b refactor: update deno_core for error refactor (#26867)
Closes #26171

---------

Co-authored-by: David Sherret <dsherret@gmail.com>
2025-01-09 15:19:21 -05:00
Tatsuya Kawano
97c5615b29 fix(ext/net): update moka cache to avoid potential panic in Deno.resolveDns on some laptops with Ryzen CPU (#27572) 2025-01-09 15:19:20 -05:00
David Sherret
4279c2d78a fix(jsr): Wasm imports fail to load (#27594)
* https://github.com/denoland/deno_graph/pull/562

Closes https://github.com/denoland/deno/issues/27593
2025-01-09 15:19:20 -05:00
Divy Srivastava
fa2c8e08d8 fix(ext/node): Fix os.cpus() on Linux (#27592)
Populate `speed` using current scaling frequency and fix times
multiplier.

Fixes https://github.com/denoland/deno/issues/27555

<table>
<tr>
<th>Node.js</th>
<th>Deno</th>
</tr>
<tr>
<td>

```
> os.cpus()
[
  {
    model: 'AMD Ryzen 5 7530U with Radeon Graphics',
    speed: 1396,
    times: {
      user: 1769930,
      nice: 20,
      sys: 525630,
      idle: 41325700,
      irq: 110060
    }
  },
```

</td>
<td>

```
> os.cpus()
[
  {
    model: "AMD Ryzen 5 7530U with Radeon Graphics",
    speed: 1630,
    times: [Object: null prototype] {
      user: 1795620,
      nice: 20,
      sys: 537840,
      idle: 41589390,
      irq: 111230
    }
  },
```

</td>
</tr>
</table>
2025-01-09 15:19:20 -05:00
Divy Srivastava
f813ab947e fix(ext/websocket): Fix close code without reason (#27578)
Fixes https://github.com/denoland/deno/issues/27566

The close code wasn't sent if reason was None, defaulting to 1005. This
patch allows sending close code without reason.
2025-01-09 15:19:20 -05:00
Yusuke Tanaka
9ead0b867f fix(ext/node): have process global available in Node context (#27562)
This commit makes `process` global always available in Node context.

`process` global was previously available explicitly in `deno_node`, but then
got removed in #25291 and made globally available regardless of whether it's in
Deno or Node context, so this commit does not have any effect on Deno CLI.
However, for users who want to use `deno_node` ext only, it makes sense to have
`process` available to simulate the Node environment individually.

This change may bring some negative performance impact. To measure how large the
impact would be, a very simple benchmark was performed whose results can be
found at https://github.com/magurotuna/process_global_bench.
2025-01-09 15:19:20 -05:00
Marvin Hagemeister
6b9f627d73 fix(lint): fix single char selectors being ignored (#27576)
The selector splitting code that's used for JS linting plugins didn't
properly account for selectors being a single character. This can happen
in the case of `*`.

Instead of comparing against the length, we'll now check if the
remaining string portion is not empty, which is more robust. It also
allows us to detect trailing whitespace, which we didn't before.
2025-01-09 15:19:20 -05:00
David Sherret
b93f118428 fix(no-slow-types): handle rest param with internal assignments (#27581)
Closes #27575
2025-01-09 15:19:20 -05:00
Nayeem Rahman
94796063f7 fix(lsp): don't skip dirs with enabled subdirs (#27580) 2025-01-09 15:19:20 -05:00
Nikolay Karadzhov
fa20ffb556 feat(node/fs): Add a chmod method to the FileHandle class (#27522)
Add the chmod method to the FileHandle class in node compat as part of
#25554
2025-01-09 15:19:19 -05:00
Bartek Iwańczuk
cae818a996 Revert "perf: build denort with panic = "abort" for releases (#27507)" (#27573)
Also reverts #27518

The reason is that it takes too long to build these two
binaries on Mac ARM runners as it stands.

We're gonna try to reland this next week, after sorting out
situation with these runners.
2025-01-09 15:19:19 -05:00
Bartek Iwańczuk
153b6f0365 refactor: make IncrementalCache accept a CacheDBHash (#27570) 2025-01-09 15:19:19 -05:00
Bartek Iwańczuk
51cb80693d ci: increase timeout to 240 minutes (#27571)
With https://github.com/denoland/deno/pull/27507 landed we need to do
two builds that don't really share much codegen units.

This should be reverted once we move to self-hosted runner on `main`
(https://github.com/denoland/deno/pull/27568)
2025-01-09 15:19:19 -05:00
Yoshiya Hinosawa
ee5e1db138 test(ext/node): disable flaky dgram tests (#27549)
Closes #27316
2025-01-09 15:19:19 -05:00
Luca Casonato
00719ecef7 feat(unstable): no config npm:@opentelemetry/api integration (#27541)
After this PR, one does not need to import `jsr:@deno/otel` anymore.
2025-01-09 15:19:19 -05:00
snek
5eff7df78d refactor(quic): introduce endpoint, 0rtt, cleanup (#27444)
A QUIC endpoint is a UDP socket which multiplexes QUIC sessions, which
may be initiated in either direction. This PR exposes endpoints and
moves things around as needed.

Now that endpoints can be reused between client connections, we have a
way to share tls tickets between them and allow 0rtt. This interface
currently works by conditionally returning a promise.

Also cleaned up the rust op names, fixed some lingering problems in the
data transmission, and switched to explicit error types.
2025-01-09 15:19:19 -05:00
Luca Casonato
2a54c08182 feat(unstable): replace SpanExporter with TracerProvider (#27473) 2025-01-09 15:19:18 -05:00
Yoshiya Hinosawa
7227bf424f fix(ext/http): improve error message when underlying resource of request body unavailable (#27463)
The error message is currently `Bad Resource ID`. This commit changes it to
`Cannot read request body as underlying resource unavailable`

closes #27133
2025-01-09 15:19:18 -05:00
Kitson Kelly
2c001851fe fix(kv): improve backoff error message and inline documentation (#27537)
Ref: #27536
2025-01-09 15:19:18 -05:00
David Sherret
bb233b1ab1 fix(check): move module not found errors to typescript diagnostics (#27533)
Instead of hard erroring, we now surface module not found errors as
TypeScript diagnostics (we have yet to show the source code of the
error, but something we can improve over time).
2025-01-09 15:19:18 -05:00
Nayeem Rahman
4640a34453 fix(check): line-break between diagnostic message chain entries (#27543) 2025-01-09 15:19:18 -05:00
Bartek Iwańczuk
6936badeed refactor: Use 'await using' in serve_test (#27532)
To make sure the servers are torn down when they throw an error during
test execution.
2025-01-09 15:19:18 -05:00
David Sherret
e99d3ad74d fix(permissions): implicit --allow-import when using --cached-only (#27530)
`--cached-only` cannot communicate with a remote server

Closes https://github.com/denoland/deno/issues/27498
2025-01-09 15:19:18 -05:00
David Sherret
330d72a715 refactor: remove use of home crate (#27516)
The two places mentioned in the issue are now consolidated.

Closes https://github.com/denoland/deno/issues/24385
2025-01-09 15:19:17 -05:00
David Sherret
888f40983e refactor: update some fs_util functions to use sys_traits (#27515)
This is in preparation for extracting out these functions from the CLI
crate.

A side benefit is these functions will now work in Wasm.
2025-01-09 15:19:17 -05:00
David Sherret
1b6d7910cd refactor(node/npm): separate out permission check from npm resolvers (#27511)
Decouples permissions from the npm resolvers (towards moving the
resolvers out of the cli crate)
2025-01-09 15:19:17 -05:00
Nayeem Rahman
adaa1f52e3 fix(lsp): css preprocessor formatting (#27526) 2025-01-09 15:19:17 -05:00
Nathan Whitaker
60279e726c chore: fix windows pre release CI job (#27518)
See
https://github.com/denoland/deno/actions/runs/12563186693/job/35024695065.
Broke in #27507.
2025-01-09 15:19:17 -05:00
David Sherret
0718771a8a fix(npm): deterministically output tags to initialized file (#27514)
The tags were being sorted in a random order due to the package_reqs
hashmap
2025-01-09 15:19:17 -05:00
Nathan Whitaker
d0fa4da590 perf: build denort with panic = "abort" for releases (#27507)
This PR changes CI to build denort with a separate, new build profile
`release-slim` that disables unwinding and strips symbols. This reduces
the size of denort by about 10%

current denort:

```
    FILE SIZE        VM SIZE    
 --------------  -------------- 
  58.1%  39.3Mi  57.9%  39.3Mi    __TEXT,__text
  31.5%  21.3Mi  31.4%  21.3Mi    __TEXT,__const
   2.5%  1.68Mi   2.5%  1.68Mi    __DATA_CONST,__const
   2.4%  1.62Mi   2.4%  1.62Mi    __TEXT,__eh_frame
   2.4%  1.60Mi   2.4%  1.60Mi    __TEXT,__gcc_except_tab
   0.9%   610Ki   0.9%   610Ki    __TEXT,__cstring
   0.8%   536Ki   0.8%   536Ki    Code Signature
   0.7%   507Ki   0.7%   507Ki    __TEXT,__unwind_info
   0.3%   207Ki   0.3%   207Ki    Function Start Addresses
   0.2%   165Ki   0.2%   165Ki    __DATA,__data
   0.0%       0   0.2%   153Ki    __DATA,__bss
   0.1%  51.0Ki   0.1%  51.0Ki    Rebase Info
   0.1%  45.3Ki   0.1%  45.3Ki    __TEXT,__literals
   0.0%  31.4Ki   0.1%  36.8Ki    [15 Others]
   0.0%  25.6Ki   0.0%  25.7Ki    [__TEXT]
   0.0%  19.3Ki   0.0%  20.2Ki    [__DATA]
   0.0%  8.11Ki   0.0%  8.11Ki    Lazy Binding Info
   0.0%       8   0.0%  8.08Ki    [__LINKEDIT]
   0.0%  6.84Ki   0.0%  6.84Ki    Symbol Table
   0.0%  5.55Ki   0.0%  5.55Ki    String Table
   0.0%  5.53Ki   0.0%  5.53Ki    __TEXT,__ustring
 100.0%  67.6Mi 100.0%  67.8Mi    TOTAL
```

built with this PR:

```
    FILE SIZE        VM SIZE    
 --------------  -------------- 
  59.6%  36.6Mi  59.5%  36.6Mi    __TEXT,__text
  34.6%  21.3Mi  34.5%  21.3Mi    __TEXT,__const
   2.7%  1.68Mi   2.7%  1.68Mi    __DATA_CONST,__const
   1.0%   610Ki   1.0%   610Ki    __TEXT,__cstring
   0.8%   487Ki   0.8%   487Ki    Code Signature
   0.3%   193Ki   0.3%   193Ki    Function Start Addresses
   0.3%   165Ki   0.3%   165Ki    __DATA,__data
   0.0%       0   0.2%   153Ki    __DATA,__bss
   0.2%   152Ki   0.2%   152Ki    __TEXT,__unwind_info
   0.1%  69.5Ki   0.1%  69.5Ki    __TEXT,__eh_frame
   0.1%  50.9Ki   0.1%  50.9Ki    Rebase Info
   0.1%  45.3Ki   0.1%  45.3Ki    __TEXT,__literals
   0.1%  34.1Ki   0.1%  39.5Ki    [15 Others]
   0.0%  19.3Ki   0.0%  20.2Ki    [__DATA]
   0.0%  19.6Ki   0.0%  19.7Ki    [__TEXT]
   0.0%  16.6Ki   0.0%  16.6Ki    __TEXT,__gcc_except_tab
   0.0%  8.09Ki   0.0%  8.09Ki    Lazy Binding Info
   0.0%       8   0.0%  7.69Ki    [__LINKEDIT]
   0.0%  6.83Ki   0.0%  6.83Ki    Symbol Table
   0.0%  5.77Ki   0.0%  5.77Ki    [__DATA_CONST]
   0.0%  5.53Ki   0.0%  5.53Ki    __TEXT,__ustring
 100.0%  61.4Mi 100.0%  61.6Mi    TOTAL
```

A caveat is that this will increase release build times in CI since it
requires building twice - once with unwinding and once without
2025-01-09 15:19:16 -05:00
Kenta Moriuchi
a39c83170f chore: Happy New Year 2025 (#27509) 2025-01-09 15:19:16 -05:00
David Sherret
0bbb302318 chore: cargo fmt - turn on group_imports=StdExternalCrate (#26646) 2025-01-09 15:19:15 -05:00
David Sherret
95db6a64c5 perf(fs/windows): stat - only open file once (#27487) 2025-01-09 15:19:15 -05:00
David Sherret
118fd69988 refactor: do not use deno_fs::FileSystem everywhere (#27508)
This changes the cli to mostly use `std::fs` via `sys_traits` instead of
the implemention of `deno_fs::FileSystem`.
2025-01-09 15:19:15 -05:00