1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-22 15:06:54 -05:00
Commit graph

2461 commits

Author SHA1 Message Date
Yoshiya Hinosawa
36b7f9d9ed
Revert "fix(ext/node): fix dns.lookup result ordering (#26264)" (#26621)
This reverts commit d59599fc18.

Closes #26588
2024-10-30 00:16:13 +01:00
Volker Schlecht
6f6879327c
fix(ext/napi): export dynamic symbols list for {Free,Open}BSD (#26605)
The two BSD ports are reusing the Linux code here.
2024-10-30 00:16:13 +01:00
Volker Schlecht
99febad5e2
fix(ext/node): compatibility with {Free,Open}BSD (#26604)
Ports for both BSDs contain patches to the same effect.
See
https://github.com/freebsd/freebsd-ports/blob/main/www/deno/files/patch-ext_node_ops_fs.rs
and
8644910cae/lang/deno/patches/patch-ext_node_ops_fs_rs
2024-10-30 00:16:12 +01:00
Bartek Iwańczuk
a2dacc7686
Revert "fix(ext/node): use primordials in ext/node/polyfills/https.ts (#26323)" (#26613)
…s` (#26323)"

This reverts commit afb33b3c25.

Reverting because it caused a regression -
https://github.com/denoland/deno/issues/26612.

Closes https://github.com/denoland/deno/issues/26612.
2024-10-30 00:16:12 +01:00
snek
96e931a721
fix: report exceptions from nextTick (#26579)
Fixes: https://github.com/denoland/deno/issues/24713
Fixes: https://github.com/denoland/deno/issues/25855
2024-10-30 00:16:12 +01:00
familyboat
56ecc26b71
fix(ext/node): add path to fs.stat and fs.statSync error (#26037) 2024-10-30 00:16:11 +01:00
Mayank Kumar
16f3c31c97
fix(ext/node): use primordials in ext\node\polyfills\internal\crypto\_randomInt.ts (#26534)
Towards #24236
2024-10-30 00:15:38 +01:00
Bartek Iwańczuk
571751b00d
build: use 'fs' feature of 'nix' crate in ext/fs (#26533)
Hot-fix to unblock `v2.0.3` release
2024-10-25 12:53:54 +02:00
denobot
997bd47fc2
2.0.3 (#26532)
Bumped versions for 2.0.3

---------

Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-10-25 02:57:52 +02:00
Nicola Bovolato
6c415bf819
fix(ext/node): refactor http.ServerResponse into function class (#26210)
While testing, I found out that light-my-request relies on
`ServerResponse.connection`, which is deprecated, so I added that and
`socket`, the non deprecated property.

It also relies on an undocumented `_header` property, apparently for
[raw header
processing](https://github.com/fastify/light-my-request/blob/v6.1.0/lib/response.js#L180-L186).
I added it as an empty string, feel free to provide other approaches.

Fixes #19901

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-10-25 02:09:39 +02:00
Leo Kettmeir
f62283f0c4
refactor(ext/node): use concrete error types (#26419) 2024-10-25 02:09:38 +02:00
Marvin Hagemeister
01c2bb9c9d
fix(node/util): support array formats in styleText (#26507)
We missed adding support for an array of formats being passed to
`util.styleText`.

Fixes https://github.com/denoland/deno/issues/26496
2024-10-25 02:09:38 +02:00
snek
e1c893fab8
feat: support node-api in denort (#26389)
exposes node-api symbols in denort so that `deno compile` can run native
addons.
2024-10-25 02:09:38 +02:00
Nathan Whitaker
c9c972dfb4
fix(ext/node): cancel pending ipc writes on channel close (#26504)
Fixes the issue described in
https://github.com/denoland/deno/issues/23882#issuecomment-2423316362.

The parent was starting to send a message right before the process would
exit, and the channel closed in the middle of the write. Unlike with
reads, we weren't cancelling the pending writes, which resulted in a
`Broken pipe` error surfacing to the user.
2024-10-25 02:09:37 +02:00
Nathan Whitaker
2ea51d923a
fix(ext/node): only set our end of child process pipe to nonblocking mode (#26495)
Fixes playwright on linux, as reported in
https://github.com/denoland/deno/issues/16899#issuecomment-2378268454.

The issue was that we were opening the socket in nonblocking mode, which
meant that subprocesses trying to use it would get a `EWOULDBLOCK` error
(unexpectedly). The fix here is to only set nonblocking mode on our end
(which we need to use asynchronously)
2024-10-25 02:09:37 +02:00
Divy Srivastava
bb3c8e2925
fix(ext/ffi): return u64/i64 as bigints from nonblocking ffi calls (#26486)
Fixes https://github.com/denoland/deno/issues/25194
2024-10-25 02:09:37 +02:00
Satya Rohith
c5536669b6
fix(node:tls): set TLSSocket.alpnProtocol for client connections (#26476)
Towards https://github.com/denoland/deno/issues/26127
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
Leo Kettmeir
ad563c3098
fix(ext/console): ignore casing for named colors in css parsing (#26466) 2024-10-25 02:09:35 +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
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
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
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
Leo Kettmeir
998a371f5d
refactor(ext/websocket): use concrete error type (#26226) 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
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
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
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
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
Nathan Whitaker
c593024a56
fix(node/http): normalize header names in ServerResponse (#26339)
Fixes https://github.com/denoland/deno/issues/26115.

We weren't normalizing the headers to lower case, so code that attempted
to delete the `Content-Length` header (but used a different case) wasn't
actually removing the header.
2024-10-18 01:04:29 +02:00
denobot
99c2aa5730
2.0.1 (#26335)
Bumped versions for 2.0.1

Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-10-17 00:42:35 +02:00
Nathan Whitaker
f7dba52133
fix(child_process): map node --no-warnings flag to --quiet (#26288)
Closes https://github.com/denoland/deno/issues/25899
2024-10-16 18:25:25 +00:00
Yoshiya Hinosawa
d59599fc18
fix(ext/node): fix dns.lookup result ordering (#26264)
partially unblocks #25470

This PR aligns the resolution of `localhost` hostname to Node.js
behavior.

In Node.js `dns.lookup("localhost", (_, addr) => console.log(addr))`
prints ipv6 address `::1`, but it prints ipv4 address `127.0.0.1` in
Deno. That difference causes some errors in the work of enabling
`createConnection` option in `http.request` (#25470). This PR fixes the
issue by aligning `dns.lookup` behavior to Node.js.

This PR also changes the following behaviors (resolving TODOs):
- `http.createServer` now listens on ipv6 address `[::]` by default on
linux/mac
- `net.createServer` now listens on ipv6 address `[::]` by default on
linux/mac

These changes are also alignments to Node.js behaviors.
2024-10-16 20:58:44 +09:00
Divy Srivastava
21fa953f32
fix(ext/node): timingSafeEqual account for AB byteOffset (#26292)
Fixes https://github.com/denoland/deno/issues/26276
2024-10-16 14:27:28 +05:30
David Sherret
661882f10d
perf(http): make heap allocation for path conditional (#26289)
Code:

```js
Deno.serve({ port: 8085 }, request => {
  return new Response(request.url);
});
```

Before:

```
% wrk -d60s http://localhost:8085/path/testing\?testing=5
Running 1m test @ http://localhost:8085/path/testing?testing=5
  2 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    56.01us   18.34us   3.28ms   93.84%
    Req/Sec    81.80k     3.13k   88.26k    90.77%
  9783713 requests in 1.00m, 1.67GB read
Requests/sec: 162789.89
Transfer/sec:     28.41MB
```

After:

```
% wrk -d60s http://localhost:8085/path/testing\?testing=5
Running 1m test @ http://localhost:8085/path/testing?testing=5
  2 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    55.44us   15.20us   2.42ms   90.41%
    Req/Sec    82.71k     2.92k   88.10k    89.93%
  9892916 requests in 1.00m, 1.69GB read
Requests/sec: 164607.06
Transfer/sec:     28.73MB
```
2024-10-16 00:43:20 -04:00
Leo Kettmeir
82d13fd45b
refactor(ext/io): use concrete error types (#26187) 2024-10-15 15:36:11 -07:00
Leo Kettmeir
3065dadea3
fix(ext/console): apply coloring for console.table (#26280)
Fixes #26159
2024-10-15 21:36:45 +00:00
Kenta Moriuchi
7211028f1e
fix(ext/node): use primordials in ext/node/polyfills/internal/buffer.mjs (#24993)
Towards #24236
2024-10-15 20:32:27 +02:00
Toby Ealden
c5a7f98d82
fix(ext/node): handle http2 server ending stream (#26235)
Closes #24845
2024-10-15 23:35:10 +05:30
Divy Srivastava
c7153838ec
fix(ext/node): implement TCP.setNoDelay (#26263)
Fixes https://github.com/denoland/deno/issues/26177

The significant delay was caused by Nagel's algorithm + delayed ACKs in
Linux kernels. Here's the [kernel
patch](https://lwn.net/Articles/502585/) which added 40ms
`tcp_default_delack_min`

```
$ deno run -A pg-bench.mjs # main
Tue Oct 15 2024 12:27:22 GMT+0530 (India Standard Time): 42ms

$ target/release/deno run -A pg-bench.mjs # this patch
Tue Oct 15 2024 12:28:02 GMT+0530 (India Standard Time): 1ms
```

```js
import { Buffer } from "node:buffer";

import pg from 'pg'
const { Client } = pg
const client = new Client({
    connectionString: 'postgresql://postgres:postgres@127.0.0.1:5432/postgres'
})
await client.connect()

async function fetch() {
    const startPerf = performance.now();
    const res = await client.query(`select
        $1::int as int,
        $2 as string,
        $3::timestamp with time zone as timestamp,
        $4 as null,
        $5::bool as boolean,
        $6::bytea as bytea,
        $7::jsonb as json
      `, [
        1337,
        'wat',
        new Date().toISOString(),
        null,
        false,
        Buffer.from('awesome'),
        JSON.stringify([{ some: 'json' }, { array: 'object' }])
    ])
    console.log(`${new Date()}: ${Math.round(performance.now() - startPerf)}ms`)
}

for(;;) await fetch();
```
2024-10-15 14:47:12 +05:30