summaryrefslogtreecommitdiff
path: root/runtime/web_worker.rs
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-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-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-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-10-22refactor(runtime/ops): use concrete error types (#26409)Leo Kettmeir
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-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-16refactor(permissions): split up Descriptor into Allow, Deny, and Query (#25508)David Sherret
This makes the permission system more versatile.
2024-09-04chore: remove some dead code around DENO_FUTURE env var (#25418)Bartek Iwańczuk
These codepaths were not used anymore.
2024-08-29fix(runtime/web_worker): populate `SnapshotOptions` for `WebWorker` when ↵Sʜɪᴍᴜʀᴀ Yū
instantiated without snapshot (#25280) Fixes #25277
2024-08-27feat(ext/kv): configurable limit params (#25174)Yusuke Tanaka
This commit makes various limit parameters in `deno_kv` configurable. Currently these values are declared as constants and thus can't be modified from outside. However, there may be situations where we want to change it. This commit makes this possible by introducing a new struct `KvConfig` that needs to be given as the 2nd param in `init_ops`.
2024-08-19feat: Deprecate "import assertions" with a warning (#24743)Bartek Iwańczuk
This commit deprecates "import assertions" proposal that has been replaced with "import attributes". Any time an import assertion is encountered a warning will be printed to the terminal. This warning will be printed for both local and remote files (ie. user code and dependencies). Import assertions support will be removed in Deno 2.
2024-07-29chore: upgrade to rust 1.80 (#24778)Satya Rohith
2024-07-25refactor: decouple node resolution from deno_core (#24724)David Sherret
2024-07-24Reland "fix: CFunctionInfo and CTypeInfo leaks (#24634)" (#24692)Bartek Iwańczuk
Reverted in https://github.com/denoland/deno/commit/95847f4e9443ad8c8e0504c9fdd1d7f8eb4e588f.
2024-07-22Revert "fix: CFunctionInfo and CTypeInfo leaks (#24634)" (#24665)Bartek Iwańczuk
This reverts commit 6c5905dbc354ae701f06c734608af834a0ba844c. Reverting because of errors like this in CI: ``` # # Fatal error in , line 0 # Check failed: FastApiCallNode::ArityForArgc(c_arg_count, slow_arg_count) == value_input_count. # # # #FailureMessage Object: 0x7fd5b3ffd9d0 ==== C stack trace =============================== /home/runner/work/deno/deno/target/release/deps/url_ops-e4068c650cedb9fa(+0x1111883) [0x55b8d2107883] /home/runner/work/deno/deno/target/release/deps/url_ops-e4068c650cedb9fa(+0x1110b6b) [0x55b8d2106b6b] /home/runner/work/deno/deno/target/release/deps/url_ops-e4068c650cedb9fa(+0x110c6f9) [0x55b8d21026f9] /home/runner/work/deno/deno/target/release/deps/url_ops-e4068c650cedb9fa(+0x20413cd) [0x55b8d30373cd] /home/runner/work/deno/deno/target/release/deps/url_ops-e4068c650cedb9fa(+0x2034222) [0x55b8d302a222] /home/runner/work/deno/deno/target/release/deps/url_ops-e4068c650cedb9fa(+0x202ff44) [0x55b8d3025f44] /home/runner/work/deno/deno/target/release/deps/url_ops-e4068c650cedb9fa(+0x1e0b253) [0x55b8d2e01253] /home/runner/work/deno/deno/target/release/deps/url_ops-e4068c650cedb9fa(+0x1dfcd96) [0x55b8d2df2d96] /home/runner/work/deno/deno/target/release/deps/url_ops-e4068c650cedb9fa(+0x1df92aa) [0x55b8d2def2aa] /home/runner/work/deno/deno/target/release/deps/url_ops-e4068c650cedb9fa(+0x1df8b71) [0x55b8d2deeb71] /home/runner/work/deno/deno/target/release/deps/url_ops-e4068c650cedb9fa(+0x11ce49b) [0x55b8d21c449b] /home/runner/work/deno/deno/target/release/deps/url_ops-e4068c650cedb9fa(+0x121fb23) [0x55b8d2215b23] /home/runner/work/deno/deno/target/release/deps/url_ops-e4068c650cedb9fa(+0x1221359) [0x55b8d2217359] /home/runner/work/deno/deno/target/release/deps/url_ops-e4068c650cedb9fa(+0x1112f3b) [0x55b8d2108f3b] /home/runner/work/deno/deno/target/release/deps/url_ops-e4068c650cedb9fa(+0x111792b) [0x55b8d210d92b] /home/runner/work/deno/deno/target/release/deps/url_ops-e4068c650cedb9fa(+0x110df0f) [0x55b8d2103f0f] /lib/x86_64-linux-gnu/libc.so.6(+0x94ac3) [0x7fd5cb294ac3] /lib/x86_64-linux-gnu/libc.so.6(+0x126850) [0x7fd5cb326850] ```
2024-07-21fix: CFunctionInfo and CTypeInfo leaks (#24634)Divy Srivastava
Trying out the deno_core patch Ref https://github.com/denoland/deno_core/pull/832 Closes https://github.com/denoland/deno/issues/24575 --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-07-05chore: rename `__runtime_js_source` to `hmr` (#24442)Divy Srivastava
Saves some keystrokes and easy to remember ``` cargo b --features hmr ```
2024-06-06refactor: remove `PermissionsContainer` in deno_runtime (#24119)David Sherret
Also removes permissions being passed in for node resolution. It was completely useless because we only checked it for reading package.json files, but Deno reading package.json files for resolution is perfectly fine. My guess is this is also a perf improvement because Deno is doing less work.
2024-05-09refactor(ext/tls): Implement required functionality for later SNI support ↵Matt Mastracci
(#23686) Precursor to #23236 This implements the SNI features, but uses private symbols to avoid exposing the functionality at this time. Note that to properly test this feature, we need to add a way for `connectTls` to specify a hostname. This is something that should be pushed into that API at a later time as well. ```ts Deno.test( { permissions: { net: true, read: true } }, async function listenResolver() { let sniRequests = []; const listener = Deno.listenTls({ hostname: "localhost", port: 0, [resolverSymbol]: (sni: string) => { sniRequests.push(sni); return { cert, key, }; }, }); { const conn = await Deno.connectTls({ hostname: "localhost", [serverNameSymbol]: "server-1", port: listener.addr.port, }); const [_handshake, serverConn] = await Promise.all([ conn.handshake(), listener.accept(), ]); conn.close(); serverConn.close(); } { const conn = await Deno.connectTls({ hostname: "localhost", [serverNameSymbol]: "server-2", port: listener.addr.port, }); const [_handshake, serverConn] = await Promise.all([ conn.handshake(), listener.accept(), ]); conn.close(); serverConn.close(); } assertEquals(sniRequests, ["server-1", "server-2"]); listener.close(); }, ); ``` --------- Signed-off-by: Matt Mastracci <matthew@mastracci.com>
2024-05-08chore: enable clippy::print_stdout and clippy::print_stderr (#23732)David Sherret
1. Generally we should prefer to use the `log` crate. 2. I very often accidentally commit `eprintln`s. When we should use `println` or `eprintln`, it's not too bad to be a bit more verbose and ignore the lint rule.
2024-03-16fix(ext/node): support MessagePort in `WorkerOptions.workerData` (#22950)Bartek Iwańczuk
This commit fixes passing `MessagePort` instances to `WorkerOptions.workerData`. Before they were not serialized and deserialized properly when spawning a worker thread. Closes https://github.com/denoland/deno/issues/22935
2024-03-15fix(ext/node): worker_threads doesn't exit if there are message listeners ↵Bartek Iwańczuk
(#22944) Closes https://github.com/denoland/deno/issues/22934
2024-03-13fix(ext/node): make worker ids sequential (#22884)Satya Rohith
2024-03-13fix(ext/node): allow automatic worker_thread termination (#22647)Satya Rohith
Co-authored-by: Matt Mastracci <matthew@mastracci.com>
2024-03-13chore: explicitly type `state.put` for permissions (#22881)Divy Srivastava
2024-03-12refactor: add `deno_permissions` crate (#22236)Divy Srivastava
Issue https://github.com/denoland/deno/issues/22222 ![image](https://github.com/denoland/deno/assets/34997667/2af8474b-b919-4519-98ce-9d29bc7829f2) This PR moves `runtime/permissions` code to a upstream crate called `deno_permissions`. The `deno_permissions::PermissionsContainer` is put into the OpState and can be used instead of the current trait-based permissions system. For this PR, I've migrated `deno_fetch` to the new crate but kept the rest of the trait-based system as a wrapper of `deno_permissions` crate. Doing the migration all at once is error prone and hard to review. Comparing incremental compile times for `ext/fetch` on Mac M1: | profile | `cargo build --bin deno` | `cargo plonk build --bin deno` | | --------- | ------------- | ------------------- | | `debug` | 20 s | 0.8s | | `release` | 4 mins 12 s | 1.4s |
2024-03-11fix(ext/node): make worker setup synchronous (#22815)Bartek Iwańczuk
This commit fixes race condition in "node:worker_threads" module were the first message did a setup of "threadId", "workerData" and "environmentData". Now this data is passed explicitly during workers creation and is set up before any user code is executed. Closes https://github.com/denoland/deno/issues/22783 Closes https://github.com/denoland/deno/issues/22672 --------- Co-authored-by: Satya Rohith <me@satyarohith.com>
2024-03-05chore: upgrade deno_core (#22699)Bartek Iwańczuk
Co-authored-by: Matt Mastracci <matthew@mastracci.com>
2024-02-27chore: bump deno_core (#22596)Matt Mastracci
Migrations: - snapshot code updated - runtime stats API tweaks
2024-02-10chore: deno_core bump (#22379)Matt Mastracci
- Updates to V8 12.1.285.27 https://github.com/denoland/rusty_v8/pull/1383 - Swaps Box for Rc for `source_map_getter`
2024-02-07refactor: extract out `runtime::colors` to `deno_terminal::colors` (#22324)David Sherret
2024-01-22fix(runtime): only discard extension sources if a snapshot is provided (#22023)Nayeem Rahman
Fixes #21928. We have a code path which empties the extension sources because they're expected to be pre-executed in the snapshot. Instead of using conditional compilation for that, we now just check if a snapshot was provided. Removes the `dont_use_runtime_snapshot` feature. We didn't allow not providing a snapshot unless this feature was provided, now we always do. Adds the `only_snapshotted_js_sources` feature for us to use in CLI. This asserts that a snapshot is provided and gates the runtime transpilation code so it isn't included in the executable.
2024-01-22feat(web): ImageBitmap (#21898)Leo Kettmeir
2024-01-14chore: upgrade deno_core to 0.246.0 (#21904)Bartek Iwańczuk
2024-01-10refactor: remove snapshotting from deno_runtime (#21794)Bartek Iwańczuk
Closes https://github.com/denoland/deno/issues/21137
2024-01-10chore: bump deno_core (#21832)Matt Mastracci
2024-01-01chore: update copyright to 2024 (#21753)David Sherret
2023-12-28fix: allow npm: specifiers in import.meta.resolve (#21716)Bartek Iwańczuk
Closes https://github.com/denoland/deno/issues/21298. "npm:" specifiers are matched against import map entries and if no match is found they are passed through.
2023-12-13refactor(cli): update to new deno_core promise/call methods (#21519)Matt Mastracci
2023-12-09feat: bring back WebGPU (#20812)Leo Kettmeir
Signed-off-by: Leo Kettmeir <crowlkats@toaxl.com> Co-authored-by: Kenta Moriuchi <moriken@kimamass.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-12-08chore: use primordials in 40_testing.js (#21422)Divy Srivastava
This commit brings back usage of primordials in "40_testing.js" by turning it back into an ES module and using new "lazy loading" functionality of ES modules coming from "deno_core". The same approach was applied to "40_jupyter.js". Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-12-06chore: bump deno_core and update tests (#21467)Matt Mastracci
Landing changes required for https://github.com/denoland/deno_core/pull/359 We needed to update 99_main.js and a whole load of tests. API changes: - setPromiseRejectCallback becomes setUnhandledPromiseRejectionHandler. The function is now called from eventLoopTick. - The promiseRejectMacrotaskCallback no longer exists, as this is automatically handled in eventLoopTick. - ops.op_dispatch_exception now takes a second parameter: in_promise. The preferred way to call this op is now reportUnhandledException or reportUnhandledPromiseRejection.
2023-12-05refactor(cli): refactor bench/test for future module changes (#21460)Matt Mastracci
Extracting some refactorings for the module work that will land in https://github.com/denoland/deno_core/pull/359/
2023-12-02refactor: snapshotting of runtime/ and cli/ (#21430)Bartek Iwańczuk
This commit removes some of the technical debt related to snapshotting JS code: - "cli/ops/mod.rs" and "cli/build.rs" no longer define "cli" extension which was not required anymore - Cargo features for "deno_runtime" crate have been unified in "cli/Cargo.toml" - "cli/build.rs" uses "deno_runtime::snapshot::create_runtime_snapshot" API instead of copy-pasting the code - "cli/js/99_main.js" was completely removed as it's not necessary anymore Towards https://github.com/denoland/deno/issues/21137
2023-11-28chore: fix formatting (#21364)David Sherret
2023-11-27chore: bump deno_core (#21351)Matt Mastracci