summaryrefslogtreecommitdiff
path: root/runtime/js/99_main.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-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-19FUTURE: remove `Deno.customInspect` (#23453)Asher Gomez
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-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-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-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-08chore: upgrade deno_core (#22782)Bartek Iwańczuk
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-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-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
2024-02-02fix(jupyter): ensure op is available (#22240)Bartek Iwańczuk
Closes https://github.com/denoland/deno/issues/22231
2024-02-02docs: point to new "Deno 1.x to 2.x Migration Guide" (#22199)Asher Gomez
Signed-off-by: Asher Gomez <ashersaupingomez@gmail.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-01-31refactor: migrate runtime/ and ext/canvas/ to virtual ops module (#22196)Bartek Iwańczuk
2024-01-31refactor: remove imported ops from Deno.core.ops (#22194)Bartek Iwańczuk
This commit adds a list of ops to `runtime/99_main.js` that are currently relying on getting them from `Deno.core.ops`. All ops that are not present in the list are removed from `Deno.core.ops` on startup (they are imported from "virtual op module" - `ext:core/ops`) making them effectively inaccessible to user code. This change lowers the number of ops exposed to user code from 650 to around 260. This number should be gradually decreased in follow-up PRs.
2024-01-26fix: make deprecation warnings less verbose (#22128)Bartek Iwańczuk
This commit makes deprecation warnings less verbose by default. Only a single warnings is issued per deprecated API use. `DENO_VERBOSE_WARNINGS` env var can be provided to enable more detailed logging for each use of API including a stack trace. https://github.com/denoland/deno/assets/13602871/9c036c84-0044-4cb6-9c8e-deb641f43712
2024-01-24Revert "feat: deprecate `window` global (#22057)" (#22084)Bartek Iwańczuk
This reverts commit 930ce2087051b4e45b2026ce7a77c14360a6993f. This is producing false-positives that are not actionable to users. We're gonna address this in another release.
2024-01-24feat: Change deprecation warning formatting (#22080)Bartek Iwańczuk
Removes weird "frame like" characters and simplifies the output: ``` warning: Use of deprecated "Deno.isatty()" API. This API will be removed in Deno 2. Stack trace: at file:///Users/ib/dev/deno/foo.js:2:8 hint: Use `stdStream.isTerminal()` instead. warning: Use of deprecated "Deno.isatty()" API. This API will be removed in Deno 2. Stack trace: at file:///Users/ib/dev/deno/foo.js:7:8 hint: Use `stdStream.isTerminal()` instead. ``` https://github.com/denoland/deno/assets/13602871/7a6e24bf-44ec-4dbf-ac96-2af1db9f2ab9
2024-01-24feat: deprecate `Deno.close()` (#22066)Asher Gomez
For removal in Deno v2. --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-01-24feat: Add warnings for more deprecated APIs (#21992)Bartek Iwańczuk
Follow up to https://github.com/denoland/deno/pull/21939 that adds deprecation warnings to more `Deno` APIs: - `Deno.copy()` - `Deno.iter()` - `Deno.iterSync()` - `new Deno.Buffer()` - `Deno.readAll()` - `Deno.readAllSync()` - `Deno.writeAll()` - `Deno.writeAllSync()` - `Deno.FsWatcher.return` - `Deno.serveHttp()` - `Deno.metrics()` --------- Signed-off-by: Asher Gomez <ashersaupingomez@gmail.com> Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-01-24feat: deprecate `window` global (#22057)Bartek Iwańczuk
This commit deprecates `window` global and adds deprecation notice on each use of `window`. We decided to proceed with removal of `window` global variable in Deno 2.0. There's a lot of code in the wild that uses pattern like this: ``` if (typeof window !== "undefined) { ... } ``` to check if the code is being run in browser. However, this check passes fine in Deno and most often libraries that do this check try to access some browser API that is not available in Deno, or use DOM APIs (which are also not available in Deno). This situation has occurred multiple times already and it's unfeasible to expect the whole ecosystem to migrate to new check (and even if that happened there's a ton of code that's already shipped and won't change). The migration is straightfoward - replace all usages of `window` with `globalThis` or `self`. When Deno encounters use of `window` global it will now issue a warning, steering users towards required changes: ``` Warning ├ Use of deprecated "window" API. │ ├ This API will be removed in Deno 2.0. Make sure to upgrade to a stable API before then. │ ├ Suggestion: Use `globalThis` or `self` instead. │ ├ Suggestion: You can provide `window` in the current scope with: `const window = globalThis`. │ └ Stack trace: └─ at file:///Users/ib/dev/deno/foo.js:7:1 ``` Ref https://github.com/denoland/deno/issues/13367.
2024-01-24feat: deprecate `Deno.resources()` (#22059)Asher Gomez
Most uses of `Deno.resources()` within tests, as they previously checked for leaked resources. This is not needed as the test runner does this automatically. Other internal uses of this API have been replaced with the internal `Deno[Deno.internal].core.resources()`.
2024-01-23feat: Add deprecation warning for `Deno.customInspect` (#22027)Asher Gomez
This change sets the removal version of `Deno.customInspect` for Deno v2. Towards #22021 --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>