summaryrefslogtreecommitdiff
path: root/ext/websocket/02_websocketstream.js
AgeCommit message (Collapse)Author
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-01-26refactor: migrate extensions to virtual ops module (#22135)Bartek Iwańczuk
First pass of migrating away from `Deno.core.ensureFastOps()`. A few "tricky" ones have been left for a follow up.
2024-01-10refactor: use `core.ensureFastOps()` (#21888)Kenta Moriuchi
2024-01-04fix: strict type check for cross realms (#21669)Kenta Moriuchi
Deno v1.39 introduces `vm.runInNewContext`. This may cause problems when using `Object.prototype.isPrototypeOf` to check built-in types. ```js import vm from "node:vm"; const err = new Error(); const crossErr = vm.runInNewContext(`new Error()`); console.assert( !(crossErr instanceof Error) ); console.assert( Object.getPrototypeOf(err) !== Object.getPrototypeOf(crossErr) ); ``` This PR changes to check using internal slots solves them. --- current: ``` > import vm from "node:vm"; undefined > vm.runInNewContext(`new Error("message")`) Error {} > vm.runInNewContext(`new Date("2018-12-10T02:26:59.002Z")`) Date {} ``` this PR: ``` > import vm from "node:vm"; undefined > vm.runInNewContext(`new Error("message")`) Error: message at <anonymous>:1:1 > vm.runInNewContext(`new Date("2018-12-10T02:26:59.002Z")`) 2018-12-10T02:26:59.002Z ``` --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-01-01chore: update copyright to 2024 (#21753)David Sherret
2023-12-24chore: ensure that each op provided to ensureFastOps is only used once (#21689)Matt Mastracci
When we migrate to op-import-per-extension, we will want to ensure that ops have one and only one place where they are imported. This tackles the ops that are imported via `ensureFastOps`, but does not yet tackle direct `ops` imports. Landing ahead of https://github.com/denoland/deno_core/pull/393
2023-12-07refactor: pull 'core', 'internals', 'primordials' from ES module (#21462)Bartek Iwańczuk
This commit refactors how we access "core", "internals" and "primordials" objects coming from `deno_core`, in our internal JavaScript code. Instead of capturing them from "globalThis.__bootstrap" namespace, we import them from recently added "ext:core/mod.js" file.
2023-11-19fix(ext,runtime): add missing custom inspections (#21219)Kenta Moriuchi
2023-10-11feat(WebSocketStream): rename connection to opened (#20878)Leo Kettmeir
2023-09-07feat: support import attributes (#20342)David Sherret
2023-06-29fix(ext/websocket): Ensure that errors are available after async response ↵Matt Mastracci
returns (#19642) Fixes the WPT tests that test w/invalid codes. Also explicitly ignoring some h2 tests to hopefully prevent flakes. The previous changes to WebSocketStream introduced a bug where the close errors were not made available if the `pull` method was re-entrant.
2023-06-08perf(ext/websocket): Reduce GC pressure & monomorpize op_ws_next_event (#19405)Matt Mastracci
Reduce the GC pressure from the websocket event method by splitting it into an event getter and a buffer getter. Before: 165.9k msg/sec After: 169.9k msg/sec
2023-06-06perf(ext/websocket): Make send sync for non-stream websockets (#19376)Matt Mastracci
No need to go through the async machinery for `send(String | Buffer)` -- we can fire and forget, and then route any send errors into the async call we're already making (`op_ws_next_event`). Early benchmark on MacOS: Before: 155.8k msg/sec After: 166.2k msg/sec (+6.6%) Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-06-06refactor(core): ensureFastOps is an op-generating proxy (#19377)Matt Mastracci
Startup benchmark shows no changes (within 1ms, identical system/user times).
2023-05-01refactor: migrate async ops to generated wrappers (#18937)Bartek Iwańczuk
Migrates some of existing async ops to generated wrappers introduced in https://github.com/denoland/deno/pull/18887. As a result "core.opAsync2" was removed. I will follow up with more PRs that migrate all the async ops to generated wrappers.
2023-05-01fix(core): Use primordials for methods (#18839)Kenta Moriuchi
I would like to get this change into Deno before merging https://github.com/denoland/deno_lint/pull/1152
2023-05-01refactor(webidl): move prefix & context out of converters options bag (#18931)Leo Kettmeir
2023-04-26chore(ext/websocket): remove ping frame handling (#18847)Divy Srivastava
Automatically done in the fastwebsockets crate
2023-04-25refactor(ext/websocket): use specialized ops (#18819)Bartek Iwańczuk
Instead of relying on `op_ws_send` to send different kinds of messages, use specialized ops everywhere.
2023-04-20refactor(ext/websocket): use fastwebsockets client (#18725)Divy Srivastava
2023-04-14fix(core): Use safe primordials wrappers (#18687)Kenta Moriuchi
2023-04-12refactor(ext/webidl): remove object from 'requiredArguments' (#18674)Bartek Iwańczuk
This should produce a little less garbage and using an object here wasn't really required. --------- Co-authored-by: Aapo Alasuutari <aapo.alasuutari@gmail.com> Co-authored-by: Leo Kettmeir <crowlkats@toaxl.com>
2023-04-02chore: Turn back on dlintPreferPrimordials (#17715)Kenta Moriuchi
Closes #17709
2023-03-31perf(ext/websocket): efficient event kind serialization (#18509)Divy Srivastava
Use u16 to represent the kind of event (0 - 6) & event code > 6 is treated as the close code. This way we can represent all events + the close code in a single JS number. This is safe because (as per RFC 6455) close code from 0-999 are reserved & not used. | name | avg msg/sec/core | | --- | --- | | deno_main | `127820.750000` | | deno #18506 | `140079.000000` | | deno #18506 + this | `150104.250000` |
2023-03-08refactor: rename InternalModuleLoader to ExtModuleLoader, use ext: scheme ↵Bartek Iwańczuk
for snapshotted modules (#18041) This commit renames "deno_core::InternalModuleLoader" to "ExtModuleLoader" and changes the specifiers used by the modules loaded from this loader to "ext:". "internal:" scheme was really ambiguous and it's more characters than "ext:", which should result in slightly smaller snapshot size. Closes https://github.com/denoland/deno/issues/18020
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-02chore: update copyright year to 2023 (#17247)David Sherret
Yearly tradition of creating extra noise in git.
2022-11-01revert 9ea0ce61981aa09851c3d1e0a2b7dbd7f7a392f5 (#16501)Bartek Iwańczuk
Closes https://github.com/denoland/deno/issues/16450
2022-10-19perf(ext/websocket): optimize `op_ws_next_event` (#16325)Divy Srivastava
Towards https://github.com/denoland/deno/issues/16315
2022-09-27feat: Add requesting API name to permission prompt (#15936)Bartek Iwańczuk
Co-authored-by: Leo Kettmeir <crowlkats@toaxl.com>
2022-08-30fix(ext/websocket): fix closing of WebSocketStream with unread messages (#15632)Danny Povolotski
2022-08-11perf(ops): Monomorphic sync op calls (#15337)Aapo Alasuutari
Welcome to better optimised op calls! Currently opSync is called with parameters of every type and count. This most definitely makes the call megamorphic. Additionally, it seems that spread params leads to V8 not being able to optimise the calls quite as well (apparently Fast Calls cannot be used with spread params). Monomorphising op calls should lead to some improved performance. Now that unwrapping of sync ops results is done on Rust side, this is pretty simple: ``` opSync("op_foo", param1, param2); // -> turns to ops.op_foo(param1, param2); ``` This means sync op calls are now just directly calling the native binding function. When V8 Fast API Calls are enabled, this will enable those to be called on the optimised path. Monomorphising async ops likely requires using callbacks and is left as an exercise to the reader.
2022-07-18fix: WebSocketStream ping event causes pending promises (#15235)Leo Kettmeir
2022-04-04chore(ext/websocket): custom arity (#14202)Divy Srivastava
2022-02-07refactor: update runtime code for primordial check for iterators (#13510)Bartek Iwańczuk
2022-02-01refactor: primordials for instanceof (#13527)Bartek Iwańczuk
2022-01-27Revert "refactor: update runtime code for primordial checks for "instanceof" ↵Bartek Iwańczuk
(#13497)" (#13511) This reverts commit 884143218fad0e18f7553aaf079d52de703f7601.
2022-01-27refactor: update runtime code for primordial checks for "instanceof" (#13497)Bartek Iwańczuk
2022-01-07chore: update copyright to 2022 (#13306)Ryan Dahl
Co-authored-by: Erfan Safari <erfanshield@outlook.com>
2022-01-05feat(ext/websocket): add header support to WebSocketStream (#11887)Leo Kettmeir
2021-12-20fix(ext/websocket): WebSocketStream don't error with "sending after closing" ↵Leo Kettmeir
when closing (#13134)
2021-12-16feat: support abort reasons in Deno APIs and `WebSocketStream` (#13066)Andreu Botella
2021-10-19fix(ext/websocket): prevent 'closed normally' panic (#12437)Leo K
2021-10-05chore: various op cleanup (#12329)Leo K
2021-09-11refactor: use Deno.core.tryClose (#11980)Bartek Iwańczuk
2021-08-20chore: upgrade dlint and run `prefer-primordials` rule (#11777)Yusuke Tanaka
2021-08-11Rename extensions/ directory to ext/ (#11643)Ryan Dahl