summaryrefslogtreecommitdiff
path: root/runtime/js
AgeCommit message (Collapse)Author
2023-02-23fix(core): remove async op inlining optimization (#17899)Divy Srivastava
Runtime generation of async op wrappers contributed to increased startup time and core became unusable with `--disallow-code-generation-from-strings` flag. The optimization only affects very small microbenchmarks so this revert will not cause any regressions.
2023-02-22perf(core, runtime): Further improve startup time (#17860)Bartek Iwańczuk
This commit further improves startup time by: - no relying on "JsRuntime::execute_script" for runtime bootstrapping, this is instead done using V8 APIs directly - registering error classes during the snapshot time, instead of on startup Further improvements can be made, mainly around removing "core.initializeAsyncOps()" which takes around 2ms. This commit should result in ~1ms startup time improvement.
2023-02-16test: add unit tests from std/node (#17794)Bartek Iwańczuk
Adds two test files: "cli/tests/unit_node/process_test.ts" and "cli/tests/unit_node/child_process_test.ts" --------- Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2023-02-14feat(ext/node): embed std/node into the snapshot (#17724)Bartek Iwańczuk
This commit moves "deno_std/node" in "ext/node" crate. The code is transpiled and snapshotted during the build process. During the first pass a minimal amount of work was done to create the snapshot, a lot of code in "ext/node" depends on presence of "Deno" global. This code will be gradually fixed in the follow up PRs to migrate it to import relevant APIs from "internal:" modules. Currently the code from snapshot is not used in any way, and all Node/npm compatibility still uses code from "https://deno.land/std/node" (or from the location specified by "DENO_NODE_COMPAT_URL"). This will also be handled in a follow up PRs. --------- Co-authored-by: crowlkats <crowlkats@toaxl.com> Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com> Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2023-02-14feat: stabilize Deno.osUptime() (#17554)Bartek Iwańczuk
This commit stabilizes "Deno.osUptime()" API. The "--unstable" flag is no longer required to use this API.
2023-02-13feat: Stabilize Deno.Command API (#17628)Bartek Iwańczuk
This commit stabilizes "Deno.Command" API with all its related APIs. "--unstable" flag is no longer required to use this API.
2023-02-12fix: add WouldBlock error (#17339)Leo Kettmeir
2023-02-08refactor: internal runtime code TS support (#17672)Leo Kettmeir
This is a proof of concept for being able to snapshot TypeScript files. Currently only a single runtime file is authored in TypeScript - "runtime/js/01_version.ts". Not needed infrastructure was removed from "core/snapshot_util.rs". --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-02-07 refactor: remove prefix from include_js_files & use extension name (#17683)Leo Kettmeir
2023-02-07refactor: Use ES modules for internal runtime code (#17648)Leo Kettmeir
This PR refactors all internal js files (except core) to be written as ES modules. `__bootstrap`has been mostly replaced with static imports in form in `internal:[path to file from repo root]`. To specify if files are ESM, an `esm` method has been added to `Extension`, similar to the `js` method. A new ModuleLoader called `InternalModuleLoader` has been added to enable the loading of internal specifiers, which is used in all situations except when a snapshot is only loaded, and not a new one is created from it. --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-01-30chore: update webgpu (#17534)Leo Kettmeir
2023-01-25fix: remove leftover Deno.spawn references (#17524)David Sherret
2023-01-25feat: Add sync APIs for "Deno.permissions" (#17019)Asher Gomez
This commit adds sync versions of async APIs to "Deno.permissions" namespace. Following APIs were added: - "Deno.permissions.querySync" - "Deno.permissions.requestSync" - "Deno.permissions.revokeSync"
2023-01-24refactor: remove Deno.core (#16881)Bartek Iwańczuk
This commit removes "Deno.core" namespace. It is strictly private API that has no stability guarantees, we were supposed to remove it long time ago. Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2023-01-24feat(runtime/command): make stdin default to inherit for spawn() (#17334)Leo Kettmeir
Closes #17230
2023-01-20feat: Stabilize Deno.Listener.ref/unref (#17477)Bartek Iwańczuk
2023-01-16chore: update dlint to v0.37.0 for GitHub Actions (#17295)Kenta Moriuchi
Updated third_party dlint to v0.37.0 for GitHub Actions. This PR includes following changes: * fix(prefer-primordials): Stop using array pattern assignments * fix(prefer-primordials): Stop using global intrinsics except for `SharedArrayBuffer` * feat(guard-for-in): Apply new guard-for-in rule
2023-01-16refactor(core): rename pending_promise_exception to ↵Bartek Iwańczuk
pending_promise_rejection (#17441) These are technically rejections - a rejection can then raise an exception.
2023-01-13chore: add `copyright_checker` tool and add the missing copyright (#17285)Yiyu Lin
2023-01-13fix: make self and window getters only & make getterOnly ignore setting (#17362)Leo Kettmeir
2023-01-12feat: allow passing a ReadableStream to Deno.writeFile/Deno.writeTextFile ↵Leo Kettmeir
(#17329) Closes #13229
2023-01-09feat(runtime/os): add `Deno.env.has()` (#17315)Leo Kettmeir
2023-01-06fix(core): get v8 console from context extra bindings (#17243)Chengzhong Wu
Explicitly get `console` object from V8 instead of relying on `console` defined on the global object.
2023-01-06perf(ext,runtime): remove using `SafeArrayIterator` from `for-of` (#17255)Kenta Moriuchi
2023-01-03fix(permissions): process `URL` in `Deno.FfiPermissionDescriptor.path` for ↵Asher Gomez
`revoke()` and `request()` (#17094) Previously, `Deno.permissions.[revoke|request]()` wouldn't correctly process the `path: URL` when `name` was `ffi`. This change fixes that behaviour and adds a new function, `formDescriptor()`, to ensure `URL` arguments are consistently handled across `Deno.permissions.[query|revoke|request]()`.
2023-01-02chore: update copyright year to 2023 (#17247)David Sherret
Yearly tradition of creating extra noise in git.
2022-12-28fix(node): Add op_node_unstable_os_uptime to allow for node interop (#17208)Kamil Ogórek
2022-12-27feat(unstable): Add "Deno.osUptime()" API (#17179)Kamil Ogórek
This PR adds support for `Deno.osUptime` which reports number of seconds since os was booted. It will allow us to be compatible with Node's `os.uptime` - https://nodejs.org/api/os.html#osuptime Partially based on https://docs.rs/uptime_lib/latest/src/uptime_lib/lib.rs.html
2022-12-20chore: Update dlint (#17031)Kenta Moriuchi
Introduces `SafeSetIterator` and `SafeMapIterator` to primordials
2022-12-17fix(runtime): `Deno.memoryUsage().rss` should return correct value (#17088)David Sherret
This commit changes implementation of "Deno.memoryUsage()" to return correct value for "rss" field. To do that we implement a specialized function per os to retrieve this information.
2022-12-13feat: support `createNew` in `Deno.writeFile` (#17023)Leo Kettmeir
2022-12-13fix: default to `"inherit"` for `Deno.Command#spawn()`'s `stdout` & `stderr` ↵Leo Kettmeir
(#17025)
2022-12-09unstable: remove Deno.spawn, Deno.spawnSync, Deno.spawnChild APIs (#16893)Bartek Iwańczuk
This commit removes three unstable Deno APIs: - "Deno.spawn()" - "Deno.spawnSync()" - "Deno.spawnChild()" These APIs were replaced by a unified "Deno.Command" API.
2022-11-28feat(unstable): rework Deno.Command (#16812)Leo Kettmeir
Refactors the `Deno.Command` class to not handle any state, but only being an intermediary to calling its methods, and as such any methods and properties besides `output`, `outputSync` & `spawn` have been removed. Interracting with a `spawn`ed subprocess now works by using the methods and properties on the returned class of the `spawn` method.
2022-11-21feat(core): Ability to create snapshots from existing snapshots (#16597)Bartek Iwańczuk
Co-authored-by: crowlkats <crowlkats@toaxl.com>
2022-11-17fix(ext/webstorage): make web storages re-assignable (#16661)Yoshiya Hinosawa
2022-11-15perf(runtime/spawn): collect output using `op_read_all` (#16596)Marcos Casagrande
**This patch** ``` benchmark time (avg) (min … max) p75 p99 p995 ------------------------------------------------- ----------------------------- echo deno 23.99 ms/iter (22.51 ms … 33.61 ms) 23.97 ms 33.61 ms 33.61 ms cat 16kb 24.27 ms/iter (22.5 ms … 35.21 ms) 24.2 ms 35.21 ms 35.21 ms cat 1mb 25.88 ms/iter (25.04 ms … 30.28 ms) 26.12 ms 30.28 ms 30.28 ms cat 15mb 38.41 ms/iter (35.7 ms … 50 ms) 38.31 ms 50 ms 50 ms ``` **main** ``` benchmark time (avg) (min … max) p75 p99 p995 ------------------------------------------------- ----------------------------- echo deno 35.66 ms/iter (34.53 ms … 41.84 ms) 35.79 ms 41.84 ms 41.84 ms cat 16kb 35.99 ms/iter (34.52 ms … 44.94 ms) 36.05 ms 44.94 ms 44.94 ms cat 1mb 38.68 ms/iter (36.67 ms … 50.44 ms) 37.95 ms 50.44 ms 50.44 ms cat 15mb 48.4 ms/iter (46.19 ms … 58.41 ms) 49.16 ms 58.41 ms 58.41 ms ```
2022-11-13feat(unstable): "Deno.Command()" API (#16516)Leo Kettmeir
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-11-11feat: Stabilize Deno.bench() and 'deno bench' subcommand (#16485)Bartek Iwańczuk
2022-11-10feat: don't require --unstable flag for npm programs (#16520)Bartek Iwańczuk
This PR adds copies of several unstable APIs that are available in "Deno[Deno.internal].nodeUnstable" namespace. These copies do not perform unstable check (ie. don't require "--unstable" flag to be present). Otherwise they work exactly the same, including permission checks. These APIs are not meant to be used by users directly and can change at any time. Copies of following APIs are available in that namespace: - Deno.spawnChild - Deno.spawn - Deno.spawnSync - Deno.serve - Deno.upgradeHttpRaw - Deno.listenDatagram
2022-11-09feat: stabilize Deno.uid() and Deno.gid() (#16424)Colin Ihrig
Closes https://github.com/denoland/deno_std/issues/2791
2022-11-09feat: stabilize Deno.systemMemoryInfo() (#16445)Colin Ihrig
2022-11-09feat: stabilize Deno.networkInterfaces() (#16451)Colin Ihrig
2022-10-29fix(core): fix APIs not to be affected by `Promise.prototype.then` ↵Kenta Moriuchi
modification (#16326)
2022-10-28Reland "perf(core): generate inlined wrappers for async ops" (#16455)Divy Srivastava
Reland https://github.com/denoland/deno/pull/16428
2022-10-27fix: finish stabilizing Deno.osRelease() (#16447)Colin Ihrig
Fixes: https://github.com/denoland/deno/issues/16446
2022-10-27Revert "perf(core): generate inlined wrappers for async ops (#16428)" (#16443)Divy Srivastava
2022-10-27perf(core): generate inlined wrappers for async ops (#16428)Divy Srivastava
V8's JIT can do a better job knowing the argument count and also enable fast call path (in future). This also lets us call async ops without `opAsync`: ```js const { ops } = Deno.core; await ops.op_void_async(); ``` this patch: 4405286 ops/sec main: 3508771 ops/sec
2022-10-26chore(unstable): rename Deno.getUid() and Deno.getGid() (#16432)Colin Ihrig
This commit renames `Deno.getUid()` to `Deno.uid()` and renames `Deno.getGid()` to `Deno.gid()`.
2022-10-26feat(runtime): make kill signal optional (#16299)Leo Kettmeir
This commit changes "Deno.kill()" method to have a default value, that is "SIGTERM".