Commit graph

9655 commits

Author SHA1 Message Date
Leo Kettmeir
da709729e3
fix(node/http): add encrypted field to FakeSocket (#19886)
Fixes #19557
2023-07-21 02:18:07 +02:00
solach
5ff040bf59
fix(cli): output file handling in deno upgrade (#18994) 2023-07-20 19:51:02 +00:00
David Sherret
235fdc243f
fix(lsp): auto-discover deno.json in more cases (#19894)
We weren't auto-discovering the deno.json in two cases:

1. A project that didn't have a deno.json and just added one.
2. After a syntax error in the deno.json.

This now rediscovers it in both these cases.

Closes https://github.com/denoland/vscode_deno/issues/867
2023-07-20 14:05:52 -04:00
Matt Mastracci
bf775e3306
refactor(ext/http): Use const thread-local initializer for slightly better perf (#19881)
Benchmarking shows numbers are pretty close, however this is recommended
for the best possible thread-local performance and may improve in future
Rust compiler revisions.
2023-07-20 07:30:17 -06:00
David Sherret
1ee6218e48
perf(lsp): format in a blocking task (#19883) 2023-07-20 15:28:40 +02:00
denobot
0c3bbf7acd
chore: forward v1.35.2 release commit to main (#19887)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-07-20 05:11:50 +02:00
Matt Mastracci
aa95a3a6e0
fix(ext/http): Error on deprecated/unavailable features (#19880)
Throws an error when user code attempts to use unsupported options (may
help reduce confusion when migrating to Deno.serve)
2023-07-19 12:43:49 -06:00
Bartek Iwańczuk
5919f31891
fix(napi): update env_test.js (#19876) 2023-07-19 12:36:52 +02:00
Luca Casonato
e511022c74
feat(ext/node): properly segregate node globals (#19307)
Code run within Deno-mode and Node-mode should have access to a
slightly different set of globals. Previously this was done through a
compile time code-transform for Node-mode, but this is not ideal and has
many edge cases, for example Node's globalThis having a different
identity than Deno's globalThis.

This commit makes the `globalThis` of the entire runtime a semi-proxy.
This proxy returns a different set of globals depending on the caller's
mode. This is not a full proxy, because it is shadowed by "real"
properties on globalThis. This is done to avoid the overhead of a full
proxy for all globalThis operations.

The globals between Deno-mode and Node-mode are now properly segregated.
This means that code running in Deno-mode will not have access to Node's
globals, and vice versa. Deleting a managed global in Deno-mode will
NOT delete the corresponding global in Node-mode, and vice versa.

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Co-authored-by: Aapo Alasuutari <aapo.alasuutari@gmail.com>
2023-07-19 10:30:04 +02:00
Leo Kettmeir
bf4e99cbd7
fix(node/http): call callback after request is sent (#19871)
Fixes #19762
2023-07-19 01:30:19 +02:00
sigmaSd
cfb9478a43
fix(runtime): print process name in case of spawn error (#19855)
Fix https://github.com/denoland/deno/issues/19400

Co-authored-by: David Sherret <dsherret@users.noreply.github.com>
2023-07-19 01:24:30 +02:00
Leo Kettmeir
bab0294db6
fix(node/net): Server connection callback include socket value (#19779) 2023-07-19 00:33:43 +02:00
Divy Srivastava
51b3534b3d
fix(ext/node): check if resource can be used with write_vectored (#19868)
Fixes https://github.com/denoland/deno/issues/19766 
Fixes https://github.com/denoland/deno/issues/19846
2023-07-18 23:34:26 +02:00
Bartek Iwańczuk
7e1218cd8f
fix(node): add process.dlopen API (#19860)
Fixes https://github.com/denoland/deno/issues/19830
2023-07-18 15:13:17 +02:00
Bartek Iwańczuk
8a48fcc9d3
chore: disable rustls logging (#19859)
This commit disables internal logging coming from `rustls` crate.

So messages like:
```
TLS alert received: AlertMessagePayload {
    level: Fatal,
    description: UnknownCA,
}
```
will no longer appear unconditionally.
2023-07-17 16:49:03 -06:00
David Sherret
b09af6a424
fix(npm): support dynamic import of Deno TS from npm package (#19858)
Closes #19843
2023-07-17 17:17:58 -04:00
Bartek Iwańczuk
298e414936
fix(bench): run warmup benchmark to break JIT bias (#19844)
Closes https://github.com/denoland/deno/issues/15277

This commit adds a single "warmup" run of empty function when running
`deno bench`.
This change will break so-called "JIT bias" which makes V8 optimize the
first function
and then bail out of optimization on second function. In essence the
"warmup" function
is getting optimized and then all user benches are bailed out of
optimization.
2023-07-17 21:17:28 +00:00
David Sherret
4ebe3bdb06
fix(node): improve error message requiring non-npm es module (#19856)
Closes #19842
Closes #16913
2023-07-17 16:19:00 -04:00
David Sherret
7a9f7f3419
fix(node): improve require esm error messages (#19853)
Part of #19842.

Closes #19583
Closes #16913
2023-07-17 14:00:44 -04:00
await-ovo
37241e9b1e
fix(ext/node): fix stream/promises export (#19820) 2023-07-17 22:10:34 +09:00
David Sherret
306b51d772
fix(vendor): do not panic vendoring with jsxImportSource and no jsx files (#19837)
Closes #19833
2023-07-14 18:10:42 -04:00
David Sherret
b83dac3b14
fix(npm): improve error message importing non-existent file in a node_modules npm package (#19835) 2023-07-14 17:47:15 +00:00
Elian Cordoba
0223ad72a9
fix(npm): improve error message on directory import in npm package (#19538)
Co-authored-by: David Sherret <dsherret@users.noreply.github.com>
2023-07-14 16:47:18 +00:00
puffyCid
5bbada61ad
chore: update log, percent-encoding, and rusqlite (#19815) 2023-07-14 10:33:32 -04:00
David Sherret
b03d82e5d3
fix(tsc): more informative diagnostic when Deno does not exist (#19825)
Also improved the diagnostic when using something like `Deno.openKv` and
it doesn't exist.
2023-07-13 23:29:51 +00:00
Matt Mastracci
8465bd0037
chore: update to Rust 1.71 (#19822) 2023-07-13 15:16:24 -06:00
idanran
c5ddb5f205
docs: use Deno.serve in README (#19805) 2023-07-13 04:15:49 +02:00
David Sherret
2f4b73410a
chore: forward 1.35.1 back to main (#19814) 2023-07-12 21:36:42 -04:00
Bartek Iwańczuk
5bc24c8a20
chore: disable failing node compat test (#19811) 2023-07-12 19:30:37 +00:00
David Sherret
80331d1fe5
fix(lsp): stop diagnostics flickering (#19803)
Closes https://github.com/denoland/vscode_deno/issues/835
2023-07-11 17:10:43 -04:00
David Sherret
830d10b171
refactor(lsp): update diagnostics.rs to use structs instead of records (#19799)
Part of https://github.com/denoland/vscode_deno/issues/835
2023-07-11 22:36:39 +02:00
Leo Kettmeir
9d5f6f67d6
fix(node/http): add destroy to FakeSocket (#19796)
Closes #19782
2023-07-11 15:08:35 +02:00
Leo Kettmeir
4cfc54931d
fix(node/http): allow callback in first argument of end call (#19778)
Closes #19762
2023-07-11 14:49:19 +02:00
David Sherret
be9e73d340
fix(lsp): remove quotes and period surrounding specifier in uncached messages (#19794) 2023-07-11 02:27:22 +00:00
David Sherret
0d8af65621
fix(lsp): exclude files in deno.json "exclude" (#19791)
Closes #19788
2023-07-10 21:03:19 -04:00
Cooper Benson
96efe3c176
refactor(cli): Creating a TestReporter trait (#19786)
This PR breaks the addition of the `TestReporter` trait and refactoring
of `PrettyTestReporter` out of #19747. The goal is to enable the
addition of test reporters, including machine readable output.
2023-07-10 18:12:33 -04:00
David Sherret
8dd9d5f523
refactor(lsp): move config file related code to config.rs (#19790)
Will make #19788 easier.
2023-07-10 21:45:09 +00:00
David Sherret
629d09b149
perf: add setup cache for node_modules folder (#19787)
Part of #19774. This makes it twice as fast on my machine.

Stores a file at `node_modules/.deno/setup-cache.bin`, which contains
information about how the node_modules folder is currently setup.
Obviously there is a risk that this information will get out of date
with the current folder structure.
2023-07-10 13:42:47 -04:00
David Sherret
fe91cd5b84
chore(tests): update info_with_compiled_source to use TestContextBuilder (#19783) 2023-07-10 14:01:01 +00:00
Leo Kettmeir
5cda141f2d
fix(node/http): server use FakeSocket and add end method (#19660)
Fixes #19324
2023-07-10 13:48:35 +02:00
Bartek Iwańczuk
1edc8693bf
chore: upgrade deno_core and rusty_v8 (#19773) 2023-07-09 22:48:47 +00:00
David Sherret
21cc279481
refactor: abstract away file system to be buried inside HttpCache (#19760)
This improves the HttpCache to make it being stored on the file system
an implementation detail.
2023-07-08 16:06:45 -04:00
David Sherret
f3095b8d31
chore: upgrade to dprint 0.39 (#19768) 2023-07-08 18:34:08 +00:00
Divy Srivastava
e4870d84be
perf(ext/node): native vectored write for server streams (#19752)
```
# main
$ ./load_test 10 0.0.0.0 8080 0 0
Using message size of 20 bytes
Running benchmark now...
Msg/sec: 106182.250000
Msg/sec: 110279.750000
^C

# this PR
$ ./load_test 10 0.0.0.0 8080 0 0
Using message size of 20 bytes
Running benchmark now...
Msg/sec: 131632.250000
Msg/sec: 134754.250000
^C
```
2023-07-07 22:17:08 +05:30
Matt Mastracci
7d022ad11a
fix(ext/http): Use brotli compression params (#19758)
Fixes #19737 by adding brotli compression parameters.

Time after:

`Accept-Encoding: gzip`:

```
real    0m0.214s
user    0m0.005s
sys     0m0.013s
```

`Accept-Encoding: br`:

Before:

```
real    0m10.303s
user    0m0.005s
sys     0m0.010s
```

After:

```
real    0m0.127s
user    0m0.006s
sys     0m0.014s
```
2023-07-07 10:46:56 -06:00
Divy Srivastava
75d2c045f7
perf(ext/websocket): optimize server websocket js (#19719)
Split from https://github.com/denoland/deno/pull/19686

- timestamp set to 0 for server websocket events.
- take fast call path with op_ws_send_binary.
2023-07-07 09:09:25 +05:30
Luca Casonato
679a0c428c
tests: add more jsxImportSource regression tests (#15592)
This commit adds some regression tests for using `jsxImportSource` in
the config file in combination with an import map.

These underlying issues were fixed by #15561.

Closes #13389
Closes #14723

---------

Co-authored-by: Aapo Alasuutari <aapo.alasuutari@gmail.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-07-07 01:22:22 +02:00
Bartek Iwańczuk
106e1bd90e
fix: remove unstable check for Deno.listenTls#alpnProtocols (#19732) 2023-07-06 13:45:15 +00:00
Bartek Iwańczuk
de630b9b78
perf(node/async_hooks): optimize AsyncLocalStorage (#19729)
This makes the implementation of "AsyncLocalStorage" from
"node:async_hooks" 3.5x faster than before for noop benchmark
(measuring baseline overhead). It's still 3.5x slower than not
using `AsyncLocalStorage` and 1.64x slower than using
noop promise hooks.
2023-07-06 13:05:10 +02:00
Divy Srivastava
57fae55d82
perf(ext/node): optimize net streams (#19678)
~4.5x improvement in `npm:ws` echo benchmark:

```
$ ./load_test 10 0.0.0.0 8080 0 0
Using message size of 20 bytes
Running benchmark now...
Msg/sec: 101083.750000
Msg/sec: 103606.000000
^C

$ ./load_test 10 0.0.0.0 8080 0 0
Using message size of 20 bytes
Running benchmark now...
Msg/sec: 24906.750000
Msg/sec: 28478.000000
^C
```
2023-07-05 22:45:10 +05:30