summaryrefslogtreecommitdiff
path: root/runtime/web_worker.rs
AgeCommit message (Collapse)Author
2023-03-06refactor: use v8::String::new_external_onebyte_static where appropriate (#18051)Bartek Iwańczuk
2023-03-05refactor(runtime): merge "spawn" into "process" (#18022)Bartek Iwańczuk
This commit merges "runtime/js/40_spawn.js" into "runtime/js/40_process.js", and "runtime::ops::spawn" into "runtime::ops::process". It makes little sense to have them separated given that we want to factor out these APIs into a separate extension crate.
2023-03-05refactor(runtime): factor out deno_io extension crate (#18001)Bartek Iwańczuk
This is a prerequisite to factor out FS ops to a separate crate.
2023-03-05refactor(runtime): factor out FsPermissions for fs ops (#18012)Bartek Iwańczuk
This will help us with moving fs ops to a separate extension crate.
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-20build: add "include_js_files_for_snapshotting" Cargo feature (#17826)Bartek Iwańczuk
This allows to not include source code into the binary (because it will already be included in the V8 snapshot). Nothing changes for the embedders - everything should still build the same. This commit brings the binary size from 87Mb to 82Mb on M1. Alternative to https://github.com/denoland/deno/pull/17820 and https://github.com/denoland/deno/pull/17653 --------- Co-authored-by: Leo Kettmeir <crowlkats@toaxl.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(node): stabilize Node-API (#17553)Bartek Iwańczuk
This commit stabilizes Node-API, the "--unstable" flag is no longer required to load native extensions. "--allow-ffi" permission is still required to load them.
2023-02-05 refactor: rename `deno` specifiers to `internal` (#17655)Leo Kettmeir
2023-01-14chore: use rustfmt imports_granularity option (#17421)Divy Srivastava
Closes https://github.com/denoland/deno/issues/2699 Closes https://github.com/denoland/deno/issues/2347 Uses unstable rustfmt features. Since dprint invokes `rustfmt` we do not need to switch the cargo toolchain to nightly. Do we care about formatting stability of our codebase across Rust versions? (I don't)
2023-01-08feat(core): allow specifying name and dependencies of an Extension (#17301)Leo Kettmeir
2023-01-07refactor(permissions): add PermissionsContainer struct for internal ↵Bartek Iwańczuk
mutability (#17134) Turns out we were cloning permissions which after prompting were discarded, so the state of permissions was never preserved. To handle that we need to store all permissions behind "Arc<Mutex<>>" (because there are situations where we need to send them to other thread). Testing and benching code still uses "Permissions" in most places - it's undesirable to share the same permission set between various test/bench files - otherwise granting or revoking permissions in one file would influence behavior of other test files.
2023-01-02chore: update copyright year to 2023 (#17247)David Sherret
Yearly tradition of creating extra noise in git.
2022-11-28fix(npm): allow to inspect npm modules with --inspect-brk (#16841)Bartek Iwańczuk
2022-11-28fix(runtime): feature-flag snapshot from snapshot (#16843)Leo Kettmeir
2022-11-21feat(core): Ability to create snapshots from existing snapshots (#16597)Bartek Iwańczuk
Co-authored-by: crowlkats <crowlkats@toaxl.com>
2022-11-10feat: remove --unstable flag requirement for npm: specifiers (#16473)Bartek Iwańczuk
This commit makes "npm:" specifiers not require "--unstable" flag. At the moment some APIs used by Node polyfills still require "--unstable" which will be addressed in follow up PRs.
2022-10-26perf(core): do not drive JsInspector by default (#16410)Divy Srivastava
Part of https://github.com/denoland/deno/pull/16377
2022-10-05feat(npm): implement Node API (#13633)Divy Srivastava
This PR implements the NAPI for loading native modules into Deno. Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com> Co-authored-by: DjDeveloper <43033058+DjDeveloperr@users.noreply.github.com> Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
2022-09-28feat: implement Web Cache API (#15829)Satya Rohith
2022-09-13refactor(npm): create general use `NpmPackageResolver` (#15882)David Sherret
2022-08-24feat(unstable): add more permission checks for ext/node/ (#15581)Bartek Iwańczuk
2022-08-20feat(unstable): initial support for npm specifiers (#15484)David Sherret
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-08-18feat(ext/flash): An optimized http/1.1 server (#15405)Divy Srivastava
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com> Co-authored-by: Ben Noordhuis <info@bnoordhuis.nl> Co-authored-by: crowlkats <crowlkats@toaxl.com> Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
2022-08-16feat(runtime): add pre_execute_module_cb (#15485)David Sherret
2022-08-10refactor(runtime): split up `MainWorker` and `WebWorker`'s `preload_module` ↵David Sherret
method into two separate methods (#15451)
2022-08-09chore: temporarily disable `ext/node` and use unstable ops (#15438)David Sherret
2022-08-09feat: add ext/node for require support (#15362)Bartek Iwańczuk
This commit adds "ext/node" extension that implementes CommonJS module system. In the future this extension might be extended to actually contain implementation of Node compatibility layer in favor of "deno_std/node". Currently this functionality is not publicly exposed, it is available via "Deno[Deno.internal].require" namespace and is meant to be used by other functionality to be landed soon. This is a minimal first pass, things that still don't work: support for dynamic imports in CJS conditional exports
2022-07-11refactor: rename run_basic to run_local (#15068)cuobiezi
2022-07-05Revert "refactor(snapshots): to their own crate (#14794)" (#15076)Bartek Iwańczuk
This reverts commit fd5a12d7e25dc53238e2bbcffe970e646c1035f3.
2022-06-24refactor(snapshots): to their own crate (#14794)Aaron O'Mullan
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-06-13Deno.exit() is an alias to self.close() in worker contexts (#14826)Bartek Iwańczuk
This commit changes Deno.exit() to be an alias to self.close() in worker contexts, and the provided exit code becomes is ignored.
2022-06-08refactor: ensure exit code reference is passed to all workers (#14814)Bartek Iwańczuk
2022-05-17BREAKING(unstable): Enable Deno namespace in workers by default (#14581)Nayeem Rahman
This commit removes "WorkerOptions.deno" option as a boolean, as well as "WorkerOptions.deno.namespace" settings. Starting with this commit all workers have access to "Deno" namespace by default.
2022-05-14feat: add userAgent property to Navigator's prototype (#14415)randomicon00
2022-05-10fix(runtime/web_worker): Use biased select when getting module result (#14553)Nayeem Rahman
2022-04-27refactor: Remove PrettyJsError and js_error_create_fn (#14378)Nayeem Rahman
This commit: - removes "fmt_errors::PrettyJsError" in favor of "format_js_error" fn - removes "deno_core::JsError::create" and "deno_core::RuntimeOptions::js_error_create_fn" - adds new option to "deno_runtime::ops::worker_host::init"
2022-04-26fix(test): capture worker stdout and stderr in test output (#14410)David Sherret
2022-04-21feat(runtime): two-tier subprocess API (#11618)Leo Kettmeir
2022-04-19feat(ext/web): add globalThis.reportError() (#13799)Nayeem Rahman
2022-04-15refactor: Move source map lookups to core (#14274)Nayeem Rahman
The following transformations gradually faced by "JsError" have all been moved up front to "JsError::from_v8_exception()": - finding the first non-"deno:" source line; - moving "JsError::script_resource_name" etc. into the first error stack in case of syntax errors; - source mapping "JsError::script_resource_name" etc. when wrapping the error even though the frame locations are source mapped earlier; - removing "JsError::{script_resource_name,line_number,start_column,end_column}" entirely in favour of "js_error.frames.get(0)". We also no longer pass a js-side callback to "core/02_error.js" from cli. I avoided doing this on previous occasions because the source map lookups were in an awkward place.
2022-04-13refactor(core/error): Clarify JsError message fields (#14269)Nayeem Rahman
2022-04-13feat(ext/web): Add error events for event listener and timer errors (#14159)Nayeem Rahman
- feat: Add handleable error event for even listener errors - feat: Add handleable error event for setTimeout()/setInterval() errors - feat: Add Deno.core.destructureError() - feat: Add Deno.core.terminate() - fix: Don't throw listener errors from dispatchEvent() - fix: Use biased mode when selecting between mod_evaluate() and run_event_loop() results
2022-03-22feat(core): disableable extensions & ops (#14063)Aaron O'Mullan
Streamlines a common middleware pattern and provides foundations for avoiding variably sized v8::ExternalReferences & enabling fully monomorphic op callpaths
2022-02-15chore(ext/timers): move ext/timers to ext/web (#13665)Andreu Botella
2022-02-11compat: support --compat in web workers (#13629)Bartek Iwańczuk
Adds another callback to WebWorkerOptions that allows to execute some modules before actual worker code executes. This allows to set up Node global using std/node.
2022-01-07chore: update copyright to 2022 (#13306)Ryan Dahl
Co-authored-by: Erfan Safari <erfanshield@outlook.com>
2021-12-17fix: inspector prompts (#13123)Bartek Iwańczuk
This commit fixes prompts printed to the terminal when running with "--inspect" or "--inspect-brk" flags. When debugger disconnects error is no longer printed as users don't care about the reason debugger did disconnect. A message suggesting to go to "chrome://inspect" is printed if debugger is active. Additionally and information that process is waiting for debugger to connect is printed if running with "--inspect-brk" flag.
2021-12-11fix: op_set_exit_code (#13034)Bartek Iwańczuk
Fixes "op_set_exit_code" by sharing a single "Arc" between all workers (via "op state") instead of having a "global" value stored in "deno_runtime" crate. As a consequence setting an exit code is always scoped to a tree of workers, instead of being overridable if there are multiple worker tree (like in "deno test --jobs" subcommand). Refactored "cli/main.rs" functions to return "Result<i32, AnyError>" instead of "Result<(), AnyError>" so they can return exit code.
2021-12-03refactor(ext/fetch): pass opstate in `FetchHandler::fetch_file`Leo Kettmeir