summaryrefslogtreecommitdiff
path: root/cli
AgeCommit message (Collapse)Author
2023-06-12chore: update clap (#19467)Leo Kettmeir
Also switches to use defer for all subcommands besides run.
2023-06-10chore(tests): test_util - Add `PathRef` (#19450)David Sherret
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-09chore: fix flaky package_json_auto_discovered_for_local_script_arg (#19445)David Sherret
2023-06-09perf(node): cache realpath_sync calls in read permission check (#19379)Gustrb
2023-06-09chore: fix flaky stdio_streams_are_locked_in_permission_prompt (#19443)David Sherret
2023-06-09fix(fmt): do not panic formatting json with multiple values (#19442)David Sherret
2023-06-09fix(config): do not canonicalize config file path before loading (#19436)David Sherret
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-09perf: add Tokio runtime monitor (#19415)Bartek Iwańczuk
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-09chore: forward v1.34.2 release commit to main (#19434)denobot
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-06-08chore(ext/node): revert changes to ClientRequest.onSocket (#19426)Bartek Iwańczuk
Partially reverts https://github.com/denoland/deno/pull/19340 because it causes hangs in some situations.
2023-06-08chore: Use relative paths for assert imports to avoid test flakes (#19427)Matt Mastracci
Tests occasionally fail if we get a bad gateway attempting to fetch the assertion module
2023-06-08refactor(compile): store the npm snapshot in the eszip (#19343)David Sherret
2023-06-08perf(ext/websocket): Reduce GC pressure & monomorpize op_ws_next_event (#19405)Matt Mastracci
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-08feat(node_compat): Add a write method to the FileHandle class (#19385)nasa
## 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-08feat(node_compat): Add a read method to the FileHandle class (#19359)nasa
ref: #19165 The FileHandle class has many missing methods compared to node.
2023-06-07refactor(core): use JoinSet instead of FuturesUnordered (#19378)Bartek Iwańczuk
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-07refactor: helpers methods on `TypeCheckMode` (#19393)David Sherret
2023-06-07fix(cli): formatting bench with colors (#19323)Mike Mulchrone
2023-06-06perf(cli): conditionally load typescript declaration files (#19392)David Sherret
Closes #18583
2023-06-06fix(repl): correctly print string exception (#19391)sigmaSd
Fixes a recent regression where `throw "hello"` in the repl prints `Uncaught undefined` instead of `throw "hello"`
2023-06-06fix(node/http): use fake socket and proper url handling (#19340)Leo Kettmeir
Fixes https://github.com/denoland/deno/issues/19349 --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-06-06feat(ext/node): Very basic node:http2 support (#19344)Matt Mastracci
This commit adds basic support for "node:http2" module. Not all APIs have been yet implemented, but this change already allows to use this module for some basic functions. The "grpc" package is still not working, but it's a good stepping stone. --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-06-06fix(ext/console): fix inspecting large ArrayBuffers (#19373)ud2
2023-06-06chore: upgrade to Rust 1.70.0 (#19345)David Sherret
Co-authored-by: linbingquan <695601626@qq.com>
2023-06-05fix: upgrade to deno_ast 0.27 (#19375)David Sherret
Closes #19148
2023-06-05chore: update deno_lint to 0.46.0 (#19372)Kenta Moriuchi
2023-06-05feat(node_compat): Add a close method to the FileHandle class. (#19357)nasa
## WHY ref: https://github.com/denoland/deno/issues/19165 The FileHandle class has many missing methods compared to node. Add these. ## WHAT - Add close method --------- Co-authored-by: Matt Mastracci <matthew@mastracci.com>
2023-06-05feat: add more options to Deno.inspect (#19337)Leo Kettmeir
For https://github.com/denoland/deno_std/issues/3404 --------- Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2023-06-05feat(runtime): support creating workers using custom v8 params (#19339)Mathias Lafeldt
In order to limit the memory usage of isolates via heap_limits.
2023-06-04fix(ext/web): Copy EventTarget list before dispatch (#19360)Koen
Related issue: https://github.com/denoland/deno/issues/19358. This is a regression that seems to have been introduced in https://github.com/denoland/deno/pull/18905. It looks to have been a performance optimization. The issue is probably easiest described with some code: ```ts const target = new EventTarget(); const event = new Event("foo"); target.addEventListener("foo", () => { console.log('base'); target.addEventListener("foo", () => { console.log('nested'); }); }); target.dispatchEvent(event); ``` Essentially, the second event listener is being attached while the `foo` event is still being dispatched. It should then not fire that second event listener, but Deno currently does.
2023-06-03refactor(core): remove force_op_registration and cleanup ↵Nayeem Rahman
JsRuntimeForSnapshot (#19353) Addresses https://github.com/denoland/deno/pull/19308#discussion_r1212248194. Removes force_op_registration as it is no longer necessary.
2023-06-02fix(node): map stdio [0, 1, 2] to "inherit" (#19352)Marvin Hagemeister
<!-- Before submitting a PR, please read https://deno.com/manual/contributing 1. Give the PR a descriptive title. Examples of good title: - fix(std/http): Fix race condition in server - docs(console): Update docstrings - feat(doc): Handle nested reexports Examples of bad title: - fix #7123 - update docs - fix bugs 2. Ensure there is a related issue and it is referenced in the PR text. 3. Ensure there are tests that cover the changes. 4. Ensure `cargo test` passes. 5. Ensure `./tools/format.js` passes without changing files. 6. Ensure `./tools/lint.js` passes. 7. Open as a draft PR if your work is still in progress. The CI won't run all steps, but you can add '[ci]' to a commit message to force it to. 8. If you would like to run the benchmarks on the CI, add the 'ci-bench' label. --> Internally, `node-tap` spawns a child process with `stdio: [0, 1, 2]`. Whilst we don't support passing fd numbers as an argument so far, it turns out that `[0, 1, 2]` is equivalent to `"inherit"` which we already support. See: https://nodejs.org/api/child_process.html#optionsstdio Mapping it to `"inherit"` is fine for us and gets us one step closer in getting `node-tap` working. I'm now at the stage where already the coverage table is shown 🎉
2023-06-02feat(node_compat): Added base implementation of FileHandle (#19294)nasa
<!-- Before submitting a PR, please read https://deno.com/manual/contributing 1. Give the PR a descriptive title. Examples of good title: - fix(std/http): Fix race condition in server - docs(console): Update docstrings - feat(doc): Handle nested reexports Examples of bad title: - fix #7123 - update docs - fix bugs 2. Ensure there is a related issue and it is referenced in the PR text. 3. Ensure there are tests that cover the changes. 4. Ensure `cargo test` passes. 5. Ensure `./tools/format.js` passes without changing files. 6. Ensure `./tools/lint.js` passes. 7. Open as a draft PR if your work is still in progress. The CI won't run all steps, but you can add '[ci]' to a commit message to force it to. 8. If you would like to run the benchmarks on the CI, add the 'ci-bench' label. --> ## WHY ref: https://github.com/denoland/deno/issues/19165 Node's fs/promises includes a FileHandle class, but deno does not. The open function in Node's fs/promises returns a FileHandle, which provides an IO interface to the file. However, deno's open function returns a resource id. ### deno ```js > const fs = await import("node:fs/promises"); undefined > const file3 = await fs.open("./README.md"); undefined > file3 3 > file3.read undefined Node: ``` ### Node ```js > const fs = await import("fs/promises"); undefined > const file3 = await fs.open("./tests/e2e_unit/testdata/file.txt"); undefined > file3 FileHandle { _events: [Object: null prototype] {}, _eventsCount: 0, _maxListeners: undefined, close: [Function: close], [Symbol(kCapture)]: false, [Symbol(kHandle)]: FileHandle {}, [Symbol(kFd)]: 24, [Symbol(kRefs)]: 1, [Symbol(kClosePromise)]: null } > file3.read [Function: read] ``` To be compatible with Node, deno's open function should also return a FileHandle. ## WHAT I have implemented the first step in adding a FileHandle. - Changed the return value of the open function to a FileHandle object - Implemented the readFile method in FileHandle - Add test code ## What to do next This PR is the first step in adding a FileHandle, and there are things that should be done next. - Add functionality equivalent to Node's FileHandle to FileHandle (currently there is only readFile) --------- Co-authored-by: Matt Mastracci <matthew@mastracci.com>
2023-06-02chore(node_compat): fix path strings generated by `setup.ts` (#19347)Hirotaka Tagawa / wafuwafu13
2023-06-02fix(node): don't close stdio streams (#19256)Bartek Iwańczuk
Closes https://github.com/denoland/deno/issues/19255 --------- Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2023-05-31refactor(core): don't pass op state to prepare_module_load() (#19332)Nayeem Rahman
It's not used anymore. Subsequently allows removing `ModuleMap::op_state`, allowing `ModuleMap` to have a sane default so `JsRuntime::module_map` no longer needs to be optional.
2023-05-31refactor(ext/http): Expose internal serveHttpOnListener API for HTTP2 (#19331)Matt Mastracci
For the first implementation of node:http2, we'll use the internal version of `Deno.serve` which allows us to listen on a raw TCP connection rather than a listener. This is mostly a refactoring, and hooking up of `op_http_serve_on` that was never previously exposed (but designed for this purpose).
2023-05-31fix(runtime): add missing SIGIOT alias to SIGABRT (#19333)Marvin Hagemeister
2023-05-31refactor: further work on node http client (#19327)Leo Kettmeir
Closes https://github.com/denoland/deno/issues/18300
2023-05-31chore(core): Split JsRuntimeForSnapshot from JsRuntime (#19308)Matt Mastracci
This cleans up `JsRuntime` a bit more: * We no longer print cargo's rerun-if-changed messages in `JsRuntime` -- those are printed elsewhere * We no longer special case the OwnedIsolate for snapshots. Instead we make use of an inner object that has the `Drop` impl and allows us to `std::mem::forget` it if we need to extract the isolate for a snapshot * The `snapshot` method is only available on `JsRuntimeForSnapshot`, not `JsRuntime`. * `OpState` construction is slightly cleaner, though I'd still like to extract more --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-05-31fix(node): add missing process.reallyExit method (#19326)Marvin Hagemeister
This PR adds the missing `process.reallyExit()` method to node's `process` object. Was [pinged on twitter](https://twitter.com/biwanczuk/status/1663326659787862017) regarding running the `fastify` test suite in node. They use `node-tap` which has been around arguably the longest of the test frameworks and relies on a couple of old APIs. They have `signal-exit` as a dependency which in turn [makes use of `process.reallyExit()`](https://github.com/tapjs/signal-exit/blob/8fa7fc9a9c63f559af43d292b7eb727901775507/src/index.ts#L19). That function cannot be found anywhere in their documentation, but exists at runtime. See https://github.com/nodejs/node/blob/6a6b3c54022104cc110ab09044a2a0cecb8988e7/lib/internal/bootstrap/node.js#L172 This doesn't yet make `node-tap` work, but gets us one step closer.
2023-05-30fix: do not show cache initialization errors if stderr is piped (#18920)David Sherret
Closes #18918
2023-05-30feat(runtime): add `WorkerLogLevel` (#19316)David Sherret
This is not really used yet, but provides some infrastructure for doing more fine grained logging in JS. I will add warn messages in a future PR.
2023-05-29chore: forward v1.34.1 to main (#19312)Bartek Iwańczuk
Co-authored-by: denobot <33910674+denobot@users.noreply.github.com> Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
2023-05-29fix: use proper ALPN protocols if HTTP client is HTTP/1.1 only (#19303)Bartek Iwańczuk
Closes https://github.com/denoland/deno/issues/16923 --------- Co-authored-by: crowlkats <crowlkats@toaxl.com> Co-authored-by: Matt Mastracci <matthew@mastracci.com>
2023-05-29test(ext/node): add os_test.ts (#19305)egg
Part of #17840 I haven't made any changes or additions to the tests themselves, just moved the tests over and updated to match. --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-05-29fix(node): http.IncomingMessageForClient.complete (#19302)Bartek Iwańczuk
Closes https://github.com/denoland/deno/issues/19238
2023-05-28refactor(core): remove ext: modules from the module map (#19040)Nayeem Rahman
Rather than disallowing `ext:` resolution, clear the module map after initializing extensions so extension modules are anonymized. This operation is explicitly called in `deno_runtime`. Re-inject `node:` specifiers into the module map after doing this. Fixes #17717.
2023-05-28chore: maybe fix cli/standalone/virtual_fs tests on main (#19295)David Sherret
Not sure why these don't fail on a PR run: https://github.com/denoland/deno/actions/runs/5102317156/jobs/9171796164 **Merge on approval**
2023-05-28chore: fix flaky test_include_dir_recursive (#19291)David Sherret
Maybe fixes this on main.