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

2250 commits

Author SHA1 Message Date
Yusuke Tanaka
9b4026563c
feat(ext/kv): configurable limit params (#25174)
This commit makes various limit parameters in `deno_kv` configurable.

Currently these values are declared as constants and thus can't be
modified from outside. However, there may be situations where we want to
change it. This commit makes this possible by introducing a new struct
`KvConfig` that needs to be given as the 2nd param in `init_ops`.
2024-08-27 00:30:19 -07:00
David Sherret
d8dfe6dc97
perf(ext/node): reduce some allocations in require (#25197) 2024-08-26 11:13:39 -04:00
Luca Casonato
e53678fd58
Revert "feat(fetch): accept async iterables for body" (#25207)
Unfortunately this caused a regression:
https://github.com/denoland/deno/issues/25203.

Need to do some more upstream spec work to fix this before this can be
re-landed.

Reverts denoland/deno#24623
2024-08-26 12:24:27 +02:00
Marvin Hagemeister
1dad29aa04
fix(node/cluster): improve stubs to make log4js work (#25146)
- Add missing exports to `node:cluster`
- Fix default export not being an instance of `EventEmitter`
- Fix aliasing of properties
- Fix `disconnected` -> `disconnect` export naming

This makes `log4js` work in Deno. `karma` starts too, but somehow the
server isn't responding. That looks like a different issue.

Fixes https://github.com/denoland/deno/issues/24858
2024-08-26 11:19:58 +02:00
cions
aebe8947ae
fix(ext/webgpu): allow to build on unsupported platforms (#25202) 2024-08-25 19:29:11 +05:30
Yusuke Tanaka
b0ea6e0dc7
chore(ext/node): use array instead of Vec to avoid wrong capacity allocation (#25183)
This commit gets deno_node's customizer to use fixed-length array
instead of `Vec` to avoid wrong capacity allocation.

In the previous code we reserve a capacity of 14 for
`external_references`. However, after pushing all the necessary
`ExternalReference`s, it ends up with a length of 21, not 14. This means
another allocation happens even though we reserve some space.

To make sure that there will no longer be extra allocation, it should be
a good idea to use fixed-length array here.
2024-08-23 17:41:49 -07:00
Divy Srivastava
38bc4021e6
fix(ext/crypto): throw DataError for invalid EC key import (#25181)
Fixes https://github.com/denoland/deno/issues/20931
2024-08-23 22:06:40 +05:30
Divy Srivastava
d9a7b30d1f
fix(ext/node): import JWK octet key pairs (#25180)
Ref https://github.com/denoland/deno/issues/24129

`kty: "okp"` is defined in
[rfc8037](https://www.rfc-editor.org/rfc/rfc8037.html)
2024-08-23 22:06:28 +05:30
Yusuke Tanaka
86a42c8114
chore(ext/node): bump minimum required version of dsa to 0.6.3 (#25154)
This commit bumps the minimum required version of `dsa` crate to 0.6.3.
This is preferable because `SigningKey::sign_prehashed_rfc6979` function
we use in `deno_node` is available from this version.

Ref: [dsa's CHANGELOG.md](132b046314/dsa/CHANGELOG.md (063-2024-01-28))
2024-08-22 18:19:20 -07:00
David Sherret
ef1294e4e5
refactor: remove unused AllowAllNodePermissions (#25159) 2024-08-22 18:54:03 +00:00
David Sherret
641b52bac7
chore(build): deno_kv - remove dep on deno_node (#25158)
This will help with build perf a bit.
2024-08-22 14:45:20 -04:00
denobot
716ae4d8cb
chore: forward v1.46.1 release commit to main (#25155) 2024-08-22 10:44:53 -07:00
Leo Kettmeir
9bc7de9b13
fix(urlpattern): fallback to empty string for undefined group values (#25151)
This change was introduced in #24741, but due to the change in
behaviour, we will revert it and re-introduce it in 2.0
2024-08-22 05:44:09 -07:00
Caleb Lloyd
79c7db3952
fix(ext/node): http2session ready state (#25143)
Fixes #25142

Signed-off-by: Caleb Lloyd <caleblloyd@gmail.com>
2024-08-22 17:50:17 +05:30
Divy Srivastava
2531204a34
fix(ext/node): register node:wasi built-in (#25134)
Fixes https://github.com/denoland/deno/issues/23531
2024-08-22 09:03:52 +05:30
denobot
3314a0ceb8
1.46.0 (#25139)
Bumped versions for 1.46.0

Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-08-22 02:16:45 +02:00
Bartek Iwańczuk
777e7eaa81
feat: Upgrade V8 to 12.9 (#25138) 2024-08-21 22:33:21 +00:00
Divy Srivastava
9aaad3064a
fix(ext/websocket): unhandled close rejection in WebsocketStream (#25125)
Fixes https://github.com/denoland/deno/issues/25077
2024-08-21 23:00:23 +02:00
Satya Rohith
e920835417
fix(ext/node): pass content-disposition header as string instead of bytes (#25128)
Closes https://github.com/denoland/deno/issues/25117
2024-08-21 10:13:17 +00:00
seb
a3a54bc747
fix(ext/net): validate port in Deno.{connect,serve,listen} (#24399)
Co-authored-by: Will Leach <4619280+melbourne2991@users.noreply.github.com>
Co-authored-by: Luca Casonato <hello@lcas.dev>
Co-authored-by: David Sherret <dsherret@gmail.com>
2024-08-20 21:25:41 +00:00
David Sherret
a7c002ae63
chore: enable no-console dlint rule (#25113) 2024-08-20 15:14:37 -04:00
Nathan Whitaker
2f47b4d1fd
chore: Remove stray console.error log in node:child_process (#25111)
Missed removing it before committing
2024-08-20 19:07:11 +00:00
Yazan AbdAl-Rahman
4f49f703c1
fix(cli): update permission prompt message for compiled binaries (#24081)
Co-authored-by: David Sherret <dsherret@gmail.com>
2024-08-20 01:20:06 +00:00
Bedis Nbiba
ee2b6899a1
fix: add permission name when accessing a special file errors (#25085) 2024-08-19 17:45:10 +00:00
Marvin Hagemeister
48701c19f8
fix(node/tty): fix tty.WriteStream.hasColor with different args (#25094)
The check in `tty.WriteStream.prototype.hasColors()` was incorrect
leading to the
[`yoctocolors`](https://github.com/sindresorhus/yoctocolors) package not
printing any colors.

Fixes https://github.com/denoland/deno/issues/24407
2024-08-19 17:13:09 +02:00
snek
c0aa68a1e2
feat: upgrade deno_core (#25042)
- Update ffi turbocall to use revised fast call api
- Remove `v8_version` function calls
- `*mut OwnedIsolate` is no longer stored in OpCtx gotham store
2024-08-19 14:51:16 +00:00
Marvin Hagemeister
558d2a098b
fix(node/http): wrong req.url value (#25081)
This PR addresses a regression introduced in
https://github.com/denoland/deno/pull/25021 that would cause the
`req.url` parameter in Node's http server to always be a single
character instead of the expected value. The regression was caused by
effectively calling `.indexOf()` on an empty string and thus passing the
wrong index for slicing.

```js
"".indexOf("/") // -> -1
request.url.slice(-1) // effectively only giving us the last character
```

Fixes https://github.com/denoland/deno/issues/25080
2024-08-18 15:37:39 +00:00
Yoshiya Hinosawa
b6cdb31c05
fix(ext/node): fix prismjs compatibiliy in Web Worker (#25062)
PrismJS uses `WorkerGlobalScope` and `self` for detecting browser's Web
Worker context:
59e5a34713/prism.js (L11)

Now the detection logic above is broken when it's imported from Deno's
Web Worker context because we only hide `self` (Prism assumes when
`WorkerGlobalScope` is available, `self` is also available).

This change fixes the above by also hiding `WorkerGlobalScope` global in
Node compat mode.

closes #25008
2024-08-17 11:16:43 +09:00
Nathan Whitaker
ff4226a3cd
fix(node/fs): Use correct offset and length in node:fs.read and write (#25049)
My fix in #25030 was buggy, I forgot to pass the `byteOffset` and
`byteLength`. Whoops.

I also discovered that fs.read was not respecting the `offset` argument,
and we were constructing a new `Buffer` for the callback instead of just
passing the original one (which is what node does, and the @types/node
definitions also indicate the callback should get the same type).
Fixes #25028.
2024-08-16 09:48:57 -07:00
Nathan Whitaker
8749d651fb
fix(node): Create additional pipes for child processes (#25016)
Linux/macos only currently.

Part of https://github.com/denoland/deno/issues/23524 (fixes it on
platforms other than windows).
Part of #16899  (fixes it on platforms other than windows).

After this PR, playwright is functional on mac/linux.
2024-08-15 09:38:46 -07:00
Nathan Whitaker
e92a05b551
feat(serve): Opt-in parallelism for deno serve (#24920)
Adds a `parallel` flag to `deno serve`. When present, we spawn multiple
workers to parallelize serving requests.


```bash
deno serve --parallel main.ts
```

Currently on linux we use `SO_REUSEPORT` and rely on the fact that the
kernel will distribute connections in a round-robin manner.

On mac and windows, we sort of emulate this by cloning the underlying
file descriptor and passing a handle to each worker. The connections
will not be guaranteed to be fairly distributed (and in practice almost
certainly won't be), but the distribution is still spread enough to
provide a significant performance increase.

---
(Run on an Macbook Pro with an M3 Max, serving `deno.com`

baseline::
```
❯ wrk -d 30s -c 125 --latency http://127.0.0.1:8000
Running 30s test @ http://127.0.0.1:8000
  2 threads and 125 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   239.78ms   13.56ms 330.54ms   79.12%
    Req/Sec   258.58     35.56   360.00     70.64%
  Latency Distribution
     50%  236.72ms
     75%  248.46ms
     90%  256.84ms
     99%  268.23ms
  15458 requests in 30.02s, 2.47GB read
Requests/sec:    514.89
Transfer/sec:     84.33MB
```

this PR (`with --parallel` flag)
```
❯ wrk -d 30s -c 125 --latency http://127.0.0.1:8000
Running 30s test @ http://127.0.0.1:8000
  2 threads and 125 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   117.40ms  142.84ms 590.45ms   79.07%
    Req/Sec     1.33k   175.19     1.77k    69.00%
  Latency Distribution
     50%   22.34ms
     75%  223.67ms
     90%  357.32ms
     99%  460.50ms
  79636 requests in 30.07s, 12.74GB read
Requests/sec:   2647.96
Transfer/sec:    433.71MB
```
2024-08-14 22:26:21 +00:00
Sean McArthur
875ee618d3
feat(ext/node): support http2session.socket (#24786)
Co-authored-by: Satya Rohith <me@satyarohith.com>
2024-08-14 21:59:22 +00:00
Nathan Whitaker
1f2d48cd97
fix(node/fs): node:fs.read and write should accept typed arrays other than Uint8Array (#25030)
Part of #25028.

Our underlying read/write operations in `io` assume the buffer is a
Uint8Array, but we were passing in other typed arrays (in the case above
it was `Int8Array`).
2024-08-14 09:42:31 -07:00
Marvin Hagemeister
c765d9ad2f
fix(node/inspector): Session constructor should not throw (#25041)
There is no constructor code when creating an inspector `Session`
instance in Node. Also get rid of some symbols which should've been
private properties. This PR doesn't yet add any new implementations
though as these are mostly cosmetic changes.
2024-08-14 13:34:24 +00:00
Marvin Hagemeister
533d31bc4e
fix: node:inspector not being registered (#25007)
For some reason we didn't register the `node:inspector` module, which
lead to a panic when trying to import it. This PR registers it.

Related: https://github.com/denoland/deno/issues/25004
2024-08-14 12:33:42 +00:00
Luca Casonato
2f82873a88
fix(ext/node): don't throw when calling PerformanceObserver.observe (#25036) 2024-08-14 13:03:53 +02:00
snek
fd1f8234f4
fix: dd-trace http message compat (#25021)
make this http incoming constructor match with node, and also handle
arbitrary duplex inputs
2024-08-14 09:19:59 +02:00
Kenta Moriuchi
76f4f202e7
chore: update the copyright of c, mjs, and jsx (#25005) 2024-08-12 12:41:32 -04:00
Luca Casonato
56e8ed5eb1
fix(ext/node): don't concat set-cookie in ServerResponse.appendHeader (#25000)
Follow-on to
https://github.com/denoland/deno/pull/24216/files#r1642188672
2024-08-12 12:01:37 +02:00
Divy Srivastava
b61fd622a5
fix(ext/node): rewrite X509Certificate resource and add publicKey() (#24988)
**Changes**:
- Remove unsafe usage, rewrite Rust representation with `yoke`.
- Implement `X509Certificate.prototype.publicKey()`

Fixes https://github.com/denoland/deno/issues/23307
2024-08-11 18:58:54 +05:30
Divy Srivastava
d6f662ac82
fix(ext/node): support ieee-p1363 ECDSA signatures and pss salt len (#24981)
Fixes https://github.com/denoland/deno/issues/22919
2024-08-11 14:59:53 +05:30
Divy Srivastava
feba133711
fix(ext/node): createBrotliCompress params (#24984)
Fixes https://github.com/denoland/deno/issues/24416
2024-08-11 14:26:30 +05:30
Luca Casonato
4dc8fe2020
fix(ext/node): use pem private keys in createPublicKey (#24969) 2024-08-09 13:39:46 +00:00
Marvin Hagemeister
f474c4f4ff
fix: stub node:module.register() (#24965)
This is commonly used to register loading non standard file types. But
some libs also register TS loaders which Deno supports natively, like
the npm `payload` package. This PR unblocks those.

Fixes https://github.com/denoland/deno/issues/24902
2024-08-09 14:25:33 +02:00
Luca Casonato
fc02303842
fix(ext/node): ed25519 signing and cipheriv autopadding fixes (#24957)
- Return auth tag for GCM ciphers from auto padding shortcircuit
- Use _ring_ for ed25519 signing

---------

Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2024-08-09 12:58:20 +02:00
snek
33b2eec793
chore: make node:http.OutgoingMessage a function (#24853)
For dd-trace tests to succeed, `OutgoingMessage` should be a function
instead of a class.
2024-08-09 09:34:30 +02:00
Yusuke Tanaka
e36b1a3aa8
fix(ext/fetch): include TCP src/dst socket info in error messages (#24939)
This commit makes `fetch` error messages include source and destination TCP
socket info i.e. port number and IP address for better debuggability.

Closes #24922
2024-08-08 08:47:15 -07:00
Divy Srivastava
0d1beed2e3
fix(ext/node): add CipherIv.setAutoPadding() (#24940)
Co-Authored-By: Luca Casonato <hello@lcas.dev>

Fixes https://github.com/denoland/deno/issues/21804
Ref https://github.com/denoland/deno/issues/20924

---------

Signed-off-by: Divy Srivastava <dj.srivastava23@gmail.com>
Co-authored-by: Luca Casonato <hello@lcas.dev>
2024-08-08 18:34:10 +05:30
Marvin Hagemeister
f50d38869d
fix(node/util): add missing debug alias of debuglog (#24944)
Add the missing `node:util.debug` export which is an alias of
`node:util.debuglog`, see
https://nodejs.org/api/util.html#utildebugsection
2024-08-08 13:52:14 +02:00
Satya Rohith
65224786d2
fix(ext/node): client closing streaming request shouldn't terminate http server (#24946)
Closes https://github.com/denoland/deno/issues/22820
2024-08-08 10:22:58 +00:00