summaryrefslogtreecommitdiff
path: root/cli
AgeCommit message (Collapse)Author
2023-04-25fix(ext/node): fix hash.flush (#18818)Yoshiya Hinosawa
2023-04-24refactor(ext/node): enforce interior mutable for `NodePermissions` to remove ↵David Sherret
clones (#18831) We can make `NodePermissions` rely on interior mutability (which the `PermissionsContainer` is already doing) in order to not have to clone everything all the time. This also reduces the chance of an accidental `borrow` while `borrrow_mut`.
2023-04-24fix(lsp): show dependency errors for repeated imports (#18807)Nayeem Rahman
2023-04-24refactor(ext/node): allow injecting `NodeFs` from CLI (#18829)David Sherret
This allows providing a `NodeFs` as part of the `WorkerOptions`.
2023-04-24feat(ext/http): h2c for http/2 (#18817)Matt Mastracci
This implements HTTP/2 prior-knowledge connections, allowing clients to request HTTP/2 over plaintext or TLS-without-ALPN connections. If a client requests a specific protocol via ALPN (`h2` or `http/1.1`), however, the protocol is forced and must be used.
2023-04-24fix(npm): only include top level packages in top level node_modules ↵David Sherret
directory (#18824) We were indeterministically including packages in the top level `node_modules/` folder when using a local node_modules directory. This change aligns with pnpm and only includes top level packages in this folder. This should be faster for initializing the folder, but may expose issues in packages that reference other packages not defined in their dependencies. That said, the behaviour previously was previously broken. This has exposed a bug in the require implementation where it doesn't find a package (which is the main underlying issue here). There is a failing test already for this in the test suite after this change. Closes #18822 --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-04-24docs: add categories to APIs without (#18826)Leo Kettmeir
2023-04-24test: disable flaky Node test (#18821)Bartek Iwańczuk
If we hit a slow runner this test almost always fails.
2023-04-23test: deflake worker tests (#18813)Bartek Iwańczuk
2023-04-23refactor: rewrite client side tests to 'fastwebsockets' crate (#18800)Bartek Iwańczuk
Follow up to https://github.com/denoland/deno/pull/18781.
2023-04-23tests: update tests relying on deno.land (#18811)Leo Kettmeir
2023-04-23fix(ext/http): ensure that multiple upgrades and multiple simultaneous ↵Matt Mastracci
requests cannot cause a panic (#18810) Fix a bug where we weren't saving `slabId` in #18619, plus add some robustness checks around multiple upgrades (w/test).
2023-04-22feat(ext/http): Rework Deno.serve using hyper 1.0-rc3 (#18619)Matt Mastracci
This is a rewrite of the `Deno.serve` API to live on top of hyper 1.0-rc3. The code should be more maintainable long-term, and avoids some of the slower mpsc patterns that made the older code less efficient than it could have been. Missing features: - `upgradeHttp` and `upgradeHttpRaw` (`upgradeWebSocket` is available, however). - Automatic compression is unavailable on responses.
2023-04-22feat(node/http): implement ClientRequest.setTimeout() (#18783)Levente Kurusa
- implement setTimeout with matching semantics of Node - add the test from Node but leave it turned off because ClientRequest has no underlying socket
2023-04-22refactor: rewrite tests to "fastwebsockets" crate (#18781)Bartek Iwańczuk
Migrating off of `tokio-tungstenite` crate. --------- Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2023-04-21refactor(node): move most of cli/node to ext/node (#18797)David Sherret
This is just a straight refactor and I didn't do any cleanup in ext/node. After this PR we can start to clean it up and make things private that don't need to be public anymore.
2023-04-21feat: upgrade deno_ast to 0.26 (#18795)David Sherret
Closes #18792
2023-04-21refactor: move some CJS and ESM code analysis to ext/node (#18789)David Sherret
2023-04-21fix(test): allow explicit undefined for boolean test options (#18786)Nayeem Rahman
Fixes #18784.
2023-04-21fix(ext/websocket): upgrade fastwebsockets to 0.2.4 (#18791)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/18775
2023-04-19fix(compile): write bytes directly to output file (#18777)David Sherret
1. Adds cli/standalone folder 2. Writes the bytes directly to the output file. When adding npm packages this might get quite large, so let's not keep the final output in memory just in case.
2023-04-19fix(test/coverage): exclude test files (#18748)Levente Kurusa
Fixes: #18454
2023-04-19fix(ext/node): implement asymmetric keygen (#18651)Divy Srivastava
Towards #18455 This commit implements the keypair generation for asymmetric keys for the `generateKeyPair` API. See how key material is managed in this implementation: https://www.notion.so/denolandinc/node-crypto-design-99fc33f568d24e47a5e4b36002c5325d?pvs=4 Private and public key encoding depend on `KeyObject#export` which is not implemented. I've also skipped ED448 and X448 since we need a crate for that in WebCrypto too.
2023-04-19fix(ext/node): improve vm.runInThisContext (#18767)Yoshiya Hinosawa
2023-04-19fix(ext/node): add crypto.sign|verify methods (#18765)Yoshiya Hinosawa
2023-04-19tests: disable another flaky test (#18762)Bartek Iwańczuk
This test is flaky too, it actually shouldn't be running since it's not listed in `cli/tests/node_compat/config.jsonc` at all.
2023-04-19chore: disable flaky Node compat tests (#18760)Bartek Iwańczuk
I'm not able to reproduce any of the failures from CI on my machine. I'm going to disable these tests for now as they are holding us back.
2023-04-18test: fix flaky worker test (#18754)Bartek Iwańczuk
https://github.com/denoland/deno/actions/runs/4734585198/jobs/8403719901?pr=18753
2023-04-18chore: forward v1.32.5 release commit to main (#18758)denobot
Co-authored-by: levex <levex@users.noreply.github.com> Co-authored-by: Levente Kurusa <lkurusa@kernelstuff.org>
2023-04-18refactor(node/crypto): scrypt polyfill to rust (#18746)Levente Kurusa
2023-04-18chore(ext/node): restore http_test from std (#18747)Yoshiya Hinosawa
2023-04-18fix(ext/node): implement crypto.createVerify (#18703)Yoshiya Hinosawa
2023-04-18fix(ext/node): add req.socket.remoteAddress (#18733)Yoshiya Hinosawa
2023-04-18fix(ext/node): polyfill response._implicitHeader method (#18738)Yoshiya Hinosawa
2023-04-17refactor(npm): add CliNodeResolver (#18742)David Sherret
2023-04-18chore: update node compat config (#18736)Yoshiya Hinosawa
2023-04-17refactor(tests): Watcher test timeout (#18459)Cre3per
Closes #17438
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-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-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