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

9050 commits

Author SHA1 Message Date
Divy Srivastava
4cc8784f5b
perf(ext/websocket): replace tokio_tungstenite server with fastwebsockets (#18587)
https://github.com/littledivy/fastwebsockets

```
# This PR
./load_test 100 0.0.0.0 8080 0 0
Running benchmark now...
Msg/sec: 176355.000000

# main
./load_test 100 0.0.0.0 8080 0 0
Running benchmark now...
Msg/sec: 157198.750000
```
2023-04-06 18:44:31 +05:30
Divy Srivastava
3b62a58818
fix(ext/node): add symmetric keygen (#18609)
Towards #18455
2023-04-06 18:39:25 +05:30
Bartek Iwańczuk
339165bd95
refactor(ext/node): add more methods to 'NodeFs' trait (#18604)
Added more methods to `ext/node/clippy.toml` that are not allowed
to be used in the crate.

Prerequisite for https://github.com/denoland/deno/pull/18544
2023-04-06 15:08:14 +02:00
Yusuke Tanaka
9626c48a01
feat(task): introduce built-in unset command to deno task (#18606)
This introduces a new built-in `unset` command to `deno task` by bumping
deno_task_shell to the latest version 0.11.0. Also this includes a fix
on how `deno task` handles empty environment variables (see
https://github.com/denoland/deno_task_shell/pull/80 for details).
2023-04-06 11:53:44 +09:00
Geert-Jan Zwiers
a7e25b8126
fix(ext/node): json encode binary command name (#18596)
Fixes https://github.com/denoland/deno/issues/18588
2023-04-06 01:46:21 +02:00
Luca Casonato
36e8c8dfd7
feat(core): sync io ops in core (#18603)
This commit adds op_read_sync and op_write_sync to core. These ops are
similar to op_read and op_write, but they are synchronous. Just like the
async ops, they operate on generic `deno_core::Resource` objects. These
now have new `read_byob_sync` and `write_sync` methods, with default
implementations throwing "NotSupported" errors, just like the async
counterparts.

There are no `write_all` or `read` equivalents, because the
optimizations they unlock are not useful in synchronous contexts.
2023-04-06 00:14:16 +02:00
Luca Casonato
ee15b49845
perf(ext/io): remove a data copy from File write (#18601)
Removes a data copy from all async `File::write` operations.
2023-04-05 23:13:01 +02:00
Divy Srivastava
34d596e04f
chore(cli/bench): add ws echo bench (#18595) 2023-04-05 18:31:07 +05:30
Bartek Iwańczuk
db39855fcb
tests: cleanup "node_compat_tests" (#18594)
A few drive-by cleanup while I'm working on the "crypto"
module. It makes it easier and faster to debug the failing
test case.
2023-04-05 13:15:57 +02:00
Bartek Iwańczuk
686fe47749
refactor(core): run pending dynamic imports before ops (#18592)
This is in preparation to limit number of times we have to cross Rust ->
V8 boundary on each tick of event loop.
2023-04-05 00:07:26 +02:00
Bartek Iwańczuk
c4628aa809
refactor(ext/http): bring back 'reusePort' option for 'Deno.serve()' (#18590)
Closes https://github.com/denoland/deno/issues/18582
2023-04-04 14:17:36 +00:00
Matt Mastracci
a1764f7690
refactor(core): Improve ergonomics of managing ASCII strings (#18498)
This is a follow-on to the earlier work in reducing string copies,
mainly focused on ensuring that ASCII strings are easy to provide to the
JS runtime.

While we are replacing a 16-byte reference in a number of places with a
24-byte structure (measured via `std::mem::size_of`), the reduction in
copies wins out over the additional size of the arguments passed into
functions.

Benchmarking shows approximately the same if not slightly less wallclock
time/instructions retired, but I believe this continues to open up
further refactoring opportunities.
2023-04-04 06:46:31 -06:00
Kenta Moriuchi
2dc2016837
feat(ext/url): URL.canParse (#18286) 2023-04-04 13:34:12 +02:00
Bartek Iwańczuk
c341dbee5d
refactor: remove remaining references to "flash" server (#18580)
Follow up to https://github.com/denoland/deno/pull/18578

We will need to do another pass cleaning up `ext/fetch/23_request.js`
2023-04-04 12:37:56 +02:00
Dj
62c5664697
feat(ext/ffi): support marking symbols as optional (#18529) 2023-04-03 21:32:21 +03:00
Bartek Iwańczuk
51d3fb78ad
refactor: remove "ext/flash" (#18578)
With https://github.com/denoland/deno/pull/18568 landed we no longer
need "ext/flash". 

This commit removes "deno_flash" extension completely.

This should have some impact on the binary and snapshot size.

Closes https://github.com/denoland/deno/issues/17356
2023-04-03 19:01:02 +02:00
Bartek Iwańczuk
2846bbe0a3
refactor: "Deno.serve()" API uses "Deno.serveHttp()" internally (#18568)
This commit changes implementation of "Deno.serve()" API to use
"Deno.serveHttp()" under the hood. This change will allow us to
remove the "flash" server implementation, bringing stability to the
"Deno.serve()" API.

"cli/tests/unit/flash_test.ts" was renamed to "serve_test.ts".

Closes https://github.com/denoland/deno/issues/15574
Closes https://github.com/denoland/deno/issues/15504
Closes https://github.com/denoland/deno/issues/15646
Closes https://github.com/denoland/deno/issues/15909
Closes https://github.com/denoland/deno/issues/15911
Closes https://github.com/denoland/deno/issues/16828
Closes https://github.com/denoland/deno/issues/18046
Closes https://github.com/denoland/deno/issues/15869
2023-04-03 17:44:18 +02:00
Yoshiya Hinosawa
6d68392f8a
Revert "fix(cli): don't store blob and data urls in the module cache (#18261)" (#18572)
This reverts commit b4c61c146a.

cc @nayeemrmn
2023-04-03 21:05:39 +09:00
Bartek Iwańczuk
3cd7abf73f
refactor(ext/node): migrate "http" module to use "Deno.serveHttp" API (#18552)
This commit changes "node:http" module to use "Deno.serveHttp" API
instead of "Deno.serve" API.

---------

Co-authored-by: Matt Mastracci <matthew@mastracci.com>
2023-04-03 00:50:39 +02:00
Matt Mastracci
513dadadcf
feat(ext/http): add an op to perform raw HTTP upgrade (#18511)
This commit adds new "op_http_upgrade_early", that allows to hijack
existing "Deno.HttpConn" acquired from "Deno.serveHttp" API 
and performing a Websocket upgrade on this connection.

This is not a public API and is meant to be used internally in the
"ext/node" polyfills for "http" module.

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-04-02 23:27:12 +02:00
David Sherret
d939a5e96c
ci: improve release docs (#18562) 2023-04-02 17:53:52 +00:00
Kenta Moriuchi
03edd48edd
chore: Turn back on dlintPreferPrimordials (#17715)
Closes #17709
2023-04-02 19:41:41 +02:00
denobot
ad8d0c90d1
chore: forward v1.32.3 release commit to main (#18561)
Co-authored-by: David Sherret <dsherret@gmail.com>
2023-04-01 20:27:53 -04:00
Nayeem Rahman
e5588d2f1e
fix(test): don't swallow sanitizer errors with permissions (#18550)
Missing `return` from #18246.
2023-04-01 16:20:16 -04:00
David Sherret
0210c1cadf
fix(lsp): add a document preload file system entry limit (#18553)
I was testing this out and it's badly needed. For now, it's not
configurable and limited to 1,000 file system entries.

Related to #18538
2023-04-01 15:10:30 -04:00
David Sherret
30065af0f2
chore(release): improve merge commit back to main for patch releases (#18554)
This change commits with conflicts that can then be resolved manually.
2023-04-01 16:58:55 +00:00
David Sherret
bac8e4f6f2
fix(repl): disable language server document preloading in the repl (#18543)
This was an oversight because the repl uses the language server under
the hood. Also, never preloads from a root directory.

Part of #18538
2023-04-01 12:02:44 -04:00
David Sherret
ae1ba2af3c
perf(check): faster source hashing (#18534) 2023-04-01 10:12:40 -04:00
David Sherret
23b9be7b37
fix(check): ensure diagnostics caused by changes in other files get invalidated between runs (#18541)
Regression caused by the performance improvement in #18329. Figuring
this out was hard. It's luckily still fast after this change.

Closes #18516
2023-04-01 10:04:56 -04:00
Dj
c162647020
fix(ext/ffi): crash when same reference struct is used in two fields (#18531)
fix #17482
2023-04-01 09:26:02 +05:30
Divy Srivastava
bafffa95a0
ci: update to Ubuntu 22.04 runners for all workflows (#18526) 2023-04-01 08:35:31 +05:30
denobot
f465123fdc
chore: forward v1.32.2 release commit to main (#18539)
This is the release commit being forwarded back to main for 1.32.2
2023-04-01 00:10:13 +00:00
Bartek Iwańczuk
cbd14085e6
Revert "fix(cli): deno upgrade file permission (#18427)" (#18467)
This reverts commit 0742ea1170.

Closes https://github.com/denoland/deno/issues/18466
2023-03-31 13:43:45 -04:00
David Sherret
7ec45770c8
fix: upgrade to TypeScript 5.0.3 (#18532) 2023-03-31 17:09:04 +00:00
David Sherret
87ccd4bcd1
fix(lsp): better handling of data: urls (#18527)
1. Log instead of error when the referrer can't be found
2. Fixes typescript to resolve data urls correctly. Properly documented
here:
https://github.com/denoland/TypeScript/pull/4/files#diff-180da7c288743d11d8590d30f0c07c48e5dcf291aa671bbea0dd520a9a1359d2

Closes #18524
2023-03-31 16:48:18 +00:00
Divy Srivastava
aa9b94a80e
perf(ext/websocket): use opAsync2 to avoid spread deopt (#18525)
This commit adds a new core API `opAsync2` to call an async op with
atmost 2 arguments. Spread argument iterators has a pretty big perf hit
when calling ops.

| name | avg msg/sec/core |
| --- | --- |
| 1.32.1 | `127820.750000` |
| #18506 | `140079.000000` |
| #18506 + #18509 | `150104.250000` |
| #18506 + #18509 + this | `157340.000000` |
2023-03-31 21:28:21 +05:30
Divy Srivastava
feab94ff51
fix(ops): fallback when FastApiOneByteString is not utf8 (#18518)
Fixes https://github.com/denoland/deno/issues/18255
2023-03-31 17:46:25 +02:00
Divy Srivastava
b9a3790932
perf: const op declaration (#18288)
Co-authored-by: Levente Kurusa <lkurusa@kernelstuff.org>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-03-31 14:42:14 +02:00
Divy Srivastava
0f41aff1d9
perf(ext/websocket): efficient event kind serialization (#18509)
Use u16 to represent the kind of event (0 - 6) & event code > 6 is
treated as the close code. This way we can represent all events + the
close code in a single JS number. This is safe because (as per RFC 6455)
close code from 0-999 are reserved & not used.

| name | avg msg/sec/core |
| --- | --- |
| deno_main | `127820.750000` |
| deno #18506 | `140079.000000` |
| deno #18506 + this | `150104.250000` |
2023-03-31 10:34:12 +05:30
David Sherret
7722014497
fix(lsp): include all diagnosable documents on initialize (#17979)
Closes https://github.com/denoland/vscode_deno/issues/797
Closes https://github.com/denoland/deno/issues/11190
Closes https://github.com/denoland/vscode_deno/issues/811
Closes https://github.com/denoland/vscode_deno/issues/761
Closes https://github.com/denoland/vscode_deno/issues/585
Closes https://github.com/denoland/vscode_deno/issues/561
Closes https://github.com/denoland/vscode_deno/issues/410
2023-03-30 17:47:53 -04:00
Luca Casonato
02e01b171f
fix(dts): improve types for the Deno.KV API (#18510) 2023-03-30 22:52:31 +02:00
Luca Casonato
e888c3f534
feat(ext/kv): return versionstamp from set/commit (#18512)
This commit updates the `Deno.Kv` API to return the new commited
versionstamp for the mutated data from `db.set` and `ao.commit`. This is
returned in the form of a `Deno.KvCommitResult` object that has a
`versionstamp` property.
2023-03-30 20:57:21 +02:00
Geert-Jan Zwiers
206c593519
fix(coverage): ignore files from npm registry (#18457)
Fixes https://github.com/denoland/deno/issues/17664 and part of
https://github.com/denoland/deno/issues/18454 by excluding files
belonging to npm modules by default in the coverage output.
2023-03-30 17:40:22 +00:00
Divy Srivastava
30ee846588
perf(ext/websocket): special op for sending binary data frames (#18506)
Easy perf win by avoiding deserializing `SendValue` through serde_v8. 

| name | avg msg/sec/core |
| --- | --- |
| deno_main | `127820.750000` |
| deno_this | `140079.000000` |
2023-03-30 16:30:19 +00:00
David Sherret
c4f82cab31
fix(lsp): textDocument/references should respect includeDeclaration (#18496) 2023-03-30 16:15:21 +00:00
Divy Srivastava
cc7f5c1015
perf(ext/websocket): special op for sending text data frames (#18507)
Similar to #18506 but for Text frames.
2023-03-30 17:52:12 +02:00
David Sherret
3abc53f811
docs: clarify Deno.consoleSize returns the window size (#18508)
Closes #18477
2023-03-30 11:47:33 -04:00
Bartek Iwańczuk
381f5801f9
Revert "refactor(ext/node): Use Deno.inspect (#17960)" (#18491)
This reverts commit a3529d0232.

This change made debugging Node tests very hard - `AssertionError` is
now printed as `[Circular *1]` giving no visibility what failed.

We need to align two implementations together and remove this one then.
2023-03-30 15:33:28 +00:00
David Sherret
e0429e2ad6
fix(repl): improve package.json support (#18497)
1. Fixes a cosmetic issue in the repl where it would display lsp warning
messages.
2. Lazily loads dependencies from the package.json on use.
3. Supports using bare specifiers from package.json in the REPL.

Closes #17929
Closes #18494
2023-03-30 10:43:16 -04:00
Yoshiya Hinosawa
3deade4b14
chore(ext/node): run node compat parallel tests in core number concurrency (#18505)
We currently run the all test cases in `parallel` category at the same
time, which invokes hundreds process at the same time, and that seems
causing some flakiness in CI. (maybe related to #18487)

This PR limits the concurrency to the number of cpu cores. This is more
aligned to how Node.js run their `parallel` test in their repository.
42c4a35952/Makefile (L356)
2023-03-30 16:35:45 +02:00