1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-28 16:20:57 -05:00
Commit graph

9286 commits

Author SHA1 Message Date
David Sherret
90ed487965 fix(lsp): hard to soft error when unable to get completion info (#19091) 2023-05-11 17:26:31 -04:00
Miroslav Bajtoš
b11c322b89 chore: upgrade thiserror and deno_lockfile (#19073)
Upgrade `thiserror` to `1.40.0`.

Remove version pinning so that consumers of deno crates can install
newer versions of `thiserrors` without waiting for us to upgrade our
Cargo.toml.

Upgrade `deno_lockfile` to `0.14.0` to bring in `thiserror` upgrade, see
https://github.com/denoland/deno_lockfile/pull/1.
2023-05-11 17:26:31 -04:00
David Sherret
ba7fd57616 fix(cli): upgrade to Typescript 5.0.4 (#19090) 2023-05-11 17:26:31 -04:00
Nayeem Rahman
14bf8dc506 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 17:26:30 -04:00
Nayeem Rahman
89d0f0c4e3 fix(runtime): ChildProcess::kill() doesn't require additional perms (#15339)
Fixes #15217.
2023-05-11 17:26:30 -04:00
Yarden Shoham
3a0b2075f7 chore(deps): bump tokio version to 1.28.1 (#19069) 2023-05-11 17:26:30 -04:00
Marvin Hagemeister
ff1403c0a1 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 17:26:30 -04:00
David Sherret
75735fbf7f 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-11 17:26:30 -04:00
Marvin Hagemeister
56a9a2a990 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 17:26:29 -04:00
Bartek Iwańczuk
610936f5b2 fix(node): conditional exports edge case (#19082)
Fixes https://github.com/denoland/deno/issues/18743
2023-05-11 17:26:29 -04:00
David Sherret
72512c95c1 fix(dts): align seekSync position arg with seek (#19077)
Closes #19060
2023-05-11 17:26:29 -04:00
Matt Mastracci
5907d959af 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-11 17:26:29 -04:00
Matt Mastracci
c2faca2584 refactor(ext/http): HTTP trait structs need to be public (#19075) 2023-05-11 17:26:29 -04:00
Bartek Iwańczuk
84dc93529e chore(core): fix a warning (#19072) 2023-05-11 17:26:29 -04:00
Matt Mastracci
e6e0fa752d refactor(core): http_next generic over request extractor (#19071) 2023-05-11 17:26:28 -04:00
Matt Mastracci
a650318c0c 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-11 17:26:28 -04:00
Levente Kurusa
8278df52e4 chore(node/stream): unbundle/unminify readable-streams (#19045) 2023-05-11 17:26:28 -04:00
David Sherret
69aea93d54 fix(vendor): better handling of redirects (#19063)
Closes #17582
Closes #19057
2023-05-11 17:26:28 -04:00
Bartek Iwańczuk
cec988bfc5 bench: fix benchmarks with extensions (#19059)
They broke in f34fcd16ea
2023-05-11 17:26:28 -04:00
Satya Rohith
62a386d663 chore: upgrade tokio to 1.28 (#19053) 2023-05-11 17:26:28 -04:00
Luca Casonato
575150b463 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-11 17:26:27 -04:00
David Sherret
65e5d884d8 perf(fmt): faster formatting for minified object literals (#19050)
Has fix for
https://github.com/dprint/dprint-plugin-typescript/issues/520
2023-05-11 17:26:27 -04:00
Luca Casonato
162a0f0dcf refactor: prefix ops w/ crate they are defined in (#19044)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-05-11 17:26:27 -04:00
Bartek Iwańczuk
4e1a15090f refactor(core): make sure to always set embedder wrapper offset (#19048) 2023-05-11 17:26:27 -04:00
Bartek Iwańczuk
386fa09920 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-11 17:26:27 -04:00
Bartek Iwańczuk
4c07550d46 Revert "perf(core): use jemalloc for V8 array buffer allocator (#18875)" (#19046)
This reverts commit 022aae9854.
2023-05-11 17:26:27 -04:00
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