0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-03-04 09:57:11 -05:00
Commit graph

13200 commits

Author SHA1 Message Date
David Sherret
743fc4a261
refactor(publish): create ModuleContentProvider (#28177)
Adds a `ModuleContentProvider`. Will use this in a future PR to do more
than specifier unfurling (JSX support).
2025-02-19 14:58:10 -05:00
Kenta Moriuchi
297f85cbb6
chore: update dlint to 0.73.0 for CI (#28169) 2025-02-19 14:07:01 +00:00
Bartek Iwańczuk
e4b8fa5f4f
fix: move extension file declarations to cli/tsc/dts (#28180)
This commits moves all `.d.ts` files from `ext/*` to `cli/tsc/dts`.

Due to TSC snapshot removal, `cargo publish` is now erroring out,
unable to find the declaration files. These files were moved to
"cli/tsc/dts", because it's much easier than keeping them in 
extension directories, while still providing them compressed 
or uncompressed depending on the build type.
2025-02-19 02:53:21 +01:00
Bartek Iwańczuk
e03c990493
fix(ext/cache): add missing Cargo feature (#28178) 2025-02-19 00:29:01 +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
Leo Kettmeir
bf79971c95
feat(http): add otel metrics (#28034)
Signed-off-by: Leo Kettmeir <crowlkats@toaxl.com>
Co-authored-by: Luca Casonato <hello@lcas.dev>
2025-02-18 14:19:52 -08:00
David Sherret
f62fc9e81f
fix(check): npm resolution errors to tsc diagnostics (#28174)
Closes https://github.com/denoland/deno/issues/27188
2025-02-18 21:44:49 +00:00
David Sherret
3747d2759a
feat: support XDG_CACHE_HOME for deno dir on macos (#28173)
* https://github.com/denoland/deno_cache_dir/pull/73
2025-02-18 14:56:07 -05:00
David Sherret
116def7fad
feat(bench): add warmup and n for controlling number of iterations (#28123)
```ts
Deno.bench("benchmark", { warmup: 10_000, n: 1000 }, () => {
  ...
});
```

Closes #17649
2025-02-18 12:44:43 -05:00
Gowtham K
9b9eeabcc8
fix(node/sqlite): sqlite named parameters (#28154)
This PR introduces support for named parameters in SQLite queries, as
outlined in #28134
2025-02-18 22:03:39 +05:30
snek
6206343b54
fix: handle all values for buffers in turbocall codegen (#28170)
Now that ArrayBuffer/ArrayBufferView is a generic Value type, we have to
handle it being passed any value. To do this, thread
FastApiCallbackOptions through the function, and add error raising
logic.

If we run conversion and the value is not valid, we return `isize::MAX`,
and then in cranelift we use this value to know that we should branch to
the error logic.

An example compilation looks like this:
```rust
extern "C" fn print_buffer(ptr: *const u8, len: usize);
```

```clif
function %print_buffer_wrapper(i64, i64, i64, i64) system_v {
    sig0 = (i64, i64) system_v
    sig1 = (i64) -> i64 system_v
    sig2 = (i64) system_v

block0(v0: i64, v1: i64, v2: i64, v3: i64):
    v4 = iconst.i64 0x6525_9198_2d00 ; turbocall_ab_contents
    v5 = call_indirect sig1, v4(v1)
    v6 = iconst.i64 0x7fff_ffff_ffff_ffff
    v7 = icmp eq v5, v6
    brif v7, block1, block2

block2:
    v8 = iconst.i64 0x7558_4c0c_0700 ; sym.ptr
    call_indirect sig0, v8(v5, v2)
    return

block1 cold:
    v9 = iconst.i64 0x6525_9198_2d70 ; turbocall_raise
    call_indirect sig2, v9(v3)
    return
}
```

Also cleaned up all the `unwrap`s and added some logging.
2025-02-18 16:24:25 +00:00
Divy Srivastava
4ab380e0a7
fix(ext/node): implement StatementSync#iterate (#28168)
Fixes https://github.com/denoland/deno/issues/28130
2025-02-18 21:26:17 +05:30
Bartek Iwańczuk
2f4527562c
fix(init): force --reload if npm or jsr package (#28150)
Ref
https://github.com/denoland/deno/issues/28148#issuecomment-2663189433
2025-02-18 13:43:32 +01:00
Rajhans Jadhao
45777b8eca
fix(ext/node): use primordials in ext/node/polyfills/path/common.ts (#28164)
Related to https://github.com/denoland/deno/issues/24236
2025-02-18 12:51:14 +01:00
Nayeem Rahman
f2a8c300d4
perf(lsp): don't clone asset text (#28165) 2025-02-18 11:46:19 +00:00
Leo Kettmeir
17a51c401a
feat(jupyter): make GPUTexture and GPUBuffer displayable (#28117) 2025-02-18 00:29:45 -08:00
Bartek Iwańczuk
1f169f4b09
fix(lint): don't mark plugin diagnostic as fixable, if it's not (#28147)
A vector with fixes was always created, even if there were no
applicable fixes.
2025-02-17 14:46:55 +00:00
printfn
70d775c57d
fix(unstable/temporal): implement Temporal.ZonedDateTime.getTimeZoneTransition (#27770)
This patches Temporal to support the `getTimeZoneTransition` method on
`ZonedDateTime`.

See https://github.com/denoland/deno/issues/27731.

Co-authored-by: printfn <printfn@users.noreply.github.com>
2025-02-17 14:02:34 +00:00
David Sherret
36933fb0b8
perf(lsp): make auto-imports a little faster (#28106) 2025-02-17 08:55:01 -05:00
David Sherret
fe55e3e573
refactor: better sys trait impls (#28140) 2025-02-16 22:15:53 +01:00
David Sherret
8d86198c69
chore: move tracing build to build job (#28141) 2025-02-16 15:46:13 -05:00
David Sherret
4ff629bb2a
chore: fix dts file for DefinitelyTyped linting (#28114)
Added this so that we only export exports from `Deno.lint`. Required to
pass DefinitelyTyped's linting.
2025-02-16 13:56:17 -05:00
Nathan Whitaker
56f67b5851
refactor: put lsp tracing behind flag (#28118)
To reduce binary size impact

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2025-02-14 17:17:52 +00:00
snek
979e2f7158
feat: Upgrade V8 to 13.4 (#28080)
- upgrade v8 to 13.4
- turbocall conversion for arraybuffers is now much more complex, so use
cranelift
- misc updates for deprecated fns
- v8 default stack size is too small now, causing stack overflow
exceptions in some tests
- add syscall shim to support new syscall in old sysroot
2025-02-14 11:26:47 +00:00
David Sherret
c08a4b61ac
fix(workspace): diagnostic for imports in member with importMap at root (#28116)
Closes https://github.com/denoland/deno/issues/28110
2025-02-14 11:04:25 +00:00
Bartek Iwańczuk
02ded3b1f6
fix(lint): react-rules-of-hooks works with destructuring (#28113) 2025-02-14 09:30:48 +00:00
Marvin Hagemeister
6c368c2469
fix(unstable): align js lint context API with eslint (#28066)
This PR aligns the `RuleContext` of JS plugins with ESLint.

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2025-02-13 14:01:57 +00:00
David Sherret
a2fafd3e31
fix: cache bust http cache on lockfile integrity mismatch (#28087)
Cache busts the http cache when the lockfile integrity doesn't match
what's in the cache. This will help when someone's lockfile is in line
with the remote server, but their local cache isn't.
2025-02-13 13:23:24 +01:00
David Sherret
adf461f0df
fix(task): support --frozen flag (#28094)
Supports `deno task --frozen=false some_task`, which is necessary
because with `"nodeModulesDir": "auto"` or `"global"` (the default with
no package.json) we do an auto-install of npm packages.

Closes https://github.com/denoland/deno/issues/28070
2025-02-13 13:22:15 +01:00
Marvin Hagemeister
e1871e5291
feat(unstable): add js lint plugin source code helpers (#28065)
This PR adds a part of the `SourceCode` API in eslint (see
https://eslint.org/docs/latest/extend/custom-rules#applying-fixes) .
It's used to get the text of the current node, etc.
2025-02-13 13:19:55 +01:00
Nathan Whitaker
bb4ee0cb17
refactor: support hmr feature for lsp files (#28103)
So you can edit (e.g.) 00_typescript.js and not have to recompile during
dev
2025-02-13 11:39:44 +00:00
David Sherret
d7203c9522
fix(completions): remove problematic character for powershell (#28102)
Untested because I am not on a windows machine atm. 

Closes #28092
2025-02-13 11:32:14 +00:00
David Sherret
7946906ac5
fix: add hint to run with --no-check when type checking fails (#28091) 2025-02-13 10:54:52 +00: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
Nathan Whitaker
33bccf9090
perf(check): use v8 code cache for extension sources in deno check (#28089)
In particular this helps startup of the TSC isolate because
`00_typescript.js` can use the code cache.

Overall, this offsets a fair bit of the hit we took when we removed the
TSC snapshot.

```
❯ hyperfine --warmup 5 -p "rm -rf ~/Library/Caches/deno/check_cache_v2" "./deno-this-pr check main.ts" "./deno-no-snapshot check main.ts" "./deno-with-snapshot check main.ts"
Benchmark 1: ../../deno/target/release-lite/deno check main.ts
  Time (mean ± σ):     145.7 ms ±   3.6 ms    [User: 347.6 ms, System: 36.9 ms]
  Range (min … max):   142.2 ms … 155.9 ms    19 runs

Benchmark 2: ./deno-no-snapshot check main.ts
  Time (mean ± σ):     195.4 ms ±   3.3 ms    [User: 397.7 ms, System: 34.9 ms]
  Range (min … max):   192.1 ms … 206.0 ms    15 runs

Benchmark 3: ./deno-with-snapshot check main.ts
  Time (mean ± σ):     109.0 ms ±   2.2 ms    [User: 155.9 ms, System: 19.3 ms]
  Range (min … max):   106.5 ms … 118.0 ms    26 runs

Summary
  ./deno-with-snapshot check main.ts ran
    1.34 ± 0.04 times faster than ./deno-this-pr check main.ts
    1.79 ± 0.05 times faster than ./deno-no-snapshot check main.ts
```
2025-02-12 17:47:00 +00:00
Bartek Iwańczuk
55c5b07535
perf(lsp): add built-in tracing support for the LSP (#27843)
adds tracing and opentelemetry exporting to the LSP.

enable it in `.vscode/settings.json` (or wherever you configure the
LSP), like

```
{
  "deno.tracing": true
}
```

which will by default export opentelemetry traces to `localhost:4317`
or
```
{
  "deno.tracing": {
    // all fields optional
     "collector": "openTelemetry" (default) | "logging" (output in lsp log window)
     "collectorEndpoint": "http://localhost:4318" (for opentelemetry)
     "enable": true | false,
     "filter": "info" // defaults to "info", but can be any span filter
   }
}
```

---

a full working setup would be 

1: Run jaeger (an opentelemetry collector with a nice UI):
```
docker run --rm -p 16686:16686 -p 4317:4317 jaegertracing/jaeger
```
2. Enable in .vscode/settings.json
```
{
  "deno.tracing": true
}
```
3. Restart LSP (right now it only will start the opentelemetry exporter
on LSP startup)
3. open `http://localhost:16686` in your browser

---------

Co-authored-by: Nathan Whitaker <nathan@deno.com>
2025-02-12 08:40:40 -08:00
Nayeem Rahman
555a4ac0c4
fix(lsp): include description for auto-import completions (#28088) 2025-02-12 15:59:18 +00:00
Divy Srivastava
cda0c5b3ae
fix: do special file permission check for check_read_path (#27989)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2025-02-12 15:46:21 +00:00
Leo Kettmeir
7253820764
refactor: object wrap WebGPU (#27665)
Fixes #25874
Fixes #26760
Fixes #24288
Fixes #24798
Fixes #25627
Fixes #25915
Fixes #26769
2025-02-12 13:45:41 +00:00
David Sherret
7a112643f5
refactor(lsp): remove Send + Sync requirement (#28035) 2025-02-12 13:37:47 +00:00
Bartek Iwańczuk
d29f9f99dd
fix(lint): Deno.lint.runPlugin throws in deno run (#28063)
This commit changes `Deno.lint.runPlugin` to throw
in non-`deno test` subcommand, instead of returning
`undefined`.
2025-02-12 09:18:55 +00:00
Yoshiya Hinosawa
3ff9ca2533
docs(cli): update description of readFile and readFileSync (#28079) 2025-02-12 17:56:12 +09:00
Bartek Iwańczuk
795ecfdca6
refactor(lsp): make TS host use CLI snapshot (#28062)
This commit changes the TS host implementation
in the LSP to use the same snapshot as the runtime worker
and web worker use.

This is due to upcoming V8 upgrade that might require
that all isolates in the same process use the exact same
snapshot.
2025-02-11 18:33:04 +01:00
Leo Kettmeir
c1a0d63753
fix(streams): handle Resource stream error (#27975)
Fixes #27715
2025-02-11 09:27:52 -08:00
Marvin Hagemeister
a2afae46b6
fix(unstable): add missing rule context types (#28014) 2025-02-11 16:35:16 +01:00
Bartek Iwańczuk
23540c2825
refactor: remove tsc snapshot (#28056)
This reverts commit acdc7dcdcf
and relands 174e496847.

Closes https://github.com/denoland/deno/issues/28047
Closes https://github.com/denoland/deno/issues/28044
2025-02-11 15:36:07 +01:00
Jo Franchetti
07410d19cf
docs: adding examples and a see link to Websockets jdocs (#27957)
adding examples to websockets interfaces and a see link

---------

Co-authored-by: Phil Hawksworth <phil@deno.com>
2025-02-11 15:35:15 +01:00
Bartek Iwańczuk
b9183c737f
fix: allow creating TSC host without a snapshot (#28058) 2025-02-11 14:34:59 +00:00
Marvin Hagemeister
aead459fb2
feat(unstable): support multiple fixes from lint plugins (#28040)
This PR supports returning multiple changes from a lint fix. It works
the same way as eslint, see
https://eslint.org/docs/latest/extend/custom-rules#applying-fixes .

- Return a single fix
- Return an array of fixes
- Return a generator function with fixes
2025-02-11 15:24:28 +01:00
Divy Srivastava
196ceb76bb
fix(ext/node): DatabaseSync#exec should execute batch statements (#28053)
Fixes https://github.com/denoland/deno/issues/28050
2025-02-11 19:52:33 +05:30