summaryrefslogtreecommitdiff
path: root/runtime/js
AgeCommit message (Collapse)Author
2024-05-14fix(runtime): output to stderr with colors if a tty and stdout is piped (#23813)David Sherret
This also fixes a bug where Deno would output to stderr with colours when piped and stdout was not piped.
2024-05-05fix(ext/node): don't rely on Deno.env to read NODE_DEBUG (#23694)Satya Rohith
This patch allows implementors to use ext/node without the need to implement Deno.env API. Closes https://github.com/denoland/deno/issues/23687
2024-05-05chore: fix outdated note in `runtime/js/README.md` (#23673)Antoine du Hamel
Refs: https://github.com/denoland/deno/commit/b4aa1530970f7b9cc4e6f2f27e077852c4e178d3 I also removed the note about this being a temporary solution, as it seems fair to assume it's unlikely to change in the foreseeable future, but I might be wrong. --------- Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2024-04-24feat: Add `deno serve` subcommand (#23511)Matt Mastracci
By default, `deno serve` will assign port 8000 (like `Deno.serve`). Users may choose a different port using `--port`. `deno serve /tmp/file.ts` `server.ts`: ```ts export default { fetch(req) { return new Response("hello world!\n"); }, }; ```
2024-04-24feat(ext/http): Implement request.signal for Deno.serve (#23425)Matt Mastracci
When the response has been successfully send, we abort the `Request.signal` property to indicate that all resources associated with this transaction may be torn down.
2024-04-19refactor(ext/http): extract 02_websocket.ts from 01_http.js (#23460)Matt Mastracci
Landing part of https://github.com/denoland/deno/pull/21903 This will allow us to more easily refactor `serveHttp` to live on top of `serve` by splitting the websocket code out. There's probably a lot more we could do here but this helps.
2024-04-19FUTURE: remove `Deno.customInspect` (#23453)Asher Gomez
2024-04-18chore: remove unused, unstable 'http' namespace (#23436)Matt Mastracci
Landing parts of #21903 in preparation for the removal of serveHttp.
2024-04-16fix(ext/node): dispatch beforeExit/exit events irrespective of listeners ↵Satya Rohith
(#23382) Closes https://github.com/denoland/deno/issues/23342 Closes https://github.com/denoland/deno/issues/21757
2024-04-15refactor: move lifecycle events dispatch to Rust (#23358)Bartek Iwańczuk
This commit moves logic of dispatching lifecycle events ( "load", "beforeunload", "unload") to be triggered from Rust. Before that we were executing scripts from Rust, but now we are storing references to functions from "99_main.js" and calling them directly. Prerequisite for https://github.com/denoland/deno/issues/23342
2024-04-10chore: update references to `deno_std` to use JSR (#23239)Asher Gomez
There are more uses of `deno.land/std` in the codebase, but for URL parsing purposes rather than network calls or documentation.
2024-04-09fix(ext/node): implement MessagePort.unref() (#23278)Satya Rohith
Closes https://github.com/denoland/deno/issues/23252 Closes https://github.com/denoland/deno/issues/23264
2024-04-08chore: update WPT (#23111)Asher Gomez
Should fix some of the current issues with the `wpt_epoch` workflow. See https://github.com/denoland/deno/actions/runs/8460701853/job/23179358486 --------- Co-authored-by: crowlkats <crowlkats@toaxl.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-04-07FUTURE(ext/fs): remove `Deno.FsWatcher.prototype.rid` (#23234)Asher Gomez
2024-04-07FUTURE(ext/fs): make `Deno.FsFile` constructor illegal (#23235)Asher Gomez
I'm unsure whether we're planning to make the `Deno.FsFile` constructor illegal or remove `FsFile` from the `Deno.*` namspace in Deno 2. Either way, this PR works towards the former. I'll create a superceding PR if the latter is planned instead. Towards #23089
2024-04-05FUTURE: remove deprecated APIs within workers (#23220)Asher Gomez
2024-04-04fix(ext/node): count MessagePort message listeners in ↵Satya Rohith
hasMessageEventListener (#23209)
2024-03-27FUTURE(ext/fs): remove `Deno.FsFile.rid` (#23087)Asher Gomez
Continues work from #23075. Towards #23089.
2024-03-27FUTURE: remove `Deno.resources()` (#23095)Asher Gomez
2024-03-26feat: remove deprecated methods from namespace with `DENO_FUTURE=1` (#23075)Asher Gomez
This change removes deprecated methods from the `Deno.*` namespace when the `DENO_FUTURE=1` environment variable is used. Note: this does not address deprecated class properties and methods. E.g. `Deno.Conn.rid`.
2024-03-24refactor(bench): align ops to testing ops (#23038)Bartek Iwańczuk
Internal refactor that changes how we use ops in `deno bench` subcommand. This brings it in line to what we do in `deno test` subcommand.
2024-03-22perf: warm expensive init code at snapshot time (#22714)Matt Mastracci
Slightly different approach to similar changes in #22386 Note that this doesn't use a warmup script -- we are actually just doing more work at snapshot time.
2024-03-21fix: do not memoize `Deno.ppid` (#23006)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/23004
2024-03-20fix(ext/node): FsWatcher ref and unref (#22987)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/22973 --------- Co-authored-by: Satya Rohith <me@satyarohith.com>
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-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-08refactor(ext/node): worker_threads.isMainThread setup (#22785)Bartek Iwańczuk
This commit changes how we figure out if we're running on main thread in `node:worker_threads` module. Instead of relying on quirky "magic variable" for a name to check if we're on main thread, we are now explicitly passing this information during bootstrapping of the runtime. As a side effect, `WorkerOptions.name` is more useful and matches what Node.js does more closely (though not fully). Towards https://github.com/denoland/deno/issues/22783
2024-03-07feat(ext/node): ref/unref on workers (#22778)Matt Mastracci
Implements ref/unref on worker to fix part of #22629
2024-03-08chore: upgrade deno_core (#22782)Bartek Iwańczuk
2024-03-06chore: upgrade deno_core (#22725)Nathan Whitaker
<!-- 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-03-01perf(cli): use new deno_core timers (#22569)Matt Mastracci
Improves #19100 Fixes #20356 Replaces #20428 Changes made in deno_core to support this: - [x] Errors must be handled in setTimeout callbacks - [x] Microtask ordering is not-quite-right - [x] Timer cancellation must be checked right before dispatch - [x] Timer sanitizer - [x] Move high-res timer to deno_core - [x] Timers need opcall tracing
2024-02-27perf(cli): reduce overhead in test registration (#22552)Matt Mastracci
- Removes the origin call, since all origins are the same for an isolate (ie: the main module) - Collects the `TestDescription`s and sends them all at the same time inside of an Arc, allowing us to (later on) re-use these instead of cloning. Needs a follow-up pass to remove all the cloning, but that's a thread that is pretty long to pull --------- Signed-off-by: Matt Mastracci <matthew@mastracci.com>
2024-02-23fix(ext/node): set correct process.argv0 (#22555)Satya Rohith
2024-02-18feat(fs): `Deno.FsFile.{isTerminal,setRaw}()` (#22234)Asher Gomez
Closes #22229. --------- Signed-off-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-02-15chore: add DENO_FUTURE env var (#22318)Divy Srivastava
Closes https://github.com/denoland/deno/issues/22315 ``` ~> DENO_FUTURE=1 target/debug/deno > globalThis.window undefined ```
2024-02-07chore: remove op_spawn_child test (#22314)Bartek Iwańczuk
This test is not needed because the op is not available to user code anymore. This brings number of ops exposed to user code down to 15.
2024-02-07chore: don't expose FFI ops to user code (#22313)Bartek Iwańczuk
This commit removes some not really necessary FFI tests and in effect removes them from being accessible from the user code. This lowers the number of ops accessible to user code to 16.
2024-02-07chore: upgrade deno_core to 0.259.0 (#22311)Bartek Iwańczuk
This update brings number of ops available to user code down to 45.
2024-02-07refactor: move ImageData to web extension (#22295)Leo Kettmeir
Signed-off-by: Leo Kettmeir <crowlkats@toaxl.com>
2024-02-07chore: remove unneeded benchmark (#22300)Bartek Iwańczuk
Brings down the number of ops available to user code to 49.
2024-02-06refactor: use web utils and lazy load utils from core (#22289)Leo Kettmeir
2024-02-06fix: Support Symbol.metadata (#22282)Bartek Iwańczuk
This commit adds support for "Symbol.metadata" which was omitted when adding support for the Decorators Proposal. Closes https://github.com/denoland/deno/issues/22111
2024-02-06chore(ws): remove unused op_ws_send_pong (#22283)Divy Srivastava
2024-02-06refactor: don't expose some ops (#22281)Bartek Iwańczuk
This commit brings down the number of ops exposed to user code to 51.
2024-02-06refactor: don't expose worker ops to user code (#22276)Bartek Iwańczuk
2024-02-06refactor: don't expose ops to user code (#22273)Bartek Iwańczuk
Brings the number of ops exposed to user code down to 58.
2024-02-05refactor(cli): Move op descriptions into Rust and prepare for op import (#22271)Matt Mastracci
This moves the op sanitizer descriptions into Rust code and prepares for eventual op import from `ext:core/ops`. We cannot import these ops from `ext:core/ops` as the testing infrastructure ops are not always present. Changes: - Op descriptions live in `cli` code and are currently accessible via an op for the older sanitizer code - `phf` dep moved to workspace root so we can use it here - `ops.op_XXX` changed to to `op_XXX` to prepare for op imports later on.
2024-02-04chore: bump deno core (#22243)Matt Mastracci
Migrations: - Error registration no longer required for Interrupted or BadResource (these are core exception) - `include_js_files!`/`ExtensionFileSource` changes