Commit graph

10386 commits

Author SHA1 Message Date
Divy Srivastava c4029f6af2
fix(node): implement createPrivateKey (#20981)
Towards #18455
2023-11-09 23:26:59 +05:30
Divy Srivastava ee7fd0a212
chore(ext/crypto): bump signature to 2.1 (#21125) 2023-11-09 16:15:46 +01:00
btoo 09dc5f36d9
fix small Deno.createHttpClient typo in lib.deno.unstable.d.ts (#21115) 2023-11-08 19:34:57 -07:00
Matt Mastracci 02c5f49a7a
chore: refactor test_server and move to rustls-tokio-stream (#21117)
Remove tokio-rustls as a direct dependency of Deno and refactor
test_server to reduce code duplication.

All tcp and tls listener paths go through the same streams now, with the
exception of the simpler Hyper http-only handlers (those can be done in
a later follow-up).

Minor bugs fixed:
 - gRPC server should only serve h2
 - WebSocket over http/2 had a port overlap
- Restored missing eye-catchers for some servers (still missing on Hyper
ones)
2023-11-08 13:00:29 -07:00
Matt Mastracci 5e82fce0a0
chore: remove op_baseline and flamebench (#21120)
ops are better tested in deno_core, and flamebench has rotted quite a
bit.
2023-11-08 13:00:13 -07:00
Matt Mastracci f8d1d84c5a
chore(ext/web): migrate to deno_core typed externals (#21114)
Use our safer typed externals for the external required for resource
streams.
2023-11-08 20:46:13 +01:00
Aravind e4593873a9
fix(ext/http): Throwing Error if the return value of Deno.serve handler is not a Response class (#21099)
---------

Co-authored-by: Matt Mastracci <matthew@mastracci.com>
2023-11-07 15:52:44 -07:00
David Sherret 7978bc5d1b
fix(node): cjs export analysis should probe for json files (#21113)
Closes #21064
2023-11-07 16:38:55 -05:00
David Sherret 9201198efd
fix(node): inspect ancestor directories when resolving cjs re-exports during analysis (#21104)
If a CJS re-export can't be resolved, it will check the ancestor
directories, which is more similar to what `require` does at runtime.
2023-11-07 09:56:06 -05:00
Matt Mastracci 50e4806a2d
chore: bump deno_core (#21102) 2023-11-07 01:03:48 +00:00
Luca Casonato 777c142d39
docs: improve some JSDoc (#20841)
Minor improvements to the documentation for https://deno.com/api
2023-11-07 00:35:22 +00:00
Gasman 837c870ff4
fix(node/http): socket.setTimeout (#20930)
Fixes #20923
2023-11-07 00:51:14 +01:00
Kenta Moriuchi 90189dd997
fix(ext): use String#toWellFormed in ext/webidl and ext/node (#21054)
Fixes #18802 

This PR adds `util.toUSVString` to node:util:

```js
import util from "node:util";
util.toUSVString("string\ud801"); // => "string\ufffd"
```
2023-11-06 22:18:28 +01:00
David Sherret 7eb34c7a36
fix(byonm): correct resolution for scoped packages (#21083) 2023-11-06 08:35:26 -05:00
Luca Bruno 56a4c981f5
fix(ext/fetch): re-align return type in op_fetch docstring (#21098)
This adds a missing `cancelHandleRid` field in `op_fetch` return type,
see Rust side:

fdb4953ea4/ext/fetch/lib.rs (L183-L189)
2023-11-06 14:15:02 +01:00
Jérôme Benoit 65a4b44b75
docs: add missing cmake build dependency installation (#20788)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
2023-11-06 13:31:26 +01:00
Bartek Iwańczuk fdb4953ea4
refactor: unify CDP types in a single module (#21094)
This commit moves all Chrome Devtools Protocol messages to `cli/cdp.rs`
and refactors all places using these types to pull them from a common
place.

No functional changes.
2023-11-05 22:58:59 +00:00
Jesse Jackson 68a964346d
fix(core/types): Promise.withResolvers: Unmark callback param as optional (#21085)
See discussion on merged commit:
1d19b1011b (r131604700)

Signed-off-by: Jesse Jackson <jsejcksn@users.noreply.github.com>
2023-11-05 23:40:56 +01:00
Matt Mastracci 485fade0b6
chore: migrate to new deno_core and metrics (#21057)
- Uses the new OpMetrics system for sync and async calls
- Partial revert of #21048 as we moved Array.fromAsync upstream to
deno_core
2023-11-05 14:27:36 -07:00
Divy Srivastava 4530cd5f0d fix 2023-11-05 06:40:35 -08:00
Divy Srivastava cbdc649975 fix lint 2023-11-05 06:40:35 -08:00
Divy Srivastava 5202f5460d chore(ext/crypto): upgrade ec crates 2023-11-05 06:40:35 -08:00
Divy Srivastava 46faf37ec0
chore(ext/ffi): use dlopen2 crate (#21093)
Closes #21046
2023-11-05 09:29:26 +00:00
Divy Srivastava 5a45892707
chore: bump deno_native_certs to 0.2 (#21092)
Towards #21046
2023-11-05 08:14:58 +00:00
Igor Zinkovsky 1097de3e1d
fix(cron): update Deno.cron doc example (#21078)
Signed-off-by: Igor Zinkovsky <igor@deno.com>
2023-11-04 14:04:13 -07:00
David Sherret e4c947dd2b
fix(node): use closest package.json to resolve package.json imports (#21075) 2023-11-04 16:41:51 +00:00
Divy Srivastava 0b75a7169b
perf: lazy atexit setup (#21053)
`libc::atexit` incurrs 2% dyld cost at startup on macOS. This PR moves
the setup to when the tty mode is changed using op_stdin_set_raw.
2023-11-04 17:30:12 +05:30
David Sherret 8acf059ac6
fix(doc): deno doc --lint mod.ts should output how many files checked (#21084)
As pointed out in https://github.com/denoland/deno/issues/21067 , it's
confusing that `deno doc --lint mod.ts` outputs the documentation to
stdout on success. Instead, it would be better if it outputted how many
files were checked similar to what `deno lint` does on success. It still
outputs the documentation if `--lint` or `--html` are provided so this
is non-breaking.
2023-11-04 04:43:54 +00:00
Divy Srivastava efa1c1c964 chore(ext/crypto): bump curve25519-dalek to 4.1 2023-11-03 20:25:35 -07:00
Bartek Iwańczuk ee1e9a6434
fix(doc): require source files if --html or --lint used (#21072)
Fixes https://github.com/denoland/deno/issues/21067
Fixes https://github.com/denoland/deno/issues/21070
2023-11-03 17:06:18 +00:00
Matt Mastracci 76fbe85264
chore: finish indexmap1 removal from deno (#21060)
We still pull the dep in from a few other places, but we can let those
get fixed over time.
2023-11-02 16:55:37 -06:00
Bartek Iwańczuk 621440017a
chore: Add 'jupyter' category for Deno.jupyter APIs (#21061) 2023-11-02 22:43:02 +00:00
Matt Mastracci ec0e387d1c
chore: fix dlint version and sanity check version after download (#21058)
Follow-up to fix version error introduced in #21014
2023-11-02 15:37:10 -06:00
Igor Zinkovsky 1d0856a4f1
feat(ext/kv): increase checks limit (#21055) 2023-11-02 11:57:11 -07:00
denobot 41877a0b37
1.38.0 (#21051)
Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-11-02 01:01:47 +00:00
Asher Gomez d7348c870a
fix: add missing Object.groupBy() and Map.groupBy() types (#21050) 2023-11-01 23:18:41 +00:00
David Sherret 58d543a480
fix(repl): jsxImportSource was not working (#21049)
I made some fixes in deno_ast to make this possible and we forgot to
update this.
2023-11-01 23:04:54 +00:00
Bartek Iwańczuk ab72019a17
feat: enable Array.fromAsync (#21048) 2023-11-01 22:25:18 +00:00
Bartek Iwańczuk 24c3c96958
feat: granular --unstable-* flags (#20968)
This commit adds granular `--unstable-*` flags:
- "--unstable-broadcast-channel"
- "--unstable-ffi"
- "--unstable-fs"
- "--unstable-http"
- "--unstable-kv"
- "--unstable-net"
- "--unstable-worker-options"
- "--unstable-cron"

These flags are meant to replace a "catch-all" flag - "--unstable", that
gives a binary control whether unstable features are enabled or not. The
downside of this flag that allowing eg. Deno KV API also enables the FFI
API (though the latter is still gated with a permission).

These flags can also be specified in `deno.json` file under `unstable`
key.

Currently, "--unstable" flag works the same way - I will open a follow
up PR that will print a warning when using "--unstable" and suggest to use
concrete "--unstable-*" flag instead. We plan to phase out "--unstable"
completely in Deno 2.
2023-11-01 23:15:08 +01:00
Matt Mastracci 42c426e769
feat(ext/websocket): websockets over http2 (#21040)
Implements `WebSocket` over http/2. This requires a conformant http/2
server supporting the extended connect protocol.

Passes approximately 100 new WPT tests (mostly `?wpt_flags=h2` versions
of existing websockets APIs).

This is implemented as a fallback when http/1.1 fails, so a server that
supports both h1 and h2 WebSockets will still end up on the http/1.1
upgrade path.

The patch also cleas up the websockets handshake to split it up into
http, https+http1 and https+http2, making it a little less intertwined.

This uncovered a likely bug in the WPT test server:
https://github.com/web-platform-tests/wpt/issues/42896
2023-11-01 21:11:01 +00:00
Bartek Iwańczuk 587f2e0800
feat: precompile JSX (#20962)
Co-authored-by: Marvin Hagemeister <marvin@deno.com>
2023-11-01 20:30:23 +00:00
Matt Mastracci 658f958fb8
chore(cli): bump zeromq dep (#21045)
Reduces the number of crates we need to build pretty significantly
(approx 20).
2023-11-01 20:20:50 +00:00
David Sherret 02822d309f
fix(test): --junit-path should handle when the dir doesn't exist (#21044)
Closes https://github.com/denoland/deno/issues/21022
2023-11-01 19:59:51 +00:00
Luca Casonato d42f154312
feat: disposable Deno resources (#20845)
This commit implements Symbol.dispose and Symbol.asyncDispose for
the relevant resources.

Closes #20839

---------

Signed-off-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-11-01 20:26:12 +01:00
Bartek Iwańczuk 1d19b1011b
chore: upgrade deno_core (#21036)
Updated to deno_core 0.224.0 and V8 12.0.

---------

Co-authored-by: Aapo Alasuutari <aapo.alasuutari@gmail.com>
2023-11-01 20:25:09 +01:00
Igor Zinkovsky 01d3e0f317
feat(cron) implement Deno.cron() (#21019)
This PR adds unstable `Deno.cron` API to trigger execution of cron jobs.

* State: All cron state is in memory. Cron jobs are scheduled according
to the cron schedule expression and the current time. No state is
persisted to disk.
* Time zone: Cron expressions specify time in UTC.
* Overlapping executions: not permitted. If the next scheduled execution
time occurs while the same cron job is still executing, the scheduled
execution is skipped.
* Retries: failed jobs are automatically retried until they succeed or
until retry threshold is reached. Retry policy can be optionally
specified using `options.backoffSchedule`.
2023-11-01 11:57:55 -07:00
Divy Srivastava 82643857cc
Revert "chore: use kqueue backend of notify on macOS" (#21039)
Reverts denoland/deno#21028

Reason:
https://github.com/notify-rs/notify/blob/main/notify/src/kqueue.rs#L79-L81
Need to wait for the watcher thread to spawn otherwise we hit flakes

---------

Signed-off-by: Divy Srivastava <dj.srivastava23@gmail.com>
2023-11-01 15:54:27 +00:00
Bartek Iwańczuk 8ea2d926a9
feat: deno doc --html (#21015)
This commit adds static documentation site generate to "deno doc"
subcommand.

Example:
```
$ deno doc --html --name="My library" ./mod.ts
# outputs to ./docs/

$ deno doc --html --name="My library" --output=./documentation/ ./mod.ts ./file2.js
# outputs to ./documentation/

$ deno doc --html --name="My library" ./**/mod.ts
# generate docs for all files with "mod.ts" name
```

Closes https://github.com/denoland/deno/issues/8233
2023-11-01 15:25:05 +00:00
Asher Gomez f8f4e77632
feat(unstable): deno run --env (#20300)
This change adds the `--env=[FILE]` flag to the `run`, `compile`,
`eval`, `install` and `repl` subcommands. Environment variables set in
the CLI overwrite those defined in the `.env` file.
2023-11-01 15:21:13 +00:00
Bartek Iwańczuk 53248e9bb3
fix(repl): support transforming JSX/TSX (#20695)
Closes https://github.com/denoland/deno/issues/16771

---------

Co-authored-by: David Sherret <dsherret@gmail.com>
Co-authored-by: Marvin Hagemeister <marvin@deno.com>
2023-11-01 14:42:54 +01:00