summaryrefslogtreecommitdiff
path: root/runtime
AgeCommit message (Collapse)Author
2024-10-17refactor: use macros for signal table (#26214)Patrick Uftring
2024-10-16chore: forward v2.0.1 release commit to main (#26338)denobot
This is the release commit being forwarded back to main for 2.0.1 Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
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-15refactor: always apply hint when formatting JsError (#26252)Bartek Iwańczuk
Moves code for generating suggestions and hint to `cli/fmt_errors.rs`. This effectively applies suggestion to any place that format JS errors in terminal, like `deno test`. Addresses https://github.com/denoland/deno/pull/26218#issuecomment-2409139055
2024-10-15chore: upgrade to rust 1.81.0 (#26261)林炳权
2024-10-14refactor(ext/ffi): use concrete error types (#26170)Leo Kettmeir
2024-10-14refactor(ext/url): use concrete error types (#26172)Leo Kettmeir
2024-10-14refactor(ext/webstorage): use concrete error types (#26173)Leo Kettmeir
2024-10-12refactor(ext/tls): use concrete error types (#26174)Leo Kettmeir
2024-10-12refactor(ext/cron): use concrete error type (#26135)Leo Kettmeir
2024-10-12refactor(ext/canvas): use concrete error type (#26111)Leo Kettmeir
2024-10-12refactor(ext/cache): use concrete error type (#26109)Leo Kettmeir
2024-10-12refactor(ext/broadcastchannel): use concrete error type (#26105)Leo Kettmeir
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-082.0.0 (#26063)denobot
Bumped versions for 2.0.0 Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-10-04refactor: improve node permission checks (#26028)David Sherret
Does less work when requesting permissions with `-A`
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`.
2024-10-03fix: don't prompt when using `Deno.permissions.request` with `--no-prompt` ↵Simon Lecoq
(#25811)
2024-10-02chore: release deno_* crates (#25987)denobot
Testing once again if the crates are being properly released. --------- Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-10-02chore: release deno_* crates (#25976)denobot
Test run before Deno 2.0 release to make sure that the publishing process passes correctly. --------- Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-10-01feat: Add suggestion for packages using Node-API addons (#25975)Bartek Iwańczuk
This commit adds a suggestion with information and hint how to resolve situation when user tries to run an npm package with Node-API addons using global cache (which is currently not supported). Closes https://github.com/denoland/deno/issues/25974
2024-09-30refactor: bury descriptor parsing in PermissionsContainer (#25936)David Sherret
Closes https://github.com/denoland/deno/issues/25634
2024-09-29refactor: cleanup for creating worker structs (#25933)David Sherret
2024-09-28refactor: use deno_path_util (#25918)David Sherret
2024-09-27fix(node): Pass NPM_PROCESS_STATE to subprocesses via temp file instead of ↵Nathan Whitaker
env var (#25896) Fixes https://github.com/denoland/deno/issues/25401. Fixes https://github.com/denoland/deno/issues/25841. Fixes https://github.com/denoland/deno/issues/25891.
2024-09-27BREAKING(ext/net): improved error code accuracy (#25383)Luca Casonato
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-09-26feat: add `--allow-import` flag (#25469)Bartek Iwańczuk
This replaces `--allow-net` for import permissions and makes the security sandbox stricter by also checking permissions for statically analyzable imports. By default, this has a value of `--allow-import=deno.land:443,jsr.io:443,esm.sh:443,raw.githubusercontent.com:443,gist.githubusercontent.com:443`, but that can be overridden by providing a different set of hosts. Additionally, when no value is provided, import permissions are inferred from the CLI arguments so the following works because `fresh.deno.dev:443` will be added to the list of allowed imports: ```ts deno run -A -r https://fresh.deno.dev ``` --------- Co-authored-by: David Sherret <dsherret@gmail.com>
2024-09-26chore: cleanup unused deprecated code (#25839)Asher Gomez
2024-09-24fix: better error for Deno.UnsafeWindowSurface, correct HttpClient name, ↵Leo Kettmeir
cleanup unused code (#25833)
2024-09-23feat: make 'globalThis.location' a configurable property (#25812)Bartek Iwańczuk
This commit changes `globalThis.location` property to be configurable so that packages wanting to override it (or delete it) work properly. Towards https://github.com/denoland/deno/issues/23882 This change makes reproduction from https://github.com/denoland/deno/issues/23882#issuecomment-2340783437 pass properly.
2024-09-20fix(flags): properly error out for urls (#25770)Leo Kettmeir
Closes https://github.com/denoland/deno/issues/25760
2024-09-18fix: do not panic running invalid file specifier (#25530)Yazan AbdAl-Rahman
Co-authored-by: Bedis Nbiba <bedisnbiba@gmail.com>
2024-09-17chore: upgrade deno_core (#25674)Bartek Iwańczuk
No functional changes, just removes dead code.
2024-09-16chore: remove `warnOnDeprecatedApi()` (#25673)Asher Gomez
2024-09-16chore: lint `40_fs_events.js` (#25672)Asher Gomez
Fixes CI https://github.com/denoland/deno/actions/runs/10892648144/job/30225971485
2024-09-17chore(fs): undeprecate `Deno.FsWatcher.prototype.return()` (#25623)Asher Gomez
2024-09-16feat(permissions): `Deno.mainModule` doesn't require permissions (#25667)Nathan Whitaker
Closes https://github.com/denoland/deno/issues/7315.
2024-09-16refactor(permissions): split up Descriptor into Allow, Deny, and Query (#25508)David Sherret
This makes the permission system more versatile.
2024-09-16chore: cleanup remaining `internals.future` code (#25624)Asher Gomez
2024-09-14feat: print `Listening on` messages on stderr instead of stdout (#25491)Marvin Hagemeister
Fixes https://github.com/denoland/deno/issues/25114 --------- Signed-off-by: Leo Kettmeir <crowlkats@toaxl.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com> Co-authored-by: crowlkats <crowlkats@toaxl.com> Co-authored-by: Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com>
2024-09-13refactor(runtime): align error messages (#25563)Ian Bull
Aligns the error messages in the runtime folder to be in-line with the Deno style guide. https://github.com/denoland/deno/issues/25269
2024-09-12fix(ext/node): Implement detached option in `child_process` (#25218)Nathan Whitaker
Fixes https://github.com/denoland/deno/issues/25193.
2024-09-12refactor: cleanup unstable checks for WebGPU, FFI and FS APIs (#25586)Asher Gomez
Continuation of work in #25488. --------- Signed-off-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-09-12feat: stabilize `Deno.createHttpClient()` (#25569)Asher Gomez
Closes #25518
2024-09-10BREAKING(temporal/unstable): Remove obsoleted Temporal APIs part 2 (#25505)Kenta Moriuchi
Mainly I removed `Temporal.Calendar` and `Temporal.TimeZone` and replaced them to APIs that handle calendar and timezone as strings. https://github.com/tc39/proposal-temporal/pull/2925 Related #24836
2024-09-11BREAKING(fs): remove `Deno.FsFile.prototype.rid` (#25499)Asher Gomez
Towards #22079 --------- Signed-off-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-09-10feat(cli): use NotCapable error for permission errors (#25431)Luca Casonato
Closes #7394 --------- Co-authored-by: snek <snek@deno.com>
2024-09-09BREAKING(fs): remove `Deno.fsync[Sync]()` (#25448)Asher Gomez
Towards #22079 --------- Signed-off-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-09-09BREAKING: Remove `--unstable` flag (#25522)Bartek Iwańczuk
This commit effectively removes the --unstable flag. It's still being parsed, but it only prints a warning that a granular flag should be used instead and doesn't actually enable any unstable feature. Closes https://github.com/denoland/deno/issues/25485 Closes https://github.com/denoland/deno/issues/23237