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

12008 commits

Author SHA1 Message Date
i-api
2aad92c30b
fix(cli): shorten examples in help text (#24374) 2024-08-02 13:38:15 +00:00
Luca Casonato
84ff418265
feat(test): rename --allow-none to --permit-no-files (#24809) 2024-08-02 13:18:59 +00:00
Pig Fang
124a13280e
feat(fmt): support YAML (#24717) 2024-08-02 12:12:51 +00:00
Andreas Deininger
ea121c9a0e
docs: fix typos (#24820)
This PR fixes various typos I spotted in the project.
2024-08-02 13:26:54 +02:00
David Sherret
bcdf600ae4
fix(fmt): handle using stmt in for of stmt (#24834)
Closes #24406
2024-08-02 06:29:29 -04:00
David Sherret
2ca9940f00
chore: mark upgrade_invalid_canary_version as flaky (#24833) 2024-08-02 12:28:21 +02:00
Kenta Moriuchi
d2b66e50fd
BREAKING(temporal/unstable): Remove obsoleted Temporal APIs (#24836) 2024-08-02 10:56:14 +02:00
Nathan Whitaker
930ccf928a
perf(ext/http): Reduce size of ResponseBytesInner (#24840)
I noticed
[`set_response_body`](ce42f82b5a/ext/http/service.rs (L439-L443))
was unexpectedly hot in profiles, with most of the time being spent in
`memmove`.

It turns out that `ResponseBytesInner` was _massive_ (5624 bytes), so
every time we moved a `ResponseBytesInner` (for instance in
`set_response_body`) we were doing a >5kb memmove, which adds up pretty
quickly.

This PR boxes the two larger variants (the compression streams),
shrinking `ResponseBytesInner` to a reasonable 48 bytes.

---
  Benchmarked with a simple hello world server:
```ts
// hello-server.ts
Deno.serve((_req) => {
  return new Response("Hello world");
});
// run with `deno run -A hello-server.ts`
// in separate terminal `wrk -d 10s http://127.0.0.1:8000`
```

Main:
```
Running 10s test @ http://127.0.0.1:8000/
  2 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    53.39us    9.53us   0.98ms   92.78%
    Req/Sec    86.57k     3.56k   91.58k    91.09%
  1739319 requests in 10.10s, 248.81MB read
Requests/sec: 172220.92
Transfer/sec:     24.64MB
```

This PR:
```
Running 10s test @ http://127.0.0.1:8000/
  2 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    45.44us    8.49us   0.91ms   90.04%
    Req/Sec   100.65k     2.26k  102.65k    96.53%
  2022296 requests in 10.10s, 289.29MB read
Requests/sec: 200226.20
Transfer/sec:     28.64MB
```

So a nice ~15% bump. (With response body compression, the gain is ~10%
for gzip and neutral for brotli)
2024-08-02 00:30:26 +00:00
Bartek Iwańczuk
5c54dc5840
fix: regressions around Error.prepareStackTrace (#24839)
Includes:
- https://github.com/denoland/deno_core/pull/858
- https://github.com/denoland/deno_core/pull/856

Fixes https://github.com/denoland/deno/issues/24782
Fixes https://github.com/denoland/deno/issues/24825
2024-08-01 22:15:20 +00:00
Hajime-san
ba93278281
fix(ext/webgpu): assign missing constants property of shader about GPUDevice.createRenderPipeline[Async] (#24803)
fixes https://github.com/denoland/deno/issues/24287
2024-08-01 11:19:25 -07:00
Leo Kettmeir
6db5f1bb6e
fix(ext/console): render properties of Intl.Locale (#24827)
Fixes #21271

---------

Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2024-08-01 09:45:05 -07:00
Luca Casonato
4eda9e64e9
fix(ext/http): correctly consume response body in Deno.serve (#24811)
Prior to this commit, you could return a `Response` created from a
string or Uint8Array multiple times.

Now you can't do that anymore.
2024-08-01 15:46:05 +02:00
Ryan Dahl
c79cb339ef
chore: upgrade flaky_test, fastwebsockets, base64, base32, notify (#24746) 2024-08-01 08:35:35 -04:00
Bartek Iwańczuk
8e6b06b89d
fix: Don't panic if failed to add system certificate (#24823)
This commit fixes the panic from
https://github.com/denoland/deno/issues/24137.

I'm not sure if we want to hard error or maybe instead skip with a
warning and continue execution.
2024-08-01 14:33:31 +02:00
Divy Srivastava
9f27bf9144
fix(compile): adhoc codesign mach-o by default (#24824) 2024-08-01 02:11:24 -07:00
Luca Casonato
f1fc708d81
fix(ext/crypto): respect offsets when writing into ab views in randomFillSync (#24816) 2024-08-01 09:38:46 +02:00
Divy Srivastava
5bd76609f7
feat: codesign for deno compile binaries (#24604)
Uses [sui](https://github.com/littledivy/sui) to inject metadata as a
custom section in the denort binary.

Metadata is stored as a Mach-O segment on macOS and PE `RT_RCDATA`
resource on Windows.

Fixes #11154 
Fixes https://github.com/denoland/deno/issues/17753

```cpp
deno compile app.tsx

# on macOS
codesign --sign - ./app

# on Windows
signtool sign /fd SHA256 .\app.exe
```

---------

Signed-off-by: Divy Srivastava <dj.srivastava23@gmail.com>
2024-08-01 09:45:13 +05:30
snek
f57745fe21
feat: upgrade V8 to 12.8 (#24693)
- upgrade to v8 12.8
  - optimizes DataView bigint methods
  - fixes global interceptors
  - includes CPED methods for ALS
- fix global resolution
- makes global resolution consistent using host_defined_options.
originally a separate patch but due to the global interceptor bug it
needs to be included in this pr for all tests to pass.
2024-07-31 23:22:34 +00:00
Sean McArthur
fbcd250bc8
fix(ext/fetch): use correct ALPN to socks5 proxies (#24817)
Closes #24632 
Closes #24719
2024-08-01 00:44:03 +02:00
David Sherret
d3419f7d14
perf: update deno_ast to 0.41 (#24819)
Some perf gains in swc (I measured formatting and it was slightly
faster).

Includes:

* https://github.com/denoland/deno_graph/pull/508
* https://github.com/denoland/eszip/pull/193
2024-07-31 18:31:03 -04:00
denobot
6267905f09
chore: forward v1.45.5 release commit to main (#24818) 2024-07-31 15:14:27 -07:00
Luca Casonato
b153065e44
perf(ext/fetch): speed up resp.clone() (#24812) 2024-07-31 19:57:47 +02:00
Luca Casonato
1faac2dce3
fix(ext/node): handle node child_process with --v8-options flag (#24804)
Makes `v8flags` package from NPM work.
2024-07-31 16:28:08 +02:00
Luca Casonato
f6fad68d7b
fix(ext/webgpu): don't crash while constructing GPUOutOfMemoryError (#24807) 2024-07-31 14:26:54 +02:00
Marvin Hagemeister
9e6288ec61
fix(node/fs/promises): watch should be async iterable (#24805)
The way `fs.watch` works is different in `node:fs/promises` than
`node:fs`. It has a different function signature and it returns an async
iterable instead, see
https://nodejs.org/api/fs.html#fspromiseswatchfilename-options

Fixes https://github.com/denoland/deno/issues/24661
2024-07-31 13:07:49 +02:00
Marvin Hagemeister
1e2581e57b
fix(node/timers/promises): add scheduler APIs (#24802)
This PR adds the experimental `scheduler` APIs in Node's
`timers/promises` module. See
https://nodejs.org/api/timers.html#timerspromisesschedulerwaitdelay-options

Fixes https://github.com/denoland/deno/issues/24800
2024-07-31 12:00:01 +02:00
Nathan Whitaker
cd59fc53a5
fix(node): Rework node:child_process IPC (#24763)
Fixes https://github.com/denoland/deno/issues/24756. Fixes
https://github.com/denoland/deno/issues/24796.

This also gets vitest working when using
[`--pool=forks`](https://vitest.dev/guide/improving-performance#pool)
(which is the default as of vitest 2.0). Ref
https://github.com/denoland/deno/issues/23882.

---

This PR resolves a handful of issues with child_process IPC. In
particular:

- We didn't support sending typed array views over IPC
- Opening an IPC channel resulted in the event loop never exiting
- Sending a `null` over IPC would terminate the channel
- There was some UB in the read implementation (transmuting an `&[u8]`
to `&mut [u8]`)
- The `send` method wasn't returning anything, so there was no way to
signal backpressure (this also resulted in the benchmark
`child_process_ipc.mjs` being misleading, as it tried to respect
backpressure. That gave node much worse results at larger message sizes,
and gave us much worse results at smaller message sizes).
- We weren't setting up the `channel` property on the `process` global
(or on the `ChildProcess` object), and also didn't have a way to
ref/unref the channel
- Calling `kill` multiple times (or disconnecting the channel, then
calling kill) would throw an error
- Node couldn't spawn a deno subprocess and communicate with it over IPC
2024-07-30 16:13:24 -07:00
Nayeem Rahman
3659781f88
feat(lsp): registry completions for import-mapped specifiers (#24792) 2024-07-30 23:26:09 +01:00
David Sherret
fe884c557a
fix(compile/windows): handle cjs re-export of relative path with parent component (#24795)
Closes https://github.com/denoland/deno/issues/24785
2024-07-30 16:46:15 -04:00
David Sherret
7a3810195d
fix(node): support wildcards in package.json imports (#24794) 2024-07-30 17:14:07 +00:00
Divy Srivastava
1ba88a7892
perf(ext/node): improve Buffer from string performance (#24567)
Fixes https://github.com/denoland/deno/issues/24323

- Use a Buffer pool for `fromString`
- Implement fast call base64 writes
- Direct from string `create` method for each encoding op

```
$ deno bench -A bench.mjs # 1.45.1+fee4d3a
cpu: Apple M1 Pro
runtime: deno 1.45.1+fee4d3a (aarch64-apple-darwin)

benchmark                time (avg)             (min … max)       p75       p99      p999
----------------------------------------------------------- -----------------------------
Buffer.from base64      550 ns/iter     (490 ns … 1'265 ns)    572 ns    606 ns  1'265 ns
Buffer#write base64     285 ns/iter       (259 ns … 371 ns)    307 ns    347 ns    360 ns

$ ~/gh/deno/target/release/deno bench -A bench.mjs # this PR
cpu: Apple M1 Pro
runtime: deno dev (aarch64-apple-darwin)

benchmark                time (avg)             (min … max)       p75       p99      p999
----------------------------------------------------------- -----------------------------
Buffer.from base64      151 ns/iter       (145 ns … 770 ns)    148 ns    184 ns    648 ns
Buffer#write base64   62.58 ns/iter     (60.79 ns … 157 ns)  61.65 ns  75.79 ns    141 ns

$ node bench.mjs # v22.4.0
cpu: Apple M1 Pro
runtime: node v22.4.0 (arm64-darwin)

benchmark                time (avg)             (min … max)       p75       p99      p999
----------------------------------------------------------- -----------------------------
Buffer.from base64      163 ns/iter     (96.92 ns … 375 ns)  99.45 ns    127 ns    220 ns
Buffer#write base64   75.48 ns/iter     (74.97 ns … 134 ns)  75.17 ns  81.83 ns  96.84 ns
```
2024-07-30 18:09:55 +05:30
Bartek Iwańczuk
c6ecf70a09
refactor(ext/node): create separate ops for node:http module (#24788)
This commit duplicates ops from "ext/fetch" to "ext/node" to
kick off a bigger rewrite of "node:http".

Most of duplication is temporary and will be removed as these
ops evolve.
2024-07-30 14:34:52 +02:00
Ryan B.
191de7d72b
fix(cli): Unhide publish subcommand help string (#24787)
Fixes #24753

The help text for `deno publish` was marked hidden while in preview.
This is no longer a preview feature.
2024-07-29 18:36:53 -04:00
David Sherret
38a363dc7c
chore: mark upgrade invalid lockfile as flaky (#24760)
Closes #24759
2024-07-29 16:18:25 -04:00
Satya Rohith
8c2f1f5a55
chore: upgrade to rust 1.80 (#24778) 2024-07-29 12:58:04 -04:00
Satya Rohith
8bab761bcc
fix(ext/node): prevent panic in http2.connect with uppercase header names (#24780)
Closes https://github.com/denoland/deno/issues/24678
2024-07-29 13:33:55 +02:00
Kenta Moriuchi
ad5cec27d3
fix(types): fix streams types (#24770) 2024-07-28 23:21:00 -04:00
Yazan AbdAl-Rahman
41f8988dc7
fix(http): Adjust hostname display for Windows when using 0.0.0.0 (#24698)
Fixes #24687

---------

Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2024-07-28 23:04:05 +02:00
David Sherret
50fa4d7ef5
fix: actually add missing node:readline/promises module (#24772)
Closes #24768
2024-07-28 15:41:10 -04:00
Yoshiya Hinosawa
99e811f5eb
test(ext/node): reduce http_test flakiness (#24742) 2024-07-27 22:47:47 +09:00
David Sherret
086fa28348
fix(npmrc): skip loading .npmrc in home dir on permission error (#24758) 2024-07-27 09:04:28 -04:00
David Sherret
9956737941
refactor(lint): move reporters to separate module (#24757) 2024-07-27 09:01:42 -04:00
Kyle Kelley
63f8218a7d
fix: adapt to new jupyter runtime API and include session IDs (#24762)
Closes #24737, #24437.
2024-07-27 10:39:08 +02:00
David Sherret
06b6352292
fix(unstable/compile): handle byonm import in sub dir (#24755)
Regression in 1.45.0 caused by storing relative paths instead of
absolute paths in the binary.

Closes #24654
2024-07-26 15:53:53 -04:00
denobot
ed2bf8ce31
chore: forward v1.45.4 release commit to main (#24754)
Co-authored-by: David Sherret <dsherret@gmail.com>
2024-07-26 14:26:13 -04:00
David Sherret
bee16c54ab
fix(publish): workspace included license file had incorrect path (#24747)
Also fixes the issue where we say a package was successfully published
before it wasn't.

Bug in https://github.com/denoland/deno/pull/24714
2024-07-26 15:35:29 +00:00
Bartek Iwańczuk
7776636c2e
fix: support npm:bindings and npm:callsites packages (#24727)
Adds support for `npm:bindings` and `npm:callsites` packages because of
changes in
https://github.com/denoland/deno_core/pull/838.

This `deno_core` bump causes us to stop prepending `file://` scheme for
locations
in stack traces that are for local files.

Fixes https://github.com/denoland/deno/issues/24462 , fixes
https://github.com/denoland/deno/issues/22671 , fixes
https://github.com/denoland/deno/issues/15717 , fixes
https://github.com/denoland/deno/issues/19130 , fixes
https://github.com/WiseLibs/better-sqlite3/issues/1205 , fixes
https://github.com/WiseLibs/better-sqlite3/issues/1034 , fixes
https://github.com/denoland/deno/issues/20936

---------

Co-authored-by: Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com>
2024-07-26 09:08:15 +02:00
MrEconomical
f4952f75a8
fix(ext/node): read correct CPU usage stats on Linux (#24732)
Fixes #24731

<img width="554" alt="deno_fixed"
src="https://github.com/user-attachments/assets/691f2f89-d979-4ca5-be9a-cf51446cd9b2">

The total CPU usage row is ignored and info from `cpu0` and `cpu1` is
correctly read.

---------

Signed-off-by: MrEconomical <47700125+MrEconomical@users.noreply.github.com>
2024-07-26 09:09:01 +05:30
David Sherret
7907265590
fix(node): cjs pkg dynamically importing esm-only pkg fails (#24730) 2024-07-25 21:40:10 -04:00
Asher Gomez
ef38aa9d9c
chore: fix bench task (#24718)
<!--
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-07-25 23:53:52 +00:00