Commit Graph

11208 Commits

Author SHA1 Message Date
denobot
7cb23c5e3e
1.42.4 (#23390)
Bumped versions for 1.42.4

Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
2024-04-16 02:17:02 +02:00
Nayeem Rahman
e7d005f95a
fix(lsp): slice strings by byte index in code actions (#23387)
Fixes #23361.
2024-04-16 01:25:39 +02:00
Bartek Iwańczuk
9905ff9514
fix(ext/node): panic on 'worker_threads.receiveMessageOnPort' (#23386)
Closes https://github.com/denoland/deno/issues/23362

Previously we were panicking if there was a pending read on a
port and `receiveMessageOnPort` was called. This is now fixed
by cancelling the pending read, trying to read a message and
resuming reading in a loop.
2024-04-16 01:25:39 +02:00
David Sherret
79f2901c22
fix(check): cache bust when changing nodeModulesDir setting (#23355) 2024-04-16 01:25:39 +02:00
Bartek Iwańczuk
bb654f4c5d
chore: upgrade deno_core to 0.275.0 (#23383) 2024-04-16 01:25:38 +02:00
David Sherret
e2cef5e1c4
fix(lsp): improved cjs tracking (#23374)
Our cjs tracking was a bit broken. It was marking stuff as esm that was
actually cjs leading to type checking errors.
2024-04-16 01:25:38 +02:00
Matt Mastracci
3938d77fbf
fix(ext/io): Fix NUL termination error in windows named pipes (#23379)
Due to a terminating NUL that was placed in a `r#` string, we were not
actually NUL-terminating pipe names on Windows. While this has no
security implications due to the random nature of the prefix, it would
occasionally cause random failures when the trailing garbage would make
the pipe name invalid.
2024-04-16 01:25:38 +02:00
Bartek Iwańczuk
6241c94825
refactor: move lifecycle events dispatch to Rust (#23358)
This commit moves logic of dispatching lifecycle events (
"load", "beforeunload", "unload") to be triggered from Rust.
Before that we were executing scripts from Rust, but now we
are storing references to functions from "99_main.js" and calling
them directly.

Prerequisite for https://github.com/denoland/deno/issues/23342
2024-04-16 01:25:38 +02:00
Divy Srivastava
8bdab5a15c
fix(ext/node): add stub for AsyncResource#asyncId() (#23372)
Ref https://github.com/denoland/deno/issues/23263
2024-04-16 01:25:38 +02:00
David Sherret
f6b2880270
fix(lsp): ensure project version is incremented when config changes (#23366)
I'm running into a node resolution bug in the lsp only and while
tracking it down I noticed this one.

Fixed by moving the project version out of `Documents`.
2024-04-16 01:25:38 +02:00
Nayeem Rahman
691258908d
refactor(lsp): use fallback resolution in op_resolve() (#23329) 2024-04-16 01:24:39 +02:00
David Sherret
64d3b1fc00
perf: do not clone swc Program when transpiling (#23365) 2024-04-16 01:24:38 +02:00
David Sherret
832492188c
fix(publish): do not error for param with initializer before required parameter (#23356)
* https://github.com/denoland/deno_graph/pull/440

Closes https://github.com/denoland/deno/issues/23331
2024-04-16 01:24:38 +02:00
Divy Srivastava
4e022e85b3
fix(ext/node): use ext/io stdio in WriteStream (#23354)
This is the same issue as https://github.com/denoland/deno/pull/23044
but in `WriteStream`.

Adding a docusarus test in npm_smoke_tests repo.
2024-04-16 01:24:38 +02:00
Divy Srivastava
80695e6391
fix(ext/node): promise rejection in VM contexts (#23305)
Fixes https://github.com/denoland/deno/issues/23297

`docusaurus build` works!

```
$ deno run -A repro.js 
fish: Job 1, 'deno run -A ../../littledivy/fs…' terminated by signal SIGSEGV (Address
 boundary error)
$ denod run -A repro.js
error: Uncaught (in promise) Error: rejected
```

Depends on https://github.com/denoland/deno_core/pull/693
2024-04-16 01:24:38 +02:00
David Sherret
4cb679bb09
fix(publish): handle definite assignment on ts private properties (#23345) 2024-04-16 01:24:38 +02:00
Nathan Whitaker
f819d4719c
perf(lsp): Only deserialize response from op_respond once (#23349)
Previously we were deserializing it twice - once to `serde_json::Value`,
and then again from the `serde_json::Value` to a concrete type
2024-04-16 01:24:38 +02:00
David Sherret
aa11858372
chore(test): use file_test_runner for spec tests (#23348)
Extracted out this code to https://github.com/denoland/file_test_runner
and added parallelism. This makes these tests run 6 seconds faster on my
machine and allows re-using this code in other crates like deno_graph,
deno_doc, etc (ex. https://github.com/denoland/deno_graph/pull/437).
2024-04-16 01:24:10 +02:00
Divy Srivastava
508a362c66
chore: upgrade deno_core to 0.274.0 (#23344)
Signed-off-by: Divy Srivastava <dj.srivastava23@gmail.com>
2024-04-16 01:24:10 +02:00
Matt Mastracci
11756b4a50
chore: fix nightly builds (#23328)
- Bump `curve25519-dalek` to fix unstable features
 - Bump to llvm-17 to match latest minimum
 - cargo update to fix all the things that break w/llvm-17
2024-04-16 01:24:10 +02:00
youngwendy
5efbca8808
chore: remove repetitive words (#23341)
Signed-off-by: youngwendy <clonefetch@outlook.com>
2024-04-16 01:24:10 +02:00
Luca Casonato
d6aa1026c2
chore: update deno_graph (#23340) 2024-04-16 01:24:09 +02:00
Bartek Iwańczuk
7d97413079
test(compile): dynamic JSR imports are working correctly (#23306)
Adds a test that ensure that dynamic import from JSR are working
correctly for `deno compile`.
2024-04-16 01:24:09 +02:00
denobot
a64a257024
1.42.3 (#23333)
Bumped versions for 1.42.3

Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
2024-04-12 02:54:12 +02:00
David Sherret
3f7f931716
fix(publish): do not warn about excluded external modules in node_modules directory (#23173) 2024-04-12 02:08:32 +02:00
Bartek Iwańczuk
e5828a9585
fix(inspector): don't panic if port is not free (#22745)
Closes https://github.com/denoland/deno/issues/22113
Closes https://github.com/denoland/deno/issues/23177
Closes https://github.com/denoland/deno/issues/22883
Closes https://github.com/denoland/deno/issues/22377
2024-04-12 02:08:32 +02:00
David Sherret
a5dab06aaf
fix: upgrade deno_ast related crates (#23187)
Had to revert back swc due to
https://github.com/swc-project/swc/issues/8840

Fixes:

- https://github.com/denoland/deno_lint/pull/1262
- https://github.com/denoland/deno_doc/pull/538
- https://github.com/denoland/deno_doc/pull/537
- https://github.com/denoland/deno_graph/pull/430
- https://github.com/denoland/deno_graph/pull/425
- https://github.com/denoland/deno_graph/pull/432
2024-04-12 02:08:32 +02:00
Nayeem Rahman
26bf808c56
perf(lsp): use a stub module in tsc for failed resolutions (#23313) 2024-04-12 02:08:31 +02:00
Bartek Iwańczuk
e9cf8ffc26
Revert "refactor(ext/net): extract TLS key and certificate from inter… (#23325)
…faces (#23296)"

This reverts commit e190acbfa8.

Reverting because it broke stable API type declarations. We will reland
it for v1.43 with updated interfaces
2024-04-12 02:08:31 +02:00
Nathan Whitaker
68c6d06e38
fix(lsp): Denormalize specifiers before calling $projectChanged (#23322)
Fixes the regression described in
https://github.com/denoland/deno/pull/23293#issuecomment-2049819724.
This affected jupyter notebooks, as the LSP was passing in already
denormalized specifiers, while the jupyter kernel was not. We need to
denormalize the specifiers to evict the proper keys from our caches.
2024-04-12 02:08:31 +02:00
David Sherret
734e84badc
fix(npm): local nodeModulesDir was sometimes resolving duplicates of same package (#23320) 2024-04-12 02:08:31 +02:00
Bartek Iwańczuk
0c3cbe14ac
chore: update release doc template (#23299)
Adjusts release doc template to changes made by @crowlKats in
`apiland_scripts`.
2024-04-12 02:08:31 +02:00
denobot
04c0a4cbf7
1.42.2 (#23314)
Co-authored-by: Satya Rohith <me@satyarohith.com>
2024-04-11 12:09:03 +05:30
Nayeem Rahman
9e6e25529b
perf(lsp): replace document registry source cache on update (#23311) 2024-04-11 10:31:52 +05:30
Nathan Whitaker
be9c36cf6c
perf(lsp): Only evict caches on JS side when things actually change (#23293)
Currently we evict a lot of the caches on the JS side of things on every
request, namely script versions, script file names, and compiler
settings (as of #23283, it's not quite every request but it's still
unnecessarily often).

This PR reports changes to the JS side, so that it can evict exactly the
caches that it needs too. We might want to do some batching in the
future so as not to do 1 request per change.
2024-04-11 10:31:52 +05:30
林炳权
e2a817d11c
chore: update to Rust 1.77.2 (#23262)
update to Rust 1.77.2


---------

Co-authored-by: Matt Mastracci <matthew@mastracci.com>
2024-04-11 10:31:52 +05:30
Asher Gomez
0cc0cd0bbc
chore: update references to deno_std to use JSR (#23239)
There are more uses of `deno.land/std` in the codebase, but for URL
parsing purposes rather than network calls or documentation.
2024-04-11 10:31:52 +05:30
Nayeem Rahman
b8ac027ff4
refactor(lsp): cleanup documents dependents calculation (#23295) 2024-04-11 10:31:52 +05:30
Asher Gomez
8cd97bc845
fix(ext/fs): account for all ops in leak checks (#23300)
This is PR a smaller retry of #23066 that simply ensures all async
`ext/fs` ops are accounted for if left hanging in tests. This also sorts
the `OP_DETAILS` in alphabetical order for easy future reading.

When reviewing, it might be best to look at the commits in order for
better understanding.
2024-04-11 10:31:52 +05:30
Matt Mastracci
c169a8f127
refactor(ext/net): extract TLS key and certificate from interfaces (#23296)
Removes the certificate options from all the interfaces and replaces
them with a new `TlsCertifiedKeyOptions`. This allows us to centralize
the documentation for TLS key management for both client and server, and
will allow us to add key object support in the future.

Also adds an option `keyFormat` field to the cert/key that must be
omitted or set to `pem`. This will allow us to load other format keys in
the future `der`, `pfx`, etc.

In a future PR, we will add a way to load a certified key object, and we
will add another option to `TlsCertifiedKeyOptions` like so:

```ts
export interface TlsCertifiedKeyOptions =
    | TlsCertifiedKeyPem
    | TlsCertifiedKeyFromFile
    | TlsCertifiedKeyConnectTls
    | { key: Deno.CertifiedKey }
```
2024-04-11 10:31:52 +05:30
Nathan Whitaker
9056fdeda2
perf(lsp): More granular locking of FileSystemDocuments (#23291)
Previously we locked the entire `FileSystemDocuments` even for lookups,
causing contention. This was particularly bad because some of the hot
ops (namely `op_resolve`) can end up hitting that lock under contention.

This PR replaces the mutex with synchronization internal to
`FileSystemDocuments` (an `AtomicBool` for the dirty flag, and then a
`DashMap` for the actual documents).

I need to think a bit more about whether or not this introduces any
problematic race conditions.
2024-04-11 10:31:51 +05:30
Carlos Precioso
ba72b3bc63
docs: Fix typo "discreet" to "discrete" (#23290)
Changes `discreet` in the documentation for `discrete`

"Discreet" means careful to avoid being noticed, "discrete" means
separate parts, and is what the documentation refers to.
2024-04-11 10:31:51 +05:30
Satya Rohith
7ef10564d5
fix(ext/node): implement MessagePort.unref() (#23278)
Closes https://github.com/denoland/deno/issues/23252
Closes https://github.com/denoland/deno/issues/23264
2024-04-11 10:31:51 +05:30
Divy Srivastava
51f77463d0
fix(ext/node): node:vm contexts (#23202)
Implement contextified objects in `node:vm`

Fixes https://github.com/denoland/deno/issues/23186
Fixes https://github.com/denoland/deno/issues/22395
Fixes https://github.com/denoland/deno/issues/20607
Fixes https://github.com/denoland/deno/issues/18299
Fixes https://github.com/denoland/deno/issues/19395
Fixes https://github.com/denoland/deno/issues/18315
Fixes https://github.com/denoland/deno/issues/18319
Fixes https://github.com/denoland/deno/issues/23183
2024-04-11 10:31:51 +05:30
Asher Gomez
4ad011e829
chore: update h2 crate (#23272)
Prerequisite #23273.
2024-04-11 10:31:51 +05:30
Matt Mastracci
a91bf052c1
feat(ext/net): Refactor TCP socket listeners for future clustering mode (#23037)
Changes:

- Implements a TCP socket listener that will allow for round-robin
load-balancing in-process.
 - Cleans up the raw networking code to make it easier to work with.
2024-04-11 10:31:51 +05:30
Asher Gomez
95e78a96b1
refactor: use chrono::DateTime::from_timestamp (#23273)
`chrono::NaiveDateTime::from_timestamp_opt()` was deprecated in
https://github.com/chronotope/chrono/pull/1473.

Prerequisite for #23272.
2024-04-11 10:31:51 +05:30
Nayeem Rahman
37d81841b4
perf(lsp): cache ts config in isolate until new project version (#23283) 2024-04-11 10:31:51 +05:30
Bartek Iwańczuk
c8086a29a3
fix(ext/http): Make Deno.serveHttp() work when proxying (#23269)
Closes https://github.com/denoland/deno/issues/21900
2024-04-11 10:31:51 +05:30
Matt Mastracci
377573c6bc
refactor(ext/tls): use cppgc to deduplicate the tls key loading code (#23289)
Pass the certificates and key files as CPPGC objects.

Towards #23233
2024-04-11 10:31:51 +05:30