summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2024-10-21feat(lsp): interactive inlay hints (#26382)Nayeem Rahman
2024-10-19chore: update nix crate (#26422)Leo Kettmeir
Dedupes nix dependency, since `rustyline` depends on a newer version that what we currently use
2024-10-18fix(info): resolve workspace member mappings (#26350)Marvin Hagemeister
This PR fixes the issue where mapped specifiers in a workspace member would never be found. Only mapped paths from the workspace root would resolve. This was caused by always passing the workspace root url to the import map resolver instead of the workspace member one. Fixes https://github.com/denoland/deno/issues/26138 Fixes https://github.com/denoland/fresh/issues/2615 --------- Signed-off-by: Marvin Hagemeister <marvinhagemeister50@gmail.com> Co-authored-by: David Sherret <dsherret@users.noreply.github.com>
2024-10-18fix(npm): ensure scoped package name is encoded in URLs (#26390)Marvin Hagemeister
Fixes https://github.com/denoland/deno/issues/26385
2024-10-17fix(install): don't attempt to cache specifiers that point to directories ↵Nathan Whitaker
(#26369) Fixes https://github.com/denoland/deno/issues/26162
2024-10-17chore: fix flaky COPYFILE_EXCL test (#26370)Nathan Whitaker
It was missing an await
2024-10-17fix(node/fs): copyFile with `COPYFILE_EXCL` should not throw if the ↵Nathan Whitaker
destination doesn't exist (#26360) Fixes #26313. We were checking for the NotFound error, but still calling the callback with the error / throwing.
2024-10-17fix(cli): set napi object property properly (#26344)LongYinan
<!-- Before submitting a PR, please read https://docs.deno.com/runtime/manual/references/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. -->
2024-10-16fix: don't warn on ignored signals on windows (#26332)Nathan Whitaker
Closes #26183. The warnings are super noisy and not actionable for the user
2024-10-17fix(node/http): normalize header names in `ServerResponse` (#26339)Nathan Whitaker
Fixes https://github.com/denoland/deno/issues/26115. We weren't normalizing the headers to lower case, so code that attempted to delete the `Content-Length` header (but used a different case) wasn't actually removing the header.
2024-10-16Reland feat(lsp): deno/didRefreshDenoConfigurationTree notifications (#26325)Nayeem Rahman
2024-10-16Revert "feat(lsp): "deno/didRefreshDenoConfigurationTree" notificatio… ↵Bartek Iwańczuk
(#26320) …ns (#26215)" This reverts commit 06778e4e9b0a856ac39cc01f0813e6076eb150d6 because benchmarks are failing on `main`.
2024-10-16fix(child_process): map node `--no-warnings` flag to `--quiet` (#26288)Nathan Whitaker
Closes https://github.com/denoland/deno/issues/25899
2024-10-16fix(add): exact version should not have range `^` specifier (#26302)Marvin Hagemeister
Fixes https://github.com/denoland/deno/issues/26299
2024-10-16feat(lsp): "deno/didRefreshDenoConfigurationTree" notifications (#26215)Nayeem Rahman
2024-10-16fix(ext/node): fix dns.lookup result ordering (#26264)Yoshiya Hinosawa
partially unblocks #25470 This PR aligns the resolution of `localhost` hostname to Node.js behavior. In Node.js `dns.lookup("localhost", (_, addr) => console.log(addr))` prints ipv6 address `::1`, but it prints ipv4 address `127.0.0.1` in Deno. That difference causes some errors in the work of enabling `createConnection` option in `http.request` (#25470). This PR fixes the issue by aligning `dns.lookup` behavior to Node.js. This PR also changes the following behaviors (resolving TODOs): - `http.createServer` now listens on ipv6 address `[::]` by default on linux/mac - `net.createServer` now listens on ipv6 address `[::]` by default on linux/mac These changes are also alignments to Node.js behaviors.
2024-10-16fix: node-api function call should use preamble (#26297)snek
`napi_call_function` should use our equiv of NAPI_PREAMBLE (`&mut Env` instead of `*mut Env`) since it needs to set error codes based on whether the body of the function raised a JS exception. Fixes: https://github.com/denoland/deno/issues/26282
2024-10-16fix(cli): consolidate pkg parser for install & remove (#26298)Satya Rohith
Closes https://github.com/denoland/deno/issues/26283
2024-10-16fix(ext/node): timingSafeEqual account for AB byteOffset (#26292)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/26276
2024-10-15fix: improve suggestions and hints when using CommonJS modules (#26287)Bartek Iwańczuk
Ref https://github.com/denoland/deno/issues/26225
2024-10-15fix: add hint for missing `document` global in terminal error (#26218)Bartek Iwańczuk
This came up on Discord as a question so I thought it's worth adding a hint for this as it might be a common pitfall. --------- Signed-off-by: Bartek Iwańczuk <biwanczuk@gmail.com> Co-authored-by: David Sherret <dsherret@users.noreply.github.com>
2024-10-15fix(add): create deno.json when running `deno add jsr:<pkg>` (#26275)Nathan Whitaker
Fixes https://github.com/denoland/deno/issues/26119. Originally I wanted to put them in package.json if there's no deno.json, but on second thought it makes more sense to just create a deno.json
2024-10-15chore: upgrade to rust 1.81.0 (#26261)林炳权
2024-10-15fix(ext/node): implement TCP.setNoDelay (#26263)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/26177 The significant delay was caused by Nagel's algorithm + delayed ACKs in Linux kernels. Here's the [kernel patch](https://lwn.net/Articles/502585/) which added 40ms `tcp_default_delack_min` ``` $ deno run -A pg-bench.mjs # main Tue Oct 15 2024 12:27:22 GMT+0530 (India Standard Time): 42ms $ target/release/deno run -A pg-bench.mjs # this patch Tue Oct 15 2024 12:28:02 GMT+0530 (India Standard Time): 1ms ``` ```js import { Buffer } from "node:buffer"; import pg from 'pg' const { Client } = pg const client = new Client({ connectionString: 'postgresql://postgres:postgres@127.0.0.1:5432/postgres' }) await client.connect() async function fetch() { const startPerf = performance.now(); const res = await client.query(`select $1::int as int, $2 as string, $3::timestamp with time zone as timestamp, $4 as null, $5::bool as boolean, $6::bytea as bytea, $7::jsonb as json `, [ 1337, 'wat', new Date().toISOString(), null, false, Buffer.from('awesome'), JSON.stringify([{ some: 'json' }, { array: 'object' }]) ]) console.log(`${new Date()}: ${Math.round(performance.now() - startPerf)}ms`) } for(;;) await fetch(); ```
2024-10-15fix: do not panic running remote cjs module (#26259)David Sherret
Instead error.
2024-10-14feat(unstable): `--unstable-detect-cjs` for respecting explicit `"type": ↵David Sherret
"commonjs"` (#26149) When using the `--unstable-detect-cjs` flag or adding `"unstable": ["detect-cjs"]` to a deno.json, it will make a JS file CJS if the closest package.json contains `"type": "commonjs"` and the file is not an ESM module (no TLA, no `import.meta`, no `import`/`export`).
2024-10-14fix(console/ext/repl): support using parseFloat() (#25900)Mohammad Sulaiman
Fixes #21428 Co-authored-by: tannal <tannal2409@gmail.com>
2024-10-14fix(install): support installing npm package with alias (#26246)David Sherret
Just tried this out today and it wasn't properly implemented in https://github.com/denoland/deno/pull/24156
2024-10-14feat(cli): improve deno info output for npm packages (#25906)Luca Casonato
2024-10-14fix(ext/node): compute pem length (upper bound) for key exports (#26231)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/26188
2024-10-14fix(ext/node): allow writing to tty columns (#26201)Divy Srivastava
Behave similar to Node.js where modifying `stdout.columns` doesn't really resize the terminal. Ref https://github.com/nodejs/node/issues/17529 Fixes https://github.com/denoland/deno/issues/26196
2024-10-14fix(ext/napi): pass user context to napi_threadsafe_fn finalizers (#26229)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/26228
2024-10-12fix(node/util): export `styleText` from `node:util` (#26194)Nathan Whitaker
Fixes #26184. It was added but not publicly exported.
2024-10-12feat(npm): support `--allow-scripts` on `deno run` (and `deno add`, `deno ↵Nathan Whitaker
test`, etc) (#26075) Fixes https://github.com/denoland/deno/issues/25533. Fixes https://github.com/denoland/deno/issues/25396. Previously we only supported it on `deno install` and `deno cache`, which is annoying if you're using `nodeModulesDir: auto`. Also changes from printing output of lifecycle scripts directly to capturing the output and only printing it on error.
2024-10-11fix(node): make `process.stdout.isTTY` writable (#26130)Marvin Hagemeister
Fixes https://github.com/denoland/deno/issues/26123
2024-10-11fix(lsp): relative completions for bare import-mapped specifiers (#26137)Nayeem Rahman
2024-10-10fix(install): duplicate dependencies in `package.json` (#26128)Marvin Hagemeister
Fixes https://github.com/denoland/deno/issues/26120
2024-10-10fix(unstable/worker): ensure import permissions are passed (#26101)David Sherret
We only had integration tests for this and not an integration test. Closes #26074
2024-10-09fix: do not panic on wsl share file paths on windows (#26081)David Sherret
A test is going to fail on windows (I'm not on a windows machine atm, so running the CI to see what fails) Closes #26080
2024-10-09fix(repl): importing json files (#26053)Bartek Iwańczuk
Closes https://github.com/denoland/deno/issues/26041
2024-10-09fix(jupyter): keep running event loop when waiting for messages (#26049)Bartek Iwańczuk
Closes https://github.com/denoland/deno/issues/24421
2024-10-08fix: disable same-origin.html WPT (#26067)Leo Kettmeir
It's very flaky on CI
2024-10-08fix(ext/node): internal buffer length in readSync (#26064)Satya Rohith
Closes https://github.com/denoland/deno/issues/26054
2024-10-08fix(console): missing cause property on non-error objects (#26061)Marvin Hagemeister
Fixes https://github.com/denoland/deno/issues/26047
2024-10-07fix(lsp): exclude missing import quick fixes with bad resolutions (#26025)Nayeem Rahman
2024-10-07fix(ext/webstorage): make `getOwnPropertyDescriptor` with symbol return ↵Leo Kettmeir
`undefined` (#13348) Closes #13347
2024-10-07feat(ext/crypto): X448 support (#26043)Divy Srivastava
Signed-off-by: Divy Srivastava <dj.srivastava23@gmail.com>
2024-10-04refactor: improve node permission checks (#26028)David Sherret
Does less work when requesting permissions with `-A`
2024-10-04chore: enable lock_deno_json_package_json_deps (#26029)David Sherret
2024-10-04fix(node): fix worker_threads issues blocking Angular support (#26024)Nathan Whitaker
Fixes #22995. Fixes #23000. There were a handful of bugs here causing the hang (each with a corresponding minimized test): - We were canceling recv futures when `receiveMessageOnPort` was called, but this caused the "receive loop" in the message port to exit. This was due to the fact that `CancelHandle`s are never reset (i.e., once you `cancel` a `CancelHandle`, it remains cancelled). That meant that after `receieveMessageOnPort` was called, the subsequent calls to `op_message_port_recv_message` would throw `Interrupted` exceptions, and we would exit the loop. The cancellation, however, isn't actually necessary. `op_message_port_recv_message` only borrows the underlying port for long enough to poll the receiver, so the borrow there could never overlap with `op_message_port_recv_message_sync`. - Calling `MessagePort.unref()` caused the "receive loop" in the message port to exit. This was because we were setting `messageEventListenerCount` to 0 on unref. Not only does that break the counter when multiple `MessagePort`s are present in the same thread, but we also exited the "receive loop" whenever the listener count was 0. I assume this was to prevent the recv promise from keeping the event loop open. Instead of this, I chose to just unref the recv promise as needed to control the event loop. - The last bug causing the hang (which was a doozy to debug) ended up being an unfortunate interaction between how we implement our messageport "receive loop" and a pattern found in `npm:piscina` (which angular uses). The gist of it is that piscina uses an atomic wait loop along with `receiveMessageOnPort` in its worker threads, and as the worker is getting started, the following incredibly convoluted series of events occurs: 1. Parent sends a MessagePort `p` to worker 2. Parent sends a message `m` to the port `p` 3. Parent notifies the worker with `Atomics.notify` that a new message is available 4. Worker receives message, adds "message" listener to port `p` 5. Adding the listener triggers `MessagePort.start()` on `p` 6. Receive loop in MessagePort.start receives the message `m`, but then hits an await point and yields (before dispatching the "message" event) 7. Worker continues execution, starts the atomic wait loop, and immediately receives the existing notification from the parent that a message is available 8. Worker attempts to receive the new message `m` with `receiveMessageOnPort`, but this returns `undefined` because the receive loop already took the message in 6 9. Atomic wait loop continues to next iteration, waiting for the next message with `Atomic.wait` 10. `Atomic.wait` blocks the worker thread, which prevents the receive loop from continuing and dispatching the "message" event for the received message 11. The parent waits for the worker to respond to the first message, and waits 12. The thread can't make any more progress, and the whole process hangs The fix I've chosen here (which I don't particularly love, but it works) is to just delay the `MessagePort.start` call until the end of the event loop turn, so that the atomic wait loop receives the message first. This prevents the hang. --- Those were the main issues causing the hang. There ended up being a few other small bugs as well, namely `exit` being emitted multiple times, and not patching up the message port when it's received by `receiveMessageOnPort`.