Commit graph

13287 commits

Author SHA1 Message Date
snek
6b70c5caef
feat(http/serve): proxy headers 2025-03-11 11:26:48 +01:00
snek
e88366aece
fix: unhandled rejection from quic (#28448)
Fixes: https://github.com/denoland/deno/issues/28406
2025-03-11 07:23:42 +01:00
David Sherret
ff28ecd91a
fix(bench): lower bench time budget when n is specified (#28454)
Closes #28430
2025-03-10 16:17:19 -04:00
David Sherret
9ea4f82643
fix(check): support types@ export conditions (#28450) 2025-03-10 13:20:48 -04:00
Toma
64f810d45c
fix(ext/node): use primordials in ext/node/polyfills/path/_util.ts (#28432)
Towards https://github.com/denoland/deno/issues/24236
2025-03-10 06:37:20 -07:00
Nayeem Rahman
0ef3f6ba88
perf(lsp): lazily start the ts server (#28392) 2025-03-06 18:05:25 +00:00
Nayeem Rahman
e579440170
fix(lsp): silence errors from "codeAction/resolve" (#28400) 2025-03-06 18:00:44 +00:00
Bartek Iwańczuk
e6637ab6f1
chore(internal): reland eszip changes (#28294)
Co-authored-by: David Sherret <dsherret@gmail.com>
2025-03-05 22:25:56 +00: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
Nathan Whitaker
0c0757fe66
fix(install): exclude npm workspace packages from graph roots in install (#28401)
Fixes #28374.
2025-03-05 20:41:05 +00:00
Marvin Hagemeister
be73f11f83
fix(unstable): lint plugin !== wrongly parsed as != (#28403)
That's an emberassing typo. The `!==` operator was wrongly converted to
`!=`.

Fixes https://github.com/denoland/deno/issues/28397
2025-03-05 20:14:50 +00:00
Marvin Hagemeister
7f7b51c414
fix(unstable): wrong node with shorthand ObjectPattern + AssignPattern (#28402)
We did not serialize the `AssignmentPattern` node inside `ObjectPattern`
properties.

```ts
({ a = b } = {})
```

This is a bit different in SWC and looks like I got confused with the
different AST formats.

Fixes https://github.com/denoland/deno/issues/28399
2025-03-05 20:12:19 +00: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
Mohammad Sulaiman
865ec7c4f4
fix(run): skip the cjs suggestion for mjs/mts modules (#26698)
Co-authored-by: David Sherret <dsherret@gmail.com>
2025-03-05 17:29:41 +00:00
Luca Casonato
abfd45f8d2
fix(cli): warn when an otel env var has an invalid value (#28394) 2025-03-05 12:05:40 +00: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
Nayeem Rahman
25a9d1c74f
perf(lsp): register semantic tokens provider upon opening enabled doc (#28384) 2025-03-04 16:28:19 +00:00
Marvin Hagemeister
1f6f561979
fix(unstable): lint plugin fix :has(), :is/where/matches and :not() selectors (#28348)
This PR adds support for `:has/:is/:where()` and `:not()`. The latter
was already present, but found a bunch of issues with it and I'd say
that it didn't really work before this PR.


Fixes https://github.com/denoland/deno/issues/28335
2025-03-04 16:04:39 +01:00
Marvin Hagemeister
842a906295
fix(unstable): lint plugin child combinator not working with groups (#28360)
Internally, we use a group node for array-like children, which is hidden
from the user. When we're asking for a parent of a node we need to take
group nodes into account and walk over them.

Fixes one issue reported in
https://github.com/denoland/deno/issues/28355
2025-03-03 21:44:04 +01:00
David Sherret
bf060427b9
fix(node): require esm should prefer module.exports export (#28376) 2025-03-03 15:03:12 -05:00
Nayeem Rahman
6999048278
fix: respect lockfile for multiple available jsr versions (#28375) 2025-03-03 16:57:25 +00:00
David Sherret
a566d8bd10
fix: add "module.exports" export to ESM CJS wrapper module (#28373) 2025-03-03 16:47:39 +00:00
Marvin Hagemeister
9bcbef6d2f
fix(unstable): lint plugin swapped exported and source for ExportAllDeclaration (#28357)
The `source` and `exported` property were swapped for the
`ExportAllDeclaration` node.

Fixes one issue reported at
https://github.com/denoland/deno/issues/28355
2025-03-03 11:03:29 +01:00
Marvin Hagemeister
62bc07884b
fix(unstable): Missing PrivateIdentifier type for PropertyDefinition key (#28358)
The `PropertyDefinition` node also allows `PrivateIdentifier` as a type
for the `key`. Example:

```ts
class Foo {
  #foo = 2;
}
```

Fixes one issue reported in
https://github.com/denoland/deno/issues/28355
2025-03-03 11:03:06 +01:00
Marvin Hagemeister
287bde1f72
fix(unstable): lint plugin ObjectPattern inconsistencies (#28359)
Fixes inconsistencies with `ObjectPattern` node to match TSESTree.

Fixes one issue reported in
https://github.com/denoland/deno/issues/28355
2025-03-03 11:02:52 +01:00
KnorpelSenf
53339ceb8d
chore(devcontainer): add clang to cargo build (#28345) 2025-03-02 03:47:38 +00:00
Marvin Hagemeister
b6b5c7d7d9
fix(unstable/lint): remove duplicated Fix vs FixData interface (#28344)
Noticed that we have two interfaces describing the same thing: `Fix` and
`FixData`. This PR removes the `FixData` one.
2025-02-28 16:20:23 +01:00
David Sherret
2a803fe2de
fix(check/npm): move not found errors inside npm packages to tsc diagnostics (#28337) 2025-02-28 10:06:20 -05:00
Marvin Hagemeister
3a1f3455b0
feat(unstable): lint plugins support field selectors (#28324)
This PR adds support for field selectors (`.<field>`) in the lint plugin
API. This is supported in ESLint as well, but was missing in our
implementation.

```css
/* Only search the test expression of an IfStatement */
IfStatement.test
```

Fixes https://github.com/denoland/deno/issues/28314
2025-02-28 15:10:02 +01:00
Marvin Hagemeister
b4aa3e6d1e
fix(unstable): lint plugin regex attribute selector not working (#28340)
The code to support regex matching on attribute values was already
there. I just forgot to wire it up properly in the selector matching
code.

Fixes https://github.com/denoland/deno/issues/28336
2025-02-28 12:59:41 +01:00
David Sherret
5a0fca9a61
fix(fmt/md): handle callout followed by non-text (#28333) 2025-02-27 22:29:58 +00:00
Nayeem Rahman
eea5eb1c40
fix(lsp): include prefix and suffix for rename edits (#28327) 2025-02-27 21:34:32 +00:00
David Sherret
ff970bd9fe
fix: deno_ast 0.46 (#28331) 2025-02-27 21:28:36 +00:00
Nathan Whitaker
69b59b2296
perf(http): instantiate generic functions in deno_http, increase opt-level for some more hyper deps (#28317)
results on my machine (Macbook pro w/ M3 Max)

canary (hello world):
```
❯ oha -c 125 -n 4000000 --no-tui --disable-compression http://localhost:8000
Summary:
  Success rate: 100.00%
  Total:        31.0160 secs
  Slowest:      0.0083 secs
  Fastest:      0.0005 secs
  Average:      0.0010 secs
  Requests/sec: 128965.6454

  Total data:   49.59 MiB
  Size/request: 13 B
  Size/sec:     1.60 MiB
```

this PR (hello world):
```
❯ oha -c 125 -n 4000000 --no-tui --disable-compression http://localhost:8000
Summary:
  Success rate: 100.00%
  Total:        28.4050 secs
  Slowest:      0.0085 secs
  Fastest:      0.0001 secs
  Average:      0.0009 secs
  Requests/sec: 140820.2060

  Total data:   49.59 MiB
  Size/request: 13 B
  Size/sec:     1.75 MiB
```

---

Two changes here:
- use `opt-level` 3 for some of hyper's deps, since profile overrides
are not transitive
- As noted in the [cargo
reference](https://doc.rust-lang.org/cargo/reference/profiles.html#overrides-and-generics)
generic functions _may_ be optimized at the opt-level of the
_instantiating_ crate, rather than the defining crate. So currently it's
possible that some of the functions in `deno_http` are being compiled at
a lower optimization level. This PR ensures the generics are
instantiated in `deno_http`, which theoretically should guarantee they
actually use opt-level 3.

To allow embedders to still provide a custom property extractor, I put
this behind a feature flag.
2025-02-27 10:07:11 -08:00
Luca Casonato
aa55efaa13
fix(otel): don't throw when calling setActiveSpan at root (#28323)
When calling `setActiveSpan` at the module root, or with `options.root =
true`, the function would internally throw.
2025-02-27 18:47:09 +01:00
Nayeem Rahman
1fe721f1f8
fix(lsp): limit languages in semantic tokens provider (#28310) 2025-02-26 16:00:40 +00:00
Dimitris Apostolou
cdf6ea32c4
chore: prefer workspace dependencies in order to avoid duplicate crates (#28281) 2025-02-26 14:55:47 +00:00
Bartek Iwańczuk
9f877ac5bd
fix(lint): run with --no-prompt (#28305)
Ref https://github.com/denoland/deno/issues/28258

This commit forces lint plugins to run with `--no-prompt` flag,
bringing parity between running plugins in the LSP and via
`deno lint`.

There's no agreement how to handle permissions in the lint
plugins yet, so it's better to make both subcommands behave
identically for the time being.
2025-02-26 09:15:56 -05:00
Muthuraj Ramalingakumar
1a30b7450b
fix(ext/node): node compatibility issue missing fd in createServer callback socket object (#27789) 2025-02-26 14:52:18 +09:00
Bartek Iwańczuk
bd372dcdc2
refactor: update deno_core to enable pointer compression (#28306)
Exposes `deno_core/v8_enable_pointer_compression` feature:

d67efcba0a
2025-02-26 04:00:45 +01:00
Bartek Iwańczuk
cbdbc75031
fix(add): better help text for --dev arg (#28304)
Signed-off-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Co-authored-by: Leo Kettmeir <crowlkats@toaxl.com>
2025-02-25 23:50:45 +00:00
Nayeem Rahman
0f76f6c211
perf(lsp): don't set resolver npm reqs if unchanged (#28302) 2025-02-25 21:56:50 +00:00
Nathan Whitaker
9a2386c82d
chore: fix linter error on main (#28301)
3779830822
2025-02-25 18:11:00 +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
Divy Srivastava
e66ef32a8f
fix(ext/node): SQLite reset guards to prevent database locks (#28298)
Fixes https://github.com/denoland/deno/issues/28295
2025-02-25 19:27:55 +05:30
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
Marvin Hagemeister
f9166797d2
fix(lint): plugins ignored when no rust rule active (#28269)
When all Rust-based rules where filtered out we were bailing out early
instead of checking if there are plugin rules we need to run. This meant
we errored out with a "No lint rules to run" message, even though plugin
rules were active.

Fixes https://github.com/denoland/deno/issues/28267
2025-02-24 23:35:49 +01: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
Marvin Hagemeister
6ac6e933dc
fix(lint): update deno_lint (#28271)
Signed-off-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Co-authored-by: David Sherret <dsherret@users.noreply.github.com>
2025-02-24 18:05:17 +01:00