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

9434 commits

Author SHA1 Message Date
David Sherret
b8495e0377
fix(cli): upgrade to Typescript 5.0.4 (#19090) 2023-05-11 14:12:58 +00:00
Nayeem Rahman
ffb0318e4a
fix(console): handle error when inspecting promise-like (#19083)
Fixes
https://discord.com/channels/684898665143206084/684911491035430919/1105900195406958672.

This was caused by: 
- A `TypeError` from `core.getPromiseDetails()` for promise-likes which
also lead to that code path.
- Swallowing internal formatting errors by returning `undefined`. I've
made it so that a special message is formatted in that case instead
(note that this case is fixed now):
![image](https://github.com/denoland/deno/assets/29990554/65bb9612-60b2-4e31-bf5e-e20976601593)
2023-05-11 15:08:17 +02:00
Nayeem Rahman
2ba9ccc1ab
fix(runtime): ChildProcess::kill() doesn't require additional perms (#15339)
Fixes #15217.
2023-05-11 14:53:45 +02:00
Yarden Shoham
20c42286f8
chore(deps): bump tokio version to 1.28.1 (#19069) 2023-05-11 14:52:56 +02:00
Marvin Hagemeister
f1d0f745d3
fix(node): expose channels in worker_threads (#19086)
This PR ensures that node's `worker_threads` module exports
`MessageChannel`, `MessagePort` and the `BroadcastChannel` API. Fixing
these won't make `esbuild` work, but brings us one step closer 🎉

Fixes #19028 .
2023-05-11 12:32:19 +02:00
David Sherret
28aa489de9
feat(compile): unstable npm and node specifier support (#19005)
This is the initial support for npm and node specifiers in `deno
compile`. The npm packages are included in the binary and read from it via
a virtual file system. This also supports the `--node-modules-dir` flag,
dependencies specified in a package.json, and npm binary commands (ex.
`deno compile --unstable npm:cowsay`)

Closes #16632
2023-05-10 20:06:59 -04:00
Marvin Hagemeister
5fd74bfa1c
feat(node): add Module.runMain() (#19080)
This PR adds the missing `Module.runMain()` function which is required
for tools like `ts-node`.

Fixes #19033
2023-05-11 00:13:45 +02:00
Bartek Iwańczuk
e72485fb17
fix(node): conditional exports edge case (#19082)
Fixes https://github.com/denoland/deno/issues/18743
2023-05-10 23:55:48 +02:00
David Sherret
ec67e96a12
fix(dts): align seekSync position arg with seek (#19077)
Closes #19060
2023-05-10 22:04:30 +02:00
Matt Mastracci
d55e07f627
chore(core): Parallelize all WPT tests and reduce timeouts for expected failures (#19061)
This speeds up WPT tests in two ways:

1. The `WebCryptoAPI` tests are slow, so create a parallel bucket for
each individual test instead of one for all the `WebCryptoAPI` tests.
2. If a test is expected to fail, use a shorter timeout (1 minute rather
than 4).
2023-05-10 21:35:42 +02:00
Matt Mastracci
eb374e8cd3
refactor(ext/http): HTTP trait structs need to be public (#19075) 2023-05-10 18:04:01 +02:00
Bartek Iwańczuk
b07535cd2e
chore(core): fix a warning (#19072) 2023-05-10 15:48:17 +00:00
Matt Mastracci
29aa988476
refactor(core): http_next generic over request extractor (#19071) 2023-05-10 16:23:26 +02:00
Matt Mastracci
234cef982c
feat(ext/http): Automatic compression for Deno.serve (#19031)
`Content-Encoding: gzip` support for `Deno.serve`. This doesn't support
Brotli (`br`) yet, however it should not be difficult to add. Heuristics
for compression are modelled after those in `Deno.serveHttp`.

Tests are provided to ensure that the gzip compression is correct. We
chunk a number of different streams (zeros, hard-to-compress data,
already-gzipped data) in a number of different ways (regular, random,
large/small, small/large).
2023-05-10 13:23:14 +02:00
Levente Kurusa
3dc745c881
chore(node/stream): unbundle/unminify readable-streams (#19045) 2023-05-10 12:30:02 +02:00
David Sherret
50618fc0bc
fix(vendor): better handling of redirects (#19063)
Closes #17582
Closes #19057
2023-05-09 21:49:16 +00:00
Bartek Iwańczuk
cb63db459c
bench: fix benchmarks with extensions (#19059)
They broke in f34fcd16ea
2023-05-09 22:53:37 +02:00
Satya Rohith
3e1cc5dbf5
chore: upgrade tokio to 1.28 (#19053) 2023-05-09 20:13:29 +05:30
Luca Casonato
f34fcd16ea
fix(core): let V8 drive extension ESM loads (#18997)
This now allows circular imports across extensions.

Instead of load + eval of all ESM files in declaration order, all files
are only loaded. Eval is done recursively by V8, only evaluating
files that are listed in `Extension::esm_entry_point` fields.

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-05-09 12:37:13 +02:00
David Sherret
723d4b0382
perf(fmt): faster formatting for minified object literals (#19050)
Has fix for
https://github.com/dprint/dprint-plugin-typescript/issues/520
2023-05-09 00:53:58 +02:00
Luca Casonato
1f9d47b174
refactor: prefix ops w/ crate they are defined in (#19044)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-05-08 23:07:45 +02:00
Bartek Iwańczuk
e021070a2a
refactor(core): make sure to always set embedder wrapper offset (#19048) 2023-05-08 19:37:29 +00:00
Bartek Iwańczuk
71db518b76
refactor(core): verify there are no ops with duplicate names (#19047)
This commit adds a "debug build" only check that verifies on startup
that there are no duplicate ops (ie. the op names are unique).
2023-05-08 20:59:38 +02:00
Bartek Iwańczuk
7da8b1d9bb
Revert "perf(core): use jemalloc for V8 array buffer allocator (#18875)" (#19046)
This reverts commit 022aae9854.
2023-05-09 03:42:34 +09:00
David Sherret
df1ca4a158
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-08 11:02:02 -04:00
Aapo Alasuutari
0aa2d7c9c1
perf(ext/ffi): Use Box<[NativeType]> in CallbackInfo parameters (#19032) 2023-05-08 10:57:38 +03:00
Matt Mastracci
687a939588
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-08 09:52:56 +02:00
ud2
40987178c4
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-08 00:27:59 +02:00
Bartek Iwańczuk
7e1ae65572
chore: lint ext/fs/std_fs.rs (#19036) 2023-05-07 20:43:16 +00:00
Aapo Alasuutari
1de1a265ff
fix(ext/ffi): Callbacks panic on returning isize (#19022) 2023-05-07 17:27:16 +03:00
Aapo Alasuutari
0536ae8658
fix(ext/ffi): UnsafeCallback can hang with 'deno test' (#19018) 2023-05-07 10:31:01 +00:00
Bartek Iwańczuk
b8c9360761
refactor(core): remove run_in_task helper, use tokio::test macro (#19009) 2023-05-06 16:01:05 +02:00
David Sherret
a6c47ee740
refactor(ext/node): combine deno_node::Fs with deno_fs::FileSystem (#18991) 2023-05-05 16:44:24 +00:00
David Sherret
5270c43e41
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-04 14:28:42 -04:00
denobot
4b645676d6
chore: forward v1.33.2 release commit to main (#18990)
**THIS PR HAS GIT CONFLICTS THAT MUST BE RESOLVED**

This is the release commit being forwarded back to main for 1.33.2

Please ensure:
- [x] Everything looks ok in the PR
- [x] The release has been published

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

Don't need this PR? Close it.

cc @levex

Co-authored-by: levex <levex@users.noreply.github.com>
Co-authored-by: Levente Kurusa <lkurusa@kernelstuff.org>
2023-05-04 19:19:35 +02:00
Bartek Iwańczuk
8382adaf7d
docs: update Deno.Writer docstring (#18987)
Closes
https://github.com/denoland/deno/issues/18985#issuecomment-1534493623
2023-05-04 14:37:45 +02:00
Luca Casonato
95e209a0e4
refactor(ext/node): remove NodeEnv trait (#18986) 2023-05-04 14:36:38 +02:00
Bartek Iwańczuk
b8d0e616ea
fix(npm): canonicalize search directory when looking for package.json (#18981)
Co-authored-by: David Sherret <dsherret@gmail.com>
2023-05-04 00:48:23 +00:00
Nayeem Rahman
7a8bb3b611
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 02:44:59 +02:00
Nayeem Rahman
e3276fbb71
fix(test): disable preventDefault() for beforeunload event (#18911)
Fixes #18910.
2023-05-03 23:10:51 +02:00
Luca Casonato
d905f20cad
fix(ext/kv): throw on the Kv constructor (#18978)
Closes #18963

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-05-03 23:08:42 +02:00
kang
632395da89
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-03 20:41:25 +00:00
Bartek Iwańczuk
246569f6d4
fix(core): rebuild when JS sources for snapshotting change (#18976) 2023-05-03 16:35:39 +00:00
Bartek Iwańczuk
8e6c104907
chore: update release doc template (#18974) 2023-05-03 15:05:53 +00:00
Luca Casonato
93a78d3d4a
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-03 11:44:00 +00:00
Bartek Iwańczuk
798c1ad0f1
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-03 00:36:33 +02:00
David Sherret
adcda4fa64
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-02 17:55:10 -04:00
Yarden Shoham
341fc11e24
docs(lib): document Deno.Command requires the allow-run permission (#18958) 2023-05-02 15:51:50 +00:00
Divy Srivastava
022aae9854
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-02 20:17:11 +05:30
Bartek Iwańczuk
97147faf89
chore: release extension crates, unpin tokio (#18954) 2023-05-02 11:30:11 +00:00