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

9694 commits

Author SHA1 Message Date
David Sherret
015ea60d25
fix(lsp): don't pre-load documents matched in the config file's "exclude" (#19431)
This prevents documents specified in a deno.json's "exclude" from being
pre-loaded by the lsp.

For example, someone may have something like:

```jsonc
// deno.json
{
  "exclude": [
    "dist" // build directory
  ]
}
```
2023-06-13 15:48:53 -04:00
Leo Kettmeir
92e7287f4a
fix(node/buffer): make slice be the same as subarray (#19481) 2023-06-13 21:26:28 +02:00
Bartek Iwańczuk
7e81d3c876
perf(http): cache verified headers (#19465)
Use `Map` to cache validated HTTP headers. Cache
has a capacity of 4096 elements and it's cleared
once that capacity is reached.

In `preactssr` benchmark it lowers the time spent
when adding headers from 180ms to 2.5ms.
2023-06-13 21:13:34 +02:00
Matt Mastracci
133f9a952b
fix(ext/http): replace await Deno.serve with await Deno.serve().finished (#19485)
We have a bunch of these to clean up after we changed the API.
2023-06-13 18:05:23 +00:00
Matt Mastracci
72da18dd47
fix(ext/websockets): ensure we fully send frames before close (#19484)
Fixes #19483
2023-06-13 17:16:17 +00:00
Nayeem Rahman
ceb03cfb03
refactor(core): cleanup feature flags for js source inclusion (#19463)
Remove `ExtensionFileSourceCode::LoadedFromFsDuringSnapshot` and feature
`include_js_for_snapshotting` since they leak paths that are only
applicable in this repo to embedders. Replace with feature
`exclude_js_sources`. Additionally the feature
`force_include_js_sources` allows negating it, if both features are set.
We need both of these because features are additive and there must be a
way of force including sources for snapshot creation while still having
the `exclude_js_sources` feature. `force_include_js_sources` is only set
for build deps, so sources are still excluded from the final binary.

You can also specify `force_include_js_sources` on any extension to
override the above features for that extension. Towards #19398.

But there was still the snapshot-from-snapshot situation where code
could be executed twice, I addressed that by making `mod_evaluate()` and
scripts like `core/01_core.js` behave idempotently. This allowed
unifying `ext::init_ops()` and `ext::init_ops_and_esm()` into
`ext::init()`.
2023-06-13 09:45:06 -06:00
David Sherret
5348778666
fix(npm): warn when tarball contains hardlink or symlink (#19474)
This is to help us get some visibility into whether we need to support
this.
2023-06-13 09:48:13 -04:00
David Sherret
3191ffdaaf
chore(repl): mark some tests as flaky (#19475) 2023-06-13 09:36:21 -04:00
David Sherret
39bf1d2fd5
fix(lsp): update import map config when deno.json changes (#19476)
Half of #19468
2023-06-13 09:24:22 -04:00
Bartek Iwańczuk
07cbec4a82
fix(ext/node): handle 'upgrade' responses (#19412)
This commit adds support for "upgrade" events in "node:http"
"ClientRequest". Currently only "Websocket" upgrades are
handled. Thanks to this change package like "npm:puppeteer"
and "npm:discord" should work.

Closes https://github.com/denoland/deno/issues/18913
Closes https://github.com/denoland/deno/issues/17847
2023-06-13 14:11:27 +02:00
Kaique da Silva
44bd59c05e
test(ext/node): add fs dirent unit test from std (#19461)
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2023-06-13 15:32:02 +09:00
Leo Kettmeir
b4ae37a617
feat(node): HTTPS server (#19362) 2023-06-13 04:15:08 +02:00
Matt Mastracci
d2c638464d
chore(ext/http): fix github lint issue (#19479) 2023-06-13 02:59:41 +02:00
Matt Mastracci
397b22eccf
perf(ext/http): from_maybe_shared_unchecked for header values (#19478)
Prevents re-checking strings we already know are latin-1. Small
improvement: 115k->116k
2023-06-12 23:43:49 +00:00
Matt Mastracci
e8ed59208c
chore: No longer need a sparse checkout thanks to cargo sparse index (#19423)
`cargo`'s sparse index showed up in 1.68
2023-06-12 15:59:34 -06:00
Matt Mastracci
45e15674b7
chore(core): fix flaky flock_test on windows (#19477) 2023-06-12 20:30:29 +00:00
Leo Kettmeir
e1be2bb80d
chore: update clap (#19467)
Also switches to use defer for all subcommands besides run.
2023-06-12 13:54:04 +02:00
VlkrS
ea97af312f
feat: Adaptations to support OpenBSD port (#19153) 2023-06-12 13:14:27 +03:00
David Sherret
7f15126f23
chore(tests): test_util - Add PathRef (#19450)
This adds a new `PathRef` struct to test_util for making it easier to
work with paths in test code. I'm going to expand on this more in the
future.
2023-06-10 11:09:45 -04:00
Marvin Hagemeister
f3326eebd6
perf(serve): hoist promise error callback (#19456) 2023-06-10 12:17:56 +02:00
Bartek Iwańczuk
848cda619e
perf: optimize ByteString checks, hoist server rid getter (#19452)
Further improves preact SSR and express benches by about 2k RPS.

Ref https://github.com/denoland/deno/issues/19451
2023-06-09 22:45:56 +00:00
David Sherret
f99a849a5f
chore: fix flaky package_json_auto_discovered_for_local_script_arg (#19445) 2023-06-09 17:23:01 -04:00
Marvin Hagemeister
ed76456059
perf(serve): hoist repeated condition (#19449) 2023-06-09 23:21:26 +02:00
Gustrb
2b2eebd583
perf(node): cache realpath_sync calls in read permission check (#19379) 2023-06-09 14:41:18 -04:00
David Sherret
ff690b0ab4
chore: fix flaky stdio_streams_are_locked_in_permission_prompt (#19443) 2023-06-09 13:24:39 -04:00
David Sherret
748a102919
fix(fmt): do not panic formatting json with multiple values (#19442) 2023-06-09 16:38:38 +00:00
Bartek Iwańczuk
a4c760702b
chore: update release doc template (#19441)
That action is not working properly.
2023-06-09 14:59:15 +02:00
David Sherret
5df735d3da
fix(config): do not canonicalize config file path before loading (#19436)
I'm unsure why we canonicalize the config file path when loading and the
canonicalization is causing issues in #19431 because everything in the
lsp is not canonicalized except the config file (actually, the config
file is only canonicalized when auto-discovered and not whens pecified).
We also don't canonicalize module paths when loading them.

Canonicalization was added in https://github.com/denoland/deno/pull/7621
2023-06-09 08:56:11 -04:00
David Sherret
f182c8af87
chore(tests): add .use_symlinked_temp_dir() to TestBuilder (#19435)
This allows easily using a symlinked temporary directory, which is
useful for debugging issues locally that happen on the CI with a
symlinked temporary directory. For example:

```rs
let context = TestContextBuilder::new()
    .use_temp_cwd()
    .use_symlinked_temp_dir() // add this
    .build();
```
2023-06-09 08:40:10 -04:00
Bartek Iwańczuk
168eb8e01d
perf: add Tokio runtime monitor (#19415)
This commit adds ability to print metrics of the Tokio
runtime to the console by passing "DENO_TOKIO_METRICS=1"
env var.

Metrics will be printed every second, but this can be changed
by "DENO_TOKIO_METRICS_INTERVAL=500" env var.
2023-06-09 11:52:51 +00:00
denobot
1b26f3c726
chore: forward v1.34.2 release commit to main (#19434)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-06-09 02:17:03 +00:00
Leo Kettmeir
4bc95427b9
chore: update wpt (#19422) 2023-06-08 22:56:05 +02:00
David Sherret
524e426457
ci: use windows-xl runner for --release on main (#19429) 2023-06-08 15:27:31 -04:00
Bartek Iwańczuk
c775001466
chore(ext/node): revert changes to ClientRequest.onSocket (#19426)
Partially reverts https://github.com/denoland/deno/pull/19340
because it causes hangs in some situations.
2023-06-08 20:32:26 +02:00
Matt Mastracci
1d4c66308c
fix(ext/websocket): Close socket on bad string data (#19424) 2023-06-08 18:29:26 +00:00
Matt Mastracci
db9482d688
chore: Use relative paths for assert imports to avoid test flakes (#19427)
Tests occasionally fail if we get a bad gateway attempting to fetch the
assertion module
2023-06-08 18:10:37 +00:00
David Sherret
55f0150854
refactor(compile): store the npm snapshot in the eszip (#19343) 2023-06-08 11:48:29 -04:00
Matt Mastracci
976c381045
perf(ext/websocket): Reduce GC pressure & monomorpize op_ws_next_event (#19405)
Reduce the GC pressure from the websocket event method by splitting it
into an event getter and a buffer getter.

Before:
165.9k msg/sec

After:
169.9k msg/sec
2023-06-08 09:32:08 -06:00
Matt Mastracci
f35161d3c5
chore: Ensure we only end up with the clang version we want & upgrade libffi (#19421)
The number of clang versions installed on the build machines is too dang
high.
2023-06-08 15:16:24 +00:00
nasa
caad79ef78
feat(node_compat): Add a write method to the FileHandle class (#19385)
## WHY 

ref: https://github.com/denoland/deno/issues/19165

The FileHandle class has many missing methods compared to node.

## WHAT


Add write method
2023-06-08 08:47:12 -06:00
nasa
262571e63e
feat(node_compat): Add a read method to the FileHandle class (#19359)
ref: #19165

The FileHandle class has many missing methods compared to node.
2023-06-08 06:37:19 -06:00
Bartek Iwańczuk
0197f42e6b
perf: use sendto syscalls (#19414)
This switches syscall used in HTTP and WS server from "writev"
to "sendto".

"DENO_USE_WRITEV=1" can be used to enable using "writev" syscall.
Doing this for easier testing of various setups.
2023-06-08 12:55:33 +02:00
Bartek Iwańczuk
dd6458b30a
chore: upgrade to Rust 1.68.2 (#19416)
Also prints disk size in release builds.
2023-06-08 04:04:07 +02:00
Bartek Iwańczuk
90c2bcdcf8
fix(napi): don't panic if symbol can't be found (#19397)
This should return an error to the caller to make it
easier to track what went wrong. 

Should help with debugging https://github.com/denoland/deno/issues/19389
2023-06-07 23:26:41 +00:00
David Sherret
21084a127f
chore: downgrade to Rust 1.68 (#19411)
Problems still persist from https://github.com/denoland/deno/pull/19407
-- downgrading to try out 1.68
2023-06-07 22:40:44 +00:00
David Sherret
794f731238
ci: output file system space before and after building (#19409)
This will help give us better insight.
2023-06-07 17:57:36 -04:00
Bartek Iwańczuk
19f82b0eaa
refactor(core): use JoinSet instead of FuturesUnordered (#19378)
This commit migrates "deno_core" from using "FuturesUnordered" to
"tokio::task::JoinSet". This makes every op to be a separate Tokio task
and should unlock better utilization of kqueue/epoll.

There were two quirks added to this PR:
- because of the fact that "JoinSet" immediately polls spawn tasks,
op sanitizers can give false positives in some cases, this was
alleviated by polling event loop once before running a test with 
"deno test", which gives canceled ops an opportunity to settle
- "JsRuntimeState::waker" was moved to "OpState::waker" so that FFI
API can still use threadsafe functions - without this change the
registered wakers were wrong as they would not wake up the 
whole "JsRuntime" but the task associated with an op

---------

Co-authored-by: Matt Mastracci <matthew@mastracci.com>
2023-06-07 23:50:14 +02:00
David Sherret
7e91f74d2b
chore: downgrade to Rust 1.69 (#19407) 2023-06-07 21:02:43 +00:00
David Sherret
da9db887e3
refactor: helpers methods on TypeCheckMode (#19393) 2023-06-07 10:09:10 -04:00
Mike Mulchrone
28ce0ef583
fix(cli): formatting bench with colors (#19323) 2023-06-07 12:27:25 +02:00