summaryrefslogtreecommitdiff
path: root/runtime
AgeCommit message (Collapse)Author
2024-11-18feat(ext/http): Make http server parameters configurable (#26785)Yusuke Tanaka
This commit makes http server parameters configurable on the extension initialization via two callbacks users can provide. The main motivation behind this change is to allow `deno_http` users to tune the HTTP/2 server to suit their needs, although Deno CLI users will not benefit from it as no JavaScript interface is exposed to set these parameters currently. It is up to users whether to provide hook functions. If not provided, the default configuration from hyper crate will be used.
2024-11-18feat(runtime): remove public OTEL trace API (#26854)Luca Casonato
This PR removes the public Deno.tracing.Span API. We are not confident we can ship an API that is better than the `@opentelemetry/api` API, because V8 CPED does not support us using `using` to manage span context. If this changes, we can revisit this decision. For now, users wanting custom spans can instrument their code using the `@opentelemetry/api` API and `@deno/otel`. This PR also speeds up the OTEL trace generation by a 30% by using Uint8Array instead of strings for the trace ID and span ID.
2024-11-18perf(compile): code cache (#26528)David Sherret
Adds a lazily created code cache to `deno compile` by default. The code cache is created on first run to a single file in the temp directory and is only written once. After it's been written, the code cache becomes read only on subsequent runs. Only the modules loaded during startup are cached (dynamic imports are not code cached). The code cache can be disabled by compiling with `--no-code-cache`.
2024-11-16feat(jupyter): Add `Deno.jupyter.image` API (#26284)Bartek Iwańczuk
This commit adds `Deno.jupyter.image` API to display PNG and JPG images: ``` const data = Deno.readFileSync("./my-image.jpg"); Deno.jupyter.image(data); Deno.jupyter.image("./my-image.jpg"); ```
2024-11-15refactor: use boxed_error in some places (#26887)David Sherret
2024-11-15feat(ext/fetch): allow embedders to use `hickory_dns_resolver` instead of ↵Sahand Akbarzadeh
default `GaiResolver` (#26740) Allows embedders to use `hickory-dns-resolver` instead of threaded "getaddrinfo" resolver in the `fetch()` implementation.
2024-11-15perf: use available system memory for v8 isolate memory limit (#26868)Bartek Iwańczuk
Instead of using the default 1.4Gb limit (which was meant for browser tabs) configure V8 to set the heap limit to the amount of memory available in the system. Closes https://github.com/denoland/deno/issues/23424 Closes https://github.com/denoland/deno/issues/26435 Closes https://github.com/denoland/deno/issues/21226
2024-11-14feat(cli): add `--unstable-node-globals` flag (#26617)Marvin Hagemeister
This PR adds a new `--unstable-node-globals` flag to expose Node globals by default. Fixes https://github.com/denoland/deno/issues/26611 --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-11-14fix: otel resiliency (#26857)snek
Improving the breadth of collected data, and ensuring that the collected data is more likely to be successfully reported. - Use `log` crate in more places - Hook up `log` crate to otel - Switch to process-wide otel processors - Handle places that use `process::exit` Also adds a more robust testing framework, with a deterministic tracing setting. Refs: https://github.com/denoland/deno/issues/26852
2024-11-13feat(node): stabilize detecting if CJS via `"type": "commonjs"` in a ↵David Sherret
package.json (#26439) This will respect `"type": "commonjs"` in a package.json to determine if `.js`/`.jsx`/`.ts`/.tsx` files are CJS or ESM. If the file is found to be ESM it will be loaded as ESM though.
2024-11-13feat: OpenTelemetry Tracing API and Exporting (#26710)snek
Initial import of OTEL code supporting tracing. Metrics soon to come. Implements APIs for https://jsr.io/@deno/otel so that code using OpenTelemetry.js just works tm. There is still a lot of work to do with configuration and adding built-in tracing to core APIs, which will come in followup PRs. --------- Co-authored-by: Luca Casonato <hello@lcas.dev>
2024-11-12fix(permissions): say to use --allow-run instead of --allow-all (#26842)David Sherret
For https://github.com/denoland/deno/issues/26839
2024-11-12chore: make fields public on `PermissionDeniedError` and ↵Richard Carson
`deno_kv::KvConfig` (#26798) A few small changes to avoid needing unsafe mem transmutes to instantiate the extensions --------- Signed-off-by: Richard Carson <Rscarson@rogers.com>
2024-11-12fix(ext/node): handle `--allow-sys=inspector` (#26836)Divy Srivastava
`op_inspector_open` checks for "inspector" as one of the allowed sys value.
2024-11-10fix(ext/webstorage): use error class for sqlite error case (#26806)Leo Kettmeir
Fixes #26797
2024-11-10chore: forward v2.0.6 release commit to main (#26804)denobot
This is the release commit being forwarded back to main for 2.0.6 Signed-off-by: Divy Srivastava <dj.srivastava23@gmail.com> Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2024-11-08fix: performance.timeOrigin (#26787)snek
`performance.timeOrigin` was being set from when JS started executing, but `op_now` measures from an `std::time::Instant` stored in `OpState`, which is created at a completely different time. This caused `performance.timeOrigin` to be very incorrect. This PR corrects the origin and also cleans up some of the timer code. Compared to `Date.now()`, `performance`'s time origin is now consistently within 5us (0.005ms) of system time. ![image](https://github.com/user-attachments/assets/0a7be04a-4f6d-4816-bd25-38a2e6136926)
2024-11-06refactor: use concrete error type for remaining ops (#26746)Leo Kettmeir
2024-11-06fix(ext/node): better inspector support (#26471)snek
implement local inspector future changes: - wire up InspectorServer to enable open/close/url - wire up connectToMainThread Fixes https://github.com/denoland/deno/issues/25004
2024-11-06chore: forward v2.0.5 release commit to main (#26755)denobot
This is the release commit being forwarded back to main for 2.0.5 Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
2024-11-04refactor(runtime/permissions): use concrete error types (#26464)Leo Kettmeir
2024-11-04chore: update dlint to v0.68.0 for internal (#26711)Kenta Moriuchi
2024-11-01fix: improved support for cjs and cts modules (#26558)David Sherret
* cts support * better cjs/cts type checking * deno compile cjs/cts support * More efficient detect cjs (going towards stabilization) * Determination of whether .js, .ts, .jsx, or .tsx is cjs or esm is only done after loading * Support `import x = require(...);` Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-11-01chore: upgrade to rust 1.82 and LLVM 19 (#26615)Divy Srivastava
Upgrade to rust 1.82 and LLVM 19 . Removes one webusb test because `requestAdapter` not working on new ubuntu 24 runners
2024-10-31fix(node): Implement `os.userInfo` properly, add missing `toPrimitive` (#24702)Nathan Whitaker
Fixes the implementation of `os.userInfo`, and adds a missing `toPrimitive` for `tmpdir`. This allows us to enable the corresponding node_compat test.
2024-10-31fix: clamp smi in fast calls by default (#26506)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/26480 Ref https://github.com/denoland/deno_core/commit/d2945fb65bca56ebfa7bb80556a4c8f4330d2315
2024-10-30chore: forward v2.0.4 release commit to main (#26636)denobot
This is the release commit being forwarded back to main for 2.0.4 Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
2024-10-29fix: provide hints in terminal errors for Node.js globals (#26610)Bartek Iwańczuk
Add info/hint for terminal errors related to Node.js globals: - __filename - __dirname - Buffer - global - setImmediate - clearImmediate Closes https://github.com/denoland/deno/issues/17494
2024-10-25chore: forward v2.0.3 commit to main (#26535)Bartek Iwańczuk
Forwarding v2.0.3 commit to `main` Co-authored-by: denobot <33910674+denobot@users.noreply.github.com> Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
2024-10-24refactor(ext/node): use concrete error types (#26419)Leo Kettmeir
2024-10-24Revert "fix(runtime): send ws ping frames from inspector server (#263… ↵Bartek Iwańczuk
(#26513)
2024-10-23fix: share inotify fd across watchers (#26200)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/26104 Fixes https://github.com/denoland/deno/issues/26071 Fixes https://github.com/denoland/deno/issues/17757
2024-10-22refactor: add 'docs' suggestion (#26463)Bartek Iwańczuk
Adds another kind to `FixSuggestionKind` specifically for links documentation pages.
2024-10-22fix(cli): increase size of blocking task threadpool on windows (#26465)Nathan Whitaker
Fixes #26179. The original error reported in that issue is fixed on canary, but in local testing on my windows machine, `next build` would just hang forever. After some digging, what happens is that at some point in next build, readFile promises (from `fs/promises` ) just never resolve, and so next hangs. It turns out the issue is saturating tokio's blocking task thread pool. We previously limited the number of blocking threads to 32, and at some point those threads are all in use and there's no thread available for the file reads. What's taking up all of those threads? The answer turns out to be `tokio::process`. On windows, child process stdio uses the blocking threadpool: https://github.com/tokio-rs/tokio/pull/4824. When you poll the child's stdio on windows, it spawns a blocking task per poll, and calls `std::io::Read::read` in the blocking context. That call can block until data is available. Putting it all together, what happens is that Next.js spawns `2 * the number of CPU cores` deno child subprocesses to do work. We implement `child_process` with `tokio::process`. When the child processes' stdio get polled, blocking tasks get spawned, and those blocking tasks might block until data is available. So if you have 16 cores (as I do), there are going to be potentially >32 blocking task threadpool threads taken just by the child processes. That leaves no room for other tasks to make progress --- To fix this, for now, increase the size of the blocking threadpool on windows. 4 * the number of CPU cores should be enough to leave room for other tasks to make progress. Longer term, this can be fixed more properly when we handroll our own subprocess code (needed for detached processes and additional pipes on windows).
2024-10-22refactor(runtime/ops): use concrete error types (#26409)Leo Kettmeir
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-18refactor(ext/webgpu): use concrete error type (#26198)Leo Kettmeir
2024-10-19refactor(ext/fetch): use concrete error types (#26220)Leo Kettmeir
2024-10-18refactor(ext/http): use concrete error types (#26377)Leo Kettmeir
2024-10-18refactor(ext/crypto): use concrete error types (#26167)Leo Kettmeir
2024-10-18refactor(ext/websocket): use concrete error type (#26226)Leo Kettmeir
2024-10-18refactor(ext/fs): use concrete error types (#26317)Leo Kettmeir
2024-10-18chore: forward v2.0.2 release commit to main (#26376)denobot
This is the release commit being forwarded back to main for 2.0.2 Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-10-17refactor(ext/napi): use concrete error types (#26186)Leo Kettmeir
2024-10-17refactor(ext/web): use concrete error types (#26185)Leo Kettmeir
2024-10-17feat(permissions): expose PromptResponse (#26358)Lucas Nogueira
follow-up for #26327
2024-10-17refactor(ext/kv): use concrete error type (#26239)Leo Kettmeir
2024-10-17refactor(ext/net): use concrete error type (#26227)Leo Kettmeir
2024-10-17feat(permissions): expose PermissionPrompter and set_prompter function (#26327)Lucas Nogueira
when defining a custom runtime, it might be useful to define a custom prompter - for instance when you are not relying on the terminal and want a GUI prompter instead
2024-10-17fix(runtime): send ws ping frames from inspector server (#26352)Luca Casonato
Every 30 seconds the websocket server will now send a ping frame, so that the TCP socket stays alive.