summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-04-17refactor(npm): add CliNodeResolver (#18742)David Sherret
2023-04-18chore: update node compat config (#18736)Yoshiya Hinosawa
2023-04-17chore(ext/fs): decouple fs trait from deno_core (#18732)Luca Casonato
This commit removes the dependencies on `deno_core` for the Fs trait. This allows to move the trait into a different crate that does not depend on core in the limit. This adds a new `bounds` field to `deno_core::extension!` that expands to `where` clauses on the generated code. This allows to add bounds to the extension parameters, such as `Fs::File: Resource`.
2023-04-17refactor(tests): Watcher test timeout (#18459)Cre3per
Closes #17438
2023-04-17test: don't silently fail in check_sockopt (#18737)Bartek Iwańczuk
2023-04-17docs(readme): Update readme (#18677)Andy Jiang
- updated examples - added more resources - added youtube --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-04-16fix(lsp): ensure language server status works on unix (#18727)David Sherret
Closes #18724
2023-04-16bench: add benchmark for deferred async ops (#18722)Bartek Iwańczuk
``` ./target/release/deno run cli/bench/async_ops_deferred.js time 794 ms rate 1259445 time 786 ms rate 1272264 time 770 ms rate 1298701 time 784 ms rate 1275510 time 775 ms rate 1290322 time 786 ms rate 1272264 time 773 ms rate 1293661 time 771 ms rate 1297016 time 774 ms rate 1291989 time 767 ms rate 1303780 time 764 ms rate 1308900 time 768 ms rate 1302083 time 763 ms rate 1310615 time 761 ms rate 1314060 time 761 ms rate 1314060 time 762 ms rate 1312335 time 763 ms rate 1310615 time 759 ms rate 1317523 time 760 ms rate 1315789 time 761 ms rate 1314060 time 769 ms rate 1300390 time 763 ms rate 1310615 time 760 ms rate 1315789 time 763 ms rate 1310615 time 761 ms rate 1314060 time 759 ms rate 1317523 time 765 ms rate 1307189 time 760 ms rate 1315789 time 764 ms rate 1308900 time 763 ms rate 1310615 time 760 ms rate 1315789 time 757 ms rate 1321003 time 763 ms rate 1310615 time 759 ms rate 1317523 time 771 ms rate 1297016 time 759 ms rate 1317523 time 759 ms rate 1317523 time 763 ms rate 1310615 time 754 ms rate 1326259 time 755 ms rate 1324503 time 762 ms rate 1312335 time 752 ms rate 1329787 time 755 ms rate 1324503 time 754 ms rate 1326259 time 759 ms rate 1317523 time 754 ms rate 1326259 time 749 ms rate 1335113 time 753 ms rate 1328021 time 756 ms rate 1322751 time 753 ms rate 1328021 ``` ``` samply record -r 20000 target/release/deno run cli/bench/async_ops_deferred.js ``` https://share.firefox.dev/43Efvm6
2023-04-16Revert "perf(core): immediately schedule another tick if there are un… ↵Bartek Iwańczuk
(#18718) …polled ops (#18611)" This reverts commit 4317055a3e49c7a75648480bbc86e4b466c60b5e. Reverting because we discovered while working on https://github.com/denoland/deno/pull/18619 that it doesn't work correctly (sometimes waker just stops working).
2023-04-15feat(kv): AtomicOperation#sum (#18704)Ryan Dahl
2023-04-14chore: fix running node tests in parallel on Windows (#18711)David Sherret
2023-04-14refactor: add `TypeChecker` struct (#18709)David Sherret
Adds a `TypeChecker` struct and pushes more shared functionality into it.
2023-04-14chore: remove node_modules folder being created in testdata directory (#18708)David Sherret
2023-04-14fix(core): Use safe primordials wrappers (#18687)Kenta Moriuchi
2023-04-14refactor: break up `ProcState` (#18707)David Sherret
1. Breaks up functionality within `ProcState` into several other structs to break out the responsibilities (`ProcState` is only a data struct now). 2. Moves towards being able to inject dependencies more easily and have functionality only require what it needs. 3. Exposes `Arc<T>` around the "service structs" instead of it being embedded within them. The idea behind embedding them was to reduce the verbosity of needing to pass around `Arc<...>`, but I don't think it was exactly working and as we move more of these structs to be more injectable I don't think the extra verbosity will be a big deal.
2023-04-14fix(ext/websocket): Avoid write deadlock that requires read_frame to ↵Divy Srivastava
complete (#18705) Fixes https://github.com/denoland/deno/issues/18700 Timeline of the events that lead to the bug. 1. WebSocket handshake complete 2. Server on `read_frame` holding an AsyncRefCell borrow of the WebSocket stream. 3. Client sends a TXT frame after a some time 4. Server recieves the frame and goes back to `read_frame`. 5. After some time, Server starts a `write_frame` but `read_frame` is still holding a borrow! ^--- Locked. read_frame needs to complete so we can resume the write. This commit changes all writes to directly borrow the `fastwebsocket::WebSocket` resource under the assumption that it won't affect ongoing reads.
2023-04-14chore: upgrade hyper to 0.14.26 (#18693)Bartek Iwańczuk
https://github.com/hyperium/hyper/releases/tag/v0.14.26
2023-04-14perf(core): immediately schedule another tick if there are unpolled ops (#18611)Bartek Iwańczuk
Currently we are "waking up" the runtime if at the end of the event loop tick there are ops that haven't been polled. Waking up incurs a syscall and it appears we can do another tick of the event loop, without going through the "wake up" machinery.
2023-04-14refactor(core): limit number of boundary crossings between Rust and V8 (#18652)Bartek Iwańczuk
This commit refactors "deno_core" to do fewer boundary crossings from Rust to V8. In other words we are now calling V8 from Rust fewer times. This is done by merging 3 distinct callbacks into a single one. Instead of having "op resolve" callback, "next tick" callback and "macrotask queue" callback, we now have only "Deno.core.eventLoopTick" callback, which is responsible for doing the same actions previous 3 callbacks. On each of the event loop we were doing at least 2 boundary crosses (timers macrotask queue callback and unhandled promise rejection callback) and up to 4 crosses if there were op response and next tick callbacks coming from Node.js compatibility layer. Now this is all done in a single callback. Closes https://github.com/denoland/deno/issues/18620
2023-04-13refactor(cli): add `Emitter` struct (#18690)David Sherret
Removes the functions in the `emit` module and replaces them with an `Emitter` struct that can have "ctor dependencies" injected rather than using functions to pass along the dependencies. This is part of a long term refactor to move more functionality out of proc state.
2023-04-13refactor(cli): move runTests() and runBenchmarks() to rust (#18563)Nayeem Rahman
Stores the test/bench functions in rust op state during registration. The functions are wrapped in JS first so that they return a directly convertible `TestResult`/`BenchResult`. Test steps are still mostly handled in JS since they are pretty much invoked by the user. Allows removing a bunch of infrastructure for communicating between JS and rust. Allows using rust utilities for things like shuffling tests (`Vec::shuffle`). We can progressively move op and resource sanitization to rust as well. Fixes #17122. Fixes #17312.
2023-04-13chore: bump child_process_test timeouts for slow CI (#18689)David Sherret
2023-04-13refactor: upgrade to deno_npm 0.3.0 (#18671)David Sherret
This allows us to specify the `@types/node` version constraint in the CLI instead of in deno_npm.
2023-04-13ci: don't run wpt tests on debug (#18688)David Sherret
2023-04-13chore: add test duration to WPT (#18680)Bartek Iwańczuk
To make it easier to debug which tests are slowing us down. Tests taking more than 5s have duration printed in red, taking more than 1s in yellow and less than 1s are printed without color.
2023-04-13chore: bump fastwebsockets to 0.1.3 (#18684)Divy Srivastava
Fixes build on aarch64 Linux. See https://github.com/littledivy/fastwebsockets/issues/2
2023-04-13perf(ops): directly respond for eager ops (#18683)Bartek Iwańczuk
This commit changes "eager ops" to directly return a response value instead of calling "opresponse" callback in JavaScript. This saves one boundary crossing and has a fantastic impact on the "async_ops.js" benchmark: ``` v1.32.4 $ deno run cli/bench/async_ops.js time 329 ms rate 3039513 time 322 ms rate 3105590 time 307 ms rate 3257328 time 301 ms rate 3322259 time 303 ms rate 3300330 time 306 ms rate 3267973 time 300 ms rate 3333333 time 301 ms rate 3322259 time 301 ms rate 3322259 time 301 ms rate 3322259 time 302 ms rate 3311258 time 301 ms rate 3322259 time 302 ms rate 3311258 time 302 ms rate 3311258 time 303 ms rate 3300330 ``` ``` this branch $ ./target/release/deno run -A cli/bench/async_ops.js time 257 ms rate 3891050 time 248 ms rate 4032258 time 251 ms rate 3984063 time 246 ms rate 4065040 time 238 ms rate 4201680 time 227 ms rate 4405286 time 228 ms rate 4385964 time 229 ms rate 4366812 time 228 ms rate 4385964 time 226 ms rate 4424778 time 226 ms rate 4424778 time 227 ms rate 4405286 time 228 ms rate 4385964 time 227 ms rate 4405286 time 228 ms rate 4385964 time 227 ms rate 4405286 time 229 ms rate 4366812 time 228 ms rate 4385964 ``` Prerequisite for https://github.com/denoland/deno/pull/18652
2023-04-13ci: use non-XL runners more (#18675)David Sherret
![image](https://user-images.githubusercontent.com/1609021/231593822-b9d7c9db-4416-4735-bd89-f28a260607f1.png) Non-xl runners are faster than the linux xl job, so let's use them for now Closes #17103
2023-04-13chore(docs): clarify what subcommands do not type-check by default (#18520)Geert-Jan Zwiers
The CLI docs suggested that all deno subcommands no longer type-check by default. This is only the case for some subcommands, and this PR clarifies the CLI docs in this regard.
2023-04-13refactor(cli,ext,ops): cleanup `regex` with `lazy-regex` (#17296)Yiyu Lin
- bump deps: the newest `lazy-regex` need newer `oncecell` and `regex` - reduce `unwrap` - remove dep `lazy_static` - make more regex cached --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-04-13refactor(serde_v8): move to `thiserror`, better error output (#18202)Yiyu Lin
Ref #17318 --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-04-13test(runtime): support Windows in resolve_from_cwd_absolute (#18379)Elijah
`current_dir().unwrap()` joined with a Path is equivalent to the implementation in `resolve_from_cwd()`. Manually tested on Ubuntu 22.04 and Windows 11. Signed-off-by: Elijah Conners <business@elijahpepe.com>
2023-04-13perf(ext/websocket): make `op_server_ws_next_event` deferred (#18632)Divy Srivastava
Avoid attempting to read immediately, wasting time polling the future. 2% throughput improvement on Linux.
2023-04-13fix(test): add process sigint handler for --watch (#18678)Nayeem Rahman
Fixes #18676.
2023-04-12fix(npm): eagerly reload package information when version from lockfile not ↵David Sherret
found locally (#18673) Closes #18624
2023-04-12refactor(ext/webidl): remove object from 'requiredArguments' (#18674)Bartek Iwańczuk
This should produce a little less garbage and using an object here wasn't really required. --------- Co-authored-by: Aapo Alasuutari <aapo.alasuutari@gmail.com> Co-authored-by: Leo Kettmeir <crowlkats@toaxl.com>
2023-04-12refactor: `ProcState::build` -> `ProcState::from_flags` (#18672)David Sherret
2023-04-12chore: fix windows clippy errors (#18670)David Sherret
2023-04-12chore: forward v1.32.4 release commit to main (#18669)denobot
Co-authored-by: levex <levex@users.noreply.github.com>
2023-04-12refactor(ext/fs): abstract FS via FileSystem trait (#18599)Luca Casonato
This commit abstracts out the specifics of the underlying system calls FS operations behind a new `FileSystem` and `File` trait in the `ext/fs` extension. This allows other embedders to re-use ext/fs, but substituting in a different FS backend. This is likely not the final form of these traits. Eventually they will be entirely `deno_core::Resource` agnostic, and will live in a seperate crate. --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-04-12fix(npm): cache bust npm specifiers more aggressively (#18636)David Sherret
Part 1: #18622 Part 2: This PR Closes #16901 --------- Co-authored-by: Luca Casonato <hello@lcas.dev>
2023-04-12fix(core): preserve syntax error locations in dynamic imports (#18664)Nayeem Rahman
Fixes #6259. Adds the location for v8 syntax errors to the message (`message += " at {location}"`) when rethrowing them for dynamic imports. Discussing with @bartlomieju on discord I proposed just preserving v8's error and not reconstructing it, allowing the standard stack trace to just point to the syntax error instead of the dynamic import. But on further thought this way has parity with SWC's syntax errors + has the advantage of showing both the syntax error and dynamic import location. ```ts // temp.js await import("./temp2.js"); // temp2.js function foo() { await Promise.resolve(); } // Before: // error: Uncaught (in promise) SyntaxError: Unexpected reserved word // await import("./temp2.js"); // ^ // at async file:///.../temp.js:1:1 // After: // error: Uncaught (in promise) SyntaxError: Unexpected reserved word at file:///.../temp2.js:2:3 // await import("./temp2.js"); // ^ // at async file:///.../temp.js:1:1 ```
2023-04-12fix(ext/cache): cache.put overwrites previous call (#18649)Satya Rohith
2023-04-12refactor(node/crypto): port polyfill to Rust for randomInt, randomFill, ↵Levente Kurusa
randomFillSync (#18658) Pretty much as per the title, I'd welcome some feedback especially around the array/buffer handling in the two randomFill functions.
2023-04-11fix(npm): do not "npm install" when npm specifier happens to match ↵David Sherret
package.json entry (#18660)
2023-04-11chore(cli): clean up unused number value (#18661)Geert-Jan Zwiers
This PR removes an accidentally declared number value.
2023-04-11fix(ext/kv): keys must be arrays (#18655)Luca Casonato
There was some leftover code from previous iterations, where keys could be single parts instead of arrays also. This didn't match the types.
2023-04-09chore: .gitignore spring cleaning (#18644)David Sherret
2023-04-08cleanup(core): Move `JsRealm` into a separate module (#18641)Andreu Botella
This will help make reviews easier for #15760, which moves a number of methods related to module loading from `JsRuntime` into `JsRealm`.
2023-04-08ci: do not run build job on draft prs (#18634)David Sherret
We had a PR land that didn't actually pass the steps because it passed on a draft pr. This prevents running the "build" job on draft prs.