1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-28 16:20:57 -05:00
Commit graph

12634 commits

Author SHA1 Message Date
Divy Srivastava
c9400a0969
fix: share inotify fd across watchers (#26200)
Fixes https://github.com/denoland/deno/issues/26104
Fixes https://github.com/denoland/deno/issues/26071
Fixes https://github.com/denoland/deno/issues/17757
2024-10-25 02:09:37 +02:00
Yoshiya Hinosawa
dc46d546ac
fix(ext/node): map ERROR_INVALID_NAME to ENOENT on windows (#26475)
In libuv on windows, `ERROR_INVALID_NAME` is mapped to `ENOENT`, but it
is mapped to `EINVAL` in our compat implementation, which causes the
issue #24899.

ref:
d4ab6fbba4/src/win/error.c (L138)

closes #24899 
closes #26411
closes #23635
closes #21165
closes #19067
2024-10-25 02:09:36 +02:00
Nathan Whitaker
4a4b83a90b
fix(check): support --frozen on deno check (#26479)
Fixes https://github.com/denoland/deno/issues/26391
2024-10-25 02:09:36 +02:00
Bartek Iwańczuk
22b061489d
refactor: add 'docs' suggestion (#26463)
Adds another kind to `FixSuggestionKind` specifically for links
documentation pages.
2024-10-25 02:09:36 +02:00
Nathan Whitaker
91614bffa9
fix(cli): increase size of blocking task threadpool on windows (#26465)
Fixes #26179.

The original error reported in that issue is fixed on canary, but in
local testing on my windows machine, `next build` would just hang
forever.

After some digging, what happens is that at some point in next build,
readFile promises (from `fs/promises` ) just never resolve, and so next
hangs.

It turns out the issue is saturating tokio's blocking task thread pool.
We previously limited the number of blocking threads to 32, and at some
point those threads are all in use and there's no thread available for
the file reads.

What's taking up all of those threads? The answer turns out to be
`tokio::process`. On windows, child process stdio uses the blocking
threadpool: https://github.com/tokio-rs/tokio/pull/4824. When you poll
the child's stdio on windows, it spawns a blocking task per poll, and
calls `std::io::Read::read` in the blocking context. That call can block
until data is available.
Putting it all together, what happens is that Next.js spawns `2 * the
number of CPU cores` deno child subprocesses to do work. We implement
`child_process` with `tokio::process`. When the child processes' stdio
get polled, blocking tasks get spawned, and those blocking tasks might
block until data is available. So if you have 16 cores (as I do), there
are going to be potentially >32 blocking task threadpool threads taken
just by the child processes. That leaves no room for other tasks to make
progress

---

To fix this, for now, increase the size of the blocking threadpool on
windows. 4 * the number of CPU cores should be enough to leave room for
other tasks to make progress.

Longer term, this can be fixed more properly when we handroll our own
subprocess code (needed for detached processes and additional pipes on
windows).
2024-10-25 02:09:36 +02:00
Ronny Chan
7c084f357f
fix: unpin tokio version (#26457)
Fixes https://github.com/denoland/deno/issues/26455

Signed-off-by: Ronny Chan <ronny.chan@okta.com>
2024-10-25 02:09:36 +02:00
tsukasa-ino
a44b25601b
chore(ci): use setup-deno@v2 (#26474) 2024-10-25 02:09:36 +02:00
Pig Fang
df34dbe377
fix(fmt): upgrade formatters (#26469)
Fixes #25926 
Fixes #26004
2024-10-25 02:09:35 +02:00
Leo Kettmeir
ad563c3098
fix(ext/console): ignore casing for named colors in css parsing (#26466) 2024-10-25 02:09:35 +02:00
Leo Kettmeir
19110519f7
refactor(runtime/ops): use concrete error types (#26409) 2024-10-25 02:09:35 +02:00
Bartek Iwańczuk
dca94aba82
fix(install): update lockfile when using package.json (#26458)
This commit makes sure that `deno add`, `deno install` and `deno remove`
update the lockfile if only `package.json` file is present.

Fixes https://github.com/denoland/deno/issues/26270
2024-10-25 02:09:35 +02:00
Nayeem Rahman
7b912da996
fix(lsp): import-map-remap quickfix for type imports (#26454) 2024-10-25 02:09:35 +02:00
David Sherret
92c1e99c69
fix(npm): support version ranges with && or comma (#26453) 2024-10-25 02:09:35 +02:00
David Sherret
21a5d1559a
fix(install): better json editing (#26450)
1. Respects the formatting of the file (ex. keeps four space indents or
tabs).
2. Handles editing of comments.
3. Handles trailing commas.
4. Code is easier to maintain.
2024-10-25 02:09:34 +02:00
Nayeem Rahman
7703f4bf5a
feat(lsp): interactive inlay hints (#26382) 2024-10-25 02:09:34 +02:00
jiang1997
9623219604
fix(ext/node): use primordials in ext/node/polyfills/https.ts (#26323)
Towards https://github.com/denoland/deno/issues/24236
2024-10-25 02:09:34 +02:00
Leo Kettmeir
b21fe64093
chore: update nix crate (#26422)
Dedupes nix dependency, since `rustyline` depends on a newer version
that what we currently use
2024-10-25 02:09:34 +02:00
Bartek Iwańczuk
fc098332fa
chore: update release doc template (#26406) 2024-10-25 02:09:34 +02:00
Divy Srivastava
11b3bccf30
perf: avoid multiple calls to runMicrotask (#26378)
Improves HTTP throughput by 8-9k rps on Linux:

this patch
```
Requests/sec: 145001.69
Transfer/sec:     20.74MB
```

main
```
Requests/sec: 137866.61
Transfer/sec:     19.72MB
```

The improvements comes from the reduced number of calls to
`op_run_microtask` per request. Returning `true` from a macrotask
callback already calls `op_run_microtask` so the extra call was
redundant.

Here's `--strace-ops` output for a single request:

main
```
[     4.667] op_http_wait                                       : CompletedAsync Async
[     4.667] op_run_microtasks                                  : Dispatched Slow
[     4.668] op_http_try_wait                                   : Dispatched Slow
[     4.668] op_http_try_wait                                   : Completed Slow
[     4.668] op_http_wait                                       : Dispatched Async
[     4.668] op_http_set_response_header                        : Dispatched Slow
[     4.668] op_http_set_response_header                        : Completed Slow
[     4.669] op_http_set_response_body_text                     : Dispatched Slow
[     4.669] op_http_set_response_body_text                     : Completed Slow
[     4.669] op_run_microtasks                                  : Completed Slow
[     4.669] op_has_tick_scheduled                              : Dispatched Slow
[     4.669] op_has_tick_scheduled                              : Completed Slow
[     4.669] op_run_microtasks                                  : Dispatched Slow
[     4.669] op_run_microtasks                                  : Completed Slow
[     4.669] op_run_microtasks                                  : Dispatched Slow
[     4.669] op_run_microtasks                                  : Completed Slow
```

this pr
```
[     3.726] op_http_wait                                       : CompletedAsync Async
[     3.727] op_run_microtasks                                  : Dispatched Slow
[     3.727] op_http_try_wait                                   : Dispatched Slow
[     3.727] op_http_try_wait                                   : Completed Slow
[     3.727] op_http_wait                                       : Dispatched Async
[     3.727] op_http_set_response_header                        : Dispatched Slow
[     3.728] op_http_set_response_header                        : Completed Slow
[     3.728] op_http_set_response_body_text                     : Dispatched Slow
[     3.728] op_http_set_response_body_text                     : Completed Slow
[     3.728] op_run_microtasks                                  : Completed Slow
[     3.728] op_run_microtasks                                  : Dispatched Slow
[     3.728] op_run_microtasks                                  : Completed Slow
```
2024-10-25 02:09:34 +02:00
Leo Kettmeir
2319d8a79f
refactor(ext/webgpu): use concrete error type (#26198) 2024-10-25 02:09:33 +02:00
Leo Kettmeir
6fdfd02f8f
refactor(ext/fetch): use concrete error types (#26220) 2024-10-25 02:09:33 +02:00
Bartek Iwańczuk
8c16208fc3
Revert "ci: use self-hosted mac arm runner (#26366)" (#26408)
This reverts commit e22d0e91ef.

Reverting because the CI pipeline is actually incorrect.

I intended to only use this self-hosted runner for "release" builds on
`main` branch, but now all PRs are queued waiting for a runner for a "debug"
build.
2024-10-25 02:09:33 +02:00
Leo Kettmeir
9f4aadacb2
refactor(ext/http): use concrete error types (#26377) 2024-10-25 02:09:33 +02:00
Leo Kettmeir
1bc3694e79
refactor(ext/crypto): use concrete error types (#26167) 2024-10-25 02:09:33 +02:00
Bartek Iwańczuk
ecf4cb35e6
ci: use self-hosted mac arm runner (#26366)
Supersedes #26337
2024-10-25 02:09:33 +02:00
Nathan Whitaker
8f51b0e82f
fix(ext/node): stub HTTPParser internal binding (#26401)
Fixes https://github.com/denoland/deno/issues/26394.
2024-10-25 02:09:32 +02:00
Marvin Hagemeister
25c857c822
fix(info): resolve workspace member mappings (#26350)
This PR fixes the issue where mapped specifiers in a workspace member
would never be found. Only mapped paths from the workspace root would
resolve.

This was caused by always passing the workspace root url to the import
map resolver instead of the workspace member one.

Fixes https://github.com/denoland/deno/issues/26138
Fixes https://github.com/denoland/fresh/issues/2615

---------

Signed-off-by: Marvin Hagemeister <marvinhagemeister50@gmail.com>
Co-authored-by: David Sherret <dsherret@users.noreply.github.com>
2024-10-25 02:09:32 +02:00
Leo Kettmeir
998a371f5d
refactor(ext/websocket): use concrete error type (#26226) 2024-10-25 02:09:32 +02:00
Marvin Hagemeister
374049b1eb
fix(npm): ensure scoped package name is encoded in URLs (#26390)
Fixes https://github.com/denoland/deno/issues/26385
2024-10-25 02:09:32 +02:00
Nathan Whitaker
2df27b99c3
fix(ext/node): properly map reparse point error in readlink (#26375) 2024-10-25 02:09:32 +02:00
Leo Kettmeir
ed1b2db88b
refactor(ext/fs): use concrete error types (#26317) 2024-10-25 02:09:32 +02:00
Marvin Hagemeister
33aedc9de3
fix(help): missing package specifier (#26380)
Was notified of one more occurance where we were missing an explicit
specifier for a `deno add` call.

See
https://github.com/denoland/deno/issues/26295#issuecomment-2421637401
2024-10-25 02:09:31 +02:00
denobot
22a79ea420
2.0.2 (#26374)
Bumped versions for 2.0.2

Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-10-18 01:28:36 +02:00
Bartek Iwańczuk
0db05b83c7
fix(ext/node): add null check for kStreamBaseField (#26368)
It's not guaranteed that `kStreamBaseField` is not undefined, so
added a check for it.

Closes https://github.com/denoland/deno/issues/26363
2024-10-18 01:05:03 +02:00
Bartek Iwańczuk
d1be72b597
fix(jupyter): fix panics for overslow subtraction (#26371)
I don't have a reliable reproduction for it, but it makes it
painful to use the Jupyter kernel with semi-frequent random panics.

The completions don't always work correctly anyway, so I think
it's better to just not panic here for the time being.

Fixes https://github.com/denoland/deno/issues/26340
2024-10-18 01:05:03 +02:00
Nathan Whitaker
2c0cc4e578
fix(install): don't attempt to cache specifiers that point to directories (#26369)
Fixes https://github.com/denoland/deno/issues/26162
2024-10-18 01:05:03 +02:00
Nathan Whitaker
c6492f6ac6
chore: fix flaky COPYFILE_EXCL test (#26370)
It was missing an await
2024-10-18 01:05:03 +02:00
Leo Kettmeir
ca6d293b71
refactor(ext/napi): use concrete error types (#26186) 2024-10-18 01:05:02 +02:00
Nathan Whitaker
1919181b31
fix(node/fs): copyFile with COPYFILE_EXCL should not throw if the destination doesn't exist (#26360)
Fixes #26313.

We were checking for the NotFound error, but still calling the callback
with the error / throwing.
2024-10-18 01:05:02 +02:00
Leo Kettmeir
f0223a7336
refactor(ext/web): use concrete error types (#26185) 2024-10-18 01:05:02 +02:00
Lucas Nogueira
1aa52fad06
feat(permissions): expose PromptResponse (#26358)
follow-up for #26327
2024-10-18 01:05:02 +02:00
Leo Kettmeir
3b51c2b195
refactor(ext/kv): use concrete error type (#26239) 2024-10-18 01:05:02 +02:00
Leo Kettmeir
1da0ee2d14
refactor(ext/net): use concrete error type (#26227) 2024-10-18 01:05:02 +02:00
Lucas Nogueira
ee35b9d28e
feat(permissions): expose PermissionPrompter and set_prompter function (#26327)
when defining a custom runtime, it might be useful to define a custom
prompter - for instance when you are not relying on the terminal and
want a GUI prompter instead
2024-10-18 01:05:02 +02:00
Luca Casonato
194c453a27
fix(runtime): send ws ping frames from inspector server (#26352)
Every 30 seconds the websocket server will now send a ping frame, so
that the TCP socket stays alive.
2024-10-18 01:04:30 +02:00
Jeremy Tuloup
6c74bcff8f
fix(jupyter): update to the new logo (#26353)
Follow-up to #26084 

Update to the new logo found here:
https://github.com/denoland/docs/blob/main/static/img/logo.svg
2024-10-18 01:04:30 +02:00
Patrick Uftring
f4eb0de669
refactor: use macros for signal table (#26214) 2024-10-18 01:04:30 +02:00
LongYinan
30e085cd77
fix(cli): set napi object property properly (#26344)
<!--
Before submitting a PR, please read
https://docs.deno.com/runtime/manual/references/contributing

1. Give the PR a descriptive title.

  Examples of good title:
    - fix(std/http): Fix race condition in server
    - docs(console): Update docstrings
    - feat(doc): Handle nested reexports

  Examples of bad title:
    - fix #7123
    - update docs
    - fix bugs

2. Ensure there is a related issue and it is referenced in the PR text.
3. Ensure there are tests that cover the changes.
4. Ensure `cargo test` passes.
5. Ensure `./tools/format.js` passes without changing files.
6. Ensure `./tools/lint.js` passes.
7. Open as a draft PR if your work is still in progress. The CI won't
run
   all steps, but you can add '[ci]' to a commit message to force it to.
8. If you would like to run the benchmarks on the CI, add the 'ci-bench'
label.
-->
2024-10-18 01:04:30 +02:00
Nathan Whitaker
2a5f26b075
fix(net): don't try to set nodelay on upgrade streams (#26342)
Fixes https://github.com/denoland/deno/issues/26341.

We try to call `op_set_nodelay` on an `UpgradeStream`, which doesn't
support that operation.
2024-10-18 01:04:30 +02:00
Nathan Whitaker
d039f3fbb2
fix: don't warn on ignored signals on windows (#26332)
Closes #26183.

The warnings are super noisy and not actionable for the user
2024-10-18 01:04:30 +02:00