1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-29 16:30:56 -05:00
Commit graph

9260 commits

Author SHA1 Message Date
David Sherret
4a8ca480ae refactor(ext/fs): deno_fs::FileSystem - conditional Send + Sync (#18993)
This allows for having a conditional `Send + Sync` on the file system trait for Deploy.
2023-05-11 17:26:26 -04:00
Aapo Alasuutari
5826ea5682 perf(ext/ffi): Use Box<[NativeType]> in CallbackInfo parameters (#19032) 2023-05-11 17:26:26 -04:00
Matt Mastracci
5e848f0d1b fix(ext/http): Ensure Deno.serve works across --watch restarts (#18998)
Fixes #16699 and #18960 by ensuring that we release our HTTP
`spawn_local` tasks when the HTTP resource is dropped.

Because our cancel handle was being projected from the resource via
`RcMap`, the resource was never `Drop`ped. By splitting the handle out
into its own `Rc`, we can avoid keeping the resource alive and let it
drop to cancel everything.
2023-05-11 17:26:26 -04:00
ud2
0dbbb34fcc fix(core): always report the first error on unhandled rejection (#18992)
The root cause of denoland/deno_std#3320, I believe, is that
`pending_promise_rejections` is a `HashMap` whose entries are in
arbitrary order, and as a result either of the two errors (`AddrInUse`
and `TypeError`) may be selected when determining which one to report. I
changed the field to a `VecDeque` so that the first error (`AddrInUse`
in this case) is always selected.
2023-05-11 17:26:26 -04:00
Bartek Iwańczuk
bf7d3b76e2 chore: lint ext/fs/std_fs.rs (#19036) 2023-05-11 17:26:26 -04:00
Aapo Alasuutari
6e72ae7a09 fix(ext/ffi): Callbacks panic on returning isize (#19022) 2023-05-11 17:26:26 -04:00
Aapo Alasuutari
1b610bfdad fix(ext/ffi): UnsafeCallback can hang with 'deno test' (#19018) 2023-05-11 17:26:25 -04:00
Bartek Iwańczuk
4c18655477 refactor(core): remove run_in_task helper, use tokio::test macro (#19009) 2023-05-11 17:26:25 -04:00
David Sherret
6ced6c8e85 refactor(ext/node): combine deno_node::Fs with deno_fs::FileSystem (#18991) 2023-05-11 17:26:25 -04:00
David Sherret
59fbdc4a93 refactor(ext/fs): boxed deno_fs::FileSystem (#18945)
1. Boxed `File` and `FileSystem` to allow more easily passing this
through the CLI code (as shown within this pr).
2. `StdFileResource` is now `FileResource`. `FileResource` now contains
an `Rc<dyn File>`.
2023-05-11 17:26:25 -04:00
denobot
c2a61a4192
1.33.2 (#18988)
Bumped versions for 1.33.2

Please ensure:
- [x] Target branch is correct (`vX.XX` if a patch release, `main` if
minor)
- [x] Crate versions are bumped correctly
- [x] deno_std version is incremented in the code (see
`cli/deno_std.rs`)
- [ ] Releases.md is updated correctly (think relevancy and remove
reverts)

To make edits to this PR:
```shell
git fetch upstream release_1_33.2 && git checkout -b release_1_33.2 upstream/release_1_33.2
```

cc @levex

---------

Co-authored-by: levex <levex@users.noreply.github.com>
Co-authored-by: Levente Kurusa <lkurusa@kernelstuff.org>
2023-05-04 16:39:05 +02:00
Bartek Iwańczuk
d59ace37e4
docs: update Deno.Writer docstring (#18987)
Closes
https://github.com/denoland/deno/issues/18985#issuecomment-1534493623
2023-05-04 16:19:39 +02:00
Luca Casonato
22f4385301
refactor(ext/node): remove NodeEnv trait (#18986) 2023-05-04 16:19:37 +02:00
Bartek Iwańczuk
6063bef0c1
fix(npm): canonicalize search directory when looking for package.json (#18981)
Co-authored-by: David Sherret <dsherret@gmail.com>
2023-05-04 16:19:34 +02:00
Nayeem Rahman
979742dee5
fix(core): allow esm extensions not included in snapshot (#18980)
Fixes #18979.

This changes the predicate for allowing `ext:` specifier resolution from
`snapshot_loaded_and_not_snapshotting` to `ext_resolution_allowed` which
is only set to true during the extension module loading phase. Module
loaders as used in core
are now declared as `ExtModuleLoader` rather than `dyn ModuleLoader`.
2023-05-04 16:19:31 +02:00
Nayeem Rahman
434c80bd62
fix(test): disable preventDefault() for beforeunload event (#18911)
Fixes #18910.
2023-05-04 16:19:29 +02:00
Luca Casonato
675aa94d12
fix(ext/kv): throw on the Kv constructor (#18978)
Closes #18963

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-05-04 16:19:27 +02:00
kang
69732aeb6d
fix(docs): replace "e.g." with "i.e." in seek()/seekSync() comment (#18964)
Clarify calculation of number "9" in `seek()`/`seekSync()` comment of
lib.deno.ns.d.ts by replacing "e.g." with "i.e."
2023-05-04 16:19:24 +02:00
Bartek Iwańczuk
6526b1001a
fix(core): rebuild when JS sources for snapshotting change (#18976) 2023-05-04 16:19:22 +02:00
Bartek Iwańczuk
47b78b6b0a
chore: update release doc template (#18974) 2023-05-04 16:19:20 +02:00
Luca Casonato
3b5adb13de
fix(ext/kv): KvU64#valueOf and KvU64 inspect (#18656)
`new Deno.KvU64(1n) + 2n == 3n` is now true.

`new Deno.KvU64(1n)` is now inspected as `[Deno.KvU64: 1n]`
(`Object(1n)` is inspected as `[BigInt: 1n]`).

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-05-04 16:19:17 +02:00
Bartek Iwańczuk
3b36c36715
perf: use jemalloc as global allocator (#18957)
Follow up to https://github.com/denoland/deno/pull/18875 that enables
`jemalloc` as a global allocator for the Deno CLI.
2023-05-04 16:19:14 +02:00
David Sherret
6f36535584
refactor(ext/io): move tty metadata to separate collection (#18959)
This removes the tty stuff that's hanging on the file resources and
instead stores them in a separate `TtyModeStore`. Although this will
cause the tty store items to not be removed when the resource is
removed, I think this is ok to do because there will be a small number
of resources this is every done with and usually those resources won't
ever be closed.
2023-05-04 16:19:12 +02:00
Yarden Shoham
4ab6c672d4
docs(lib): document Deno.Command requires the allow-run permission (#18958) 2023-05-04 16:19:09 +02:00
Divy Srivastava
f92406630f
perf(core): use jemalloc for V8 array buffer allocator (#18875)
This commits changes "deno_core" to use jemalloc allocator as an
allocator
for V8 array buffers. This greatly improves our GC characteristics as we
are using
a lot of short lived array buffers. They no longer go through the
expensive
malloc/free cycle using the default Rust allocator, but instead use
jemallocator's
memory pool.

As a result the flamegraphs for WS/HTTP server flamegraphs no longer
show
stacks for malloc/free around ops that use ZeroCopyBuf and &[u8].

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-05-04 16:19:06 +02:00
Bartek Iwańczuk
8f46dc2c0f
chore: release extension crates, unpin tokio (#18954) 2023-05-04 16:19:04 +02:00
Kenta Moriuchi
ec1fb08a88
refactor(core): Use ObjectHasOwn instead of ObjectPrototypeHasOwnProperty (#18952)
ES2022 `Object.hasOwn` can be used in snapshot, so I migrate to use it.
2023-05-04 16:19:02 +02:00
Yarden Shoham
2a14ac58fa
fix(ext/node): add missing release property to node's process (#18923) 2023-05-04 16:18:59 +02:00
Bartek Iwańczuk
797f0ef42e
fix(npm): canonicalize filename before returning (#18948)
This commit changes how paths for npm packages are handled,
by canonicalizing them when resolving. This is done so that instead
of returning
"node_modules/<package_name>@<version>/node_modules/<dep>/index.js"
(which is a symlink) we "node_modules/<dep>@<dep_version>/index.js.

Fixes https://github.com/denoland/deno/issues/18924
Fixes https://github.com/bluwy/create-vite-extra/issues/31

---------

Co-authored-by: David Sherret <dsherret@gmail.com>
2023-05-04 16:18:57 +02:00
Levente Kurusa
348946aa5e
fix(node/http): Request.setTimeout(0) should clear (#18949)
Fixes: #18932
2023-05-04 16:18:55 +02:00
Michael Lazarev
fae7643648
docs: correct example of piping the output of a subprocess to a file (#18933)
Fixes #18909
2023-05-04 16:18:52 +02:00
David Sherret
9c646ac6ed
perf: lazily create RootCertStore (#18938) 2023-05-04 16:18:49 +02:00
Bartek Iwańczuk
5fc9c72b10
bench: fix benchmarks again (#18942) 2023-05-04 16:18:47 +02:00
Bartek Iwańczuk
2acb5ce635
bench: fix json ops benchmark (#18941) 2023-05-04 16:18:45 +02:00
David Sherret
6df6024506
refactor(cli): remove ProcState - add CliFactory (#18900)
This removes `ProcState` and replaces it with a new `CliFactory` which
initializes our "service structs" on demand. This isn't a performance
improvement at the moment for `deno run`, but might unlock performance
improvements in the future.
2023-05-04 16:18:43 +02:00
David Sherret
2fed39ebf9
perf: lazily retrieve ppid (#18940)
This is very apparent on Windows.

Before: 45.74ms (Hello world)
After: 33.92ms

Closes #18939
2023-05-04 16:18:40 +02:00
Bartek Iwańczuk
016b43441b
refactor: migrate async ops to generated wrappers (#18937)
Migrates some of existing async ops to generated wrappers introduced in
https://github.com/denoland/deno/pull/18887. As a result "core.opAsync2"
was removed.

I will follow up with more PRs that migrate all the async ops to
generated wrappers.
2023-05-04 16:18:38 +02:00
Kenta Moriuchi
3d0b879c0d
fix(core): Use primordials for methods (#18839)
I would like to get this change into Deno before merging
https://github.com/denoland/deno_lint/pull/1152
2023-05-04 16:18:35 +02:00
David Sherret
0ddad2486c
refactor(cli): use CliMainWorker in standalone (#18880)
Uses `CliMainWorker` in all the cli code.
2023-05-04 16:18:32 +02:00
Divy Srivastava
ff3dc7d79d
chore(ext/websocket): readd autobahn|testsuite fuzzingclient (#18903)
This reverts commit
17d1c7e444.

The `Deno.serve` signature update in
https://github.com/denoland/deno/pull/18759 broke the testee server
right after this patch landed on `main`.
2023-05-04 16:18:29 +02:00
Leo Kettmeir
15a3abc2fd
refactor(webidl): move prefix & context out of converters options bag (#18931) 2023-05-04 16:18:26 +02:00
Divy Srivastava
3bd154efee
perf(ext/web): fast path for ws events (#18905)
- Do not use `ReflectHas` in `isNode`.
- Avoid copying handler array when handlers.length == 1
- Avoid searching for path target when path.length == 1

```
Linux divy-2 5.19.0-1022-gcp #24~22.04.1-Ubuntu SMP Sun Apr 23 09:51:08 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
32GiB System memory
Intel(R) Xeon(R) CPU @ 3.10GHz

# main + https://github.com/denoland/deno/pull/18904
Msg/sec: 89326.750000
Msg/sec: 90320.000000
Msg/sec: 89576.250000

# this patch
Msg/sec: 97250.000000
Msg/sec: 97125.500000
Msg/sec: 97964.500000
```
2023-05-04 16:18:24 +02:00
David Sherret
4eca9d717a
refactor(cli): remove Clone on ProcState (#18874)
Slowly phasing this out.
2023-05-04 16:18:22 +02:00
David Sherret
1cef6fa7fa
fix(fmt/json): support formatting number with exponent and no sign (#18894)
Numbers with an exponent and no sign (ex. `1e1`) would fail to parse.
2023-05-04 16:18:19 +02:00
Divy Srivastava
36958ea7dc
perf(ext/websocket): use internal dispatch for msg events (#18904)
```
Linux divy-2 5.19.0-1022-gcp #24~22.04.1-Ubuntu SMP Sun Apr 23 09:51:08 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
32GiB System memory
Intel(R) Xeon(R) CPU @ 3.10GHz

# main
Msg/sec: 89398.250000
Msg/sec: 90079.750000

# this patch
Msg/sec: 91919.750000
Msg/sec: 91762.250000
```
2023-05-04 16:18:17 +02:00
Kenta Moriuchi
084e7c9560
fix(ext/url): throw TypeError for empty argument (#18896)
Fixes #18893
2023-05-04 16:18:15 +02:00
Leo Kettmeir
fcb0ae62e9
refactor: remove ext/console/01_colors.js (#18927) 2023-05-04 16:18:12 +02:00
Matt Mastracci
dcd59e0974
perf(core): async op pseudo-codegen and performance work (#18887)
Performance:

```
async_ops.js: 760k -> 1030k (!)
async_ops_deferred.js: 730k -> 770k
Deno.serve bench: 118k -> 124k
WS test w/ third_party/prebuilt/mac/load_test 100 localhost 8000 0 0: unchanged

Startup time: approx 0.5ms slower (13.7 -> 14.2ms)
```
2023-05-04 16:18:10 +02:00
Leo Kettmeir
5f22a37f93
refactor: merge Deno & Node inspectors (#18691) 2023-05-04 16:17:51 +02:00
Divy Srivastava
46ce43a871
fix(ext/websocket): update fastwebsockets to 0.3.1 (#18916)
Fixes https://github.com/denoland/deno/issues/18912
Fixes https://github.com/denoland/deno/issues/18808
2023-05-04 16:17:49 +02:00