summaryrefslogtreecommitdiff
path: root/cli/js.rs
AgeCommit message (Collapse)Author
2024-07-05chore: rename `__runtime_js_source` to `hmr` (#24442)Divy Srivastava
Saves some keystrokes and easy to remember ``` cargo b --features hmr ```
2024-03-05chore(cli): remove problematic snapshot test (#22722)Matt Mastracci
This test crashes often on windows.
2024-03-05chore: upgrade deno_core (#22699)Bartek Iwańczuk
Co-authored-by: Matt Mastracci <matthew@mastracci.com>
2024-02-27chore: bump deno_core (#22596)Matt Mastracci
Migrations: - snapshot code updated - runtime stats API tweaks
2024-01-01chore: update copyright to 2024 (#21753)David Sherret
2023-08-06build: allow disabling snapshots for dev (#20048)Nayeem Rahman
Closes #19399 (running without snapshots at all was suggested as an alternative solution). Adds a `__runtime_js_sources` pseudo-private feature to load extension JS sources at runtime for faster development, instead of building and loading snapshots or embedding sources in the binary. Will only work in a development environment obviously. Try running `cargo test --features __runtime_js_sources integration::node_unit_tests::os_test`. Then break some behaviour in `ext/node/polyfills/os.ts` e.g. make `function cpus() {}` return an empty array, and run it again. Fix and then run again. No more build time in between.
2023-07-19feat(ext/node): properly segregate node globals (#19307)Luca Casonato
Code run within Deno-mode and Node-mode should have access to a slightly different set of globals. Previously this was done through a compile time code-transform for Node-mode, but this is not ideal and has many edge cases, for example Node's globalThis having a different identity than Deno's globalThis. This commit makes the `globalThis` of the entire runtime a semi-proxy. This proxy returns a different set of globals depending on the caller's mode. This is not a full proxy, because it is shadowed by "real" properties on globalThis. This is done to avoid the overhead of a full proxy for all globalThis operations. The globals between Deno-mode and Node-mode are now properly segregated. This means that code running in Deno-mode will not have access to Node's globals, and vice versa. Deleting a managed global in Deno-mode will NOT delete the corresponding global in Node-mode, and vice versa. --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com> Co-authored-by: Aapo Alasuutari <aapo.alasuutari@gmail.com>
2023-04-04refactor(core): Improve ergonomics of managing ASCII strings (#18498)Matt Mastracci
This is a follow-on to the earlier work in reducing string copies, mainly focused on ensuring that ASCII strings are easy to provide to the JS runtime. While we are replacing a 16-byte reference in a number of places with a 24-byte structure (measured via `std::mem::size_of`), the reduction in copies wins out over the additional size of the arguments passed into functions. Benchmarking shows approximately the same if not slightly less wallclock time/instructions retired, but I believe this continues to open up further refactoring opportunities.
2023-03-17perf: disable runtime snapshot compression (#18239)Bartek Iwańczuk
This commit removes compression for the runtime JS code. It means that we will have a bigger binary, but faster startup. After several discussion in the CLI team we decided it's worth to trade about 3Mb of binary size for 2ms faster startup time. With WebGPU removed in 35196eab279340376929dd75ed717ef4830e2fa9 it shouldn't have such a big impact on the binary size.
2023-03-08Revert "perf: disable snapshot compression (#18061)" (#18074)Bartek Iwańczuk
This reverts commit d12b039e1ad601622c6135e13f00fd14cb09bce1. It was landed as an experiment and it confirms much faster startup if not compression is applied.
2023-03-07perf: disable snapshot compression (#18061)Bartek Iwańczuk
This commit disables snapshot compression for the CLI snapshot.] Decompressing the snapshot on startup takes ~2.5ms.
2023-01-13chore: add `copyright_checker` tool and add the missing copyright (#17285)Yiyu Lin
2022-11-21feat(core): Ability to create snapshots from existing snapshots (#16597)Bartek Iwańczuk
Co-authored-by: crowlkats <crowlkats@toaxl.com>
2021-01-06refactor(cli): remove 'js' module, simplify compiler snapshot (#9020)Bartek Iwańczuk
This commit removes "js" module from "cli". It contained stuff related to TypeScript compiler (snapshot, declaration files) and thus it was moved to "tsc" module.
2020-12-13refactor: deno_runtime crate (#8640)Bartek Iwańczuk
This commit moves Deno JS runtime, ops, permissions and inspector implementation to new "deno_runtime" crate located in "runtime/" directory. Details in "runtime/README.md". Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
2020-10-14refactor(cli): add tsc2 (#7942)Kitson Kelly
Ref #7225
2020-10-07refactor: rename isolate to js_runtime (#7858)Bartek Iwańczuk
This commit renames occurrences of "isolate" variable name to "js_runtime". This was outstanding debt after renaming deno_core::CoreIsolate to JsRuntime.
2020-09-22refactor(core): support error stack, remove js_check (#7629)Bartek Iwańczuk
This commit adds support for stack traces in "deno_core". Implementation of "Display" trait for "JsError" has been updated and in consequence "deno_core::js_check" became obsolete and removed.
2020-09-18refactor: deno_fetch op crate (#7524)Bartek Iwańczuk
2020-09-11refactor(core): JsRuntime initialization (#7415)Bartek Iwańczuk
Removes: - "deno_core::StartupData" - "deno_core::Script" - "deno_core::OwnedScript" Changes to "JsRuntime": - remove "new_with_loader()" - remove "with_heap_limits()" - rename "IsolateOptions" to "RuntimeOptions" and make public - "JsRuntime::new()" takes "RuntimeOptions" as a single param
2020-09-10Use gotham-like state for ops (#7385)Ryan Dahl
Provides a concrete state type that can be dynamically added. This is necessary for op crates. * renames BasicState to OpState * async ops take `Rc<RefCell<OpState>>` * sync ops take `&mut OpState` * removes `OpRegistry`, `OpRouter` traits * `get_error_class_fn` moved to OpState * ResourceTable moved to OpState
2020-09-06refactor(core): rename CoreIsolate to JsRuntime (#7373)Bartek Iwańczuk
deno_core/ - rename core_isolate.rs to runtime.rs - rename CoreIsolate to JsRuntime - rename JSError to JsError - rename JSStackFrame to JsStackFrame cli/ - update references from deno_core::CoreIsolate to deno_core::JsRuntime - rename deno_core::JSError to deno_core::JsError - rename fmt_errors::JSError to fmt_errors::JsError
2020-09-06Move JSON ops to deno_core (#7336)Bert Belder
2020-08-07Op crate for Web APIs (#6906)Bartek Iwańczuk
Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
2020-07-23refactor: remove more compiler runtime code (#6841)Bartek Iwańczuk
2020-07-22Reduce size of TypeScript Compiler snapshot (#6809)Ryan Dahl
This PR is intentionally ugly. It duplicates all of the code in cli/js2/ into cli/tsc/ ... because it's very important that we all understand that this code is unnecessarily duplicated in our binary. I hope this ugliness provides the motivation to clean it up. The typescript git submodule is removed, because it's a very large repo and contains all sorts of stuff we don't need. Instead the necessary files are copied directly into the deno repo. Hence +200k lines. COMPILER_SNAPSHOT.bin size ``` master 3448139 this branch 3320972 ``` Fixes #6812
2020-07-19Port internal TS code to JS (#6793)Bartek Iwańczuk
Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
2020-07-16refactor(cli): Remove dead code (#6765)Ryan Dahl
2020-05-07BREAKING: Remove support for .wasm imports (#5135)Bartek Iwańczuk
Importing .wasm files is non-standardized therefore deciding to support current functionality past 1.0 release is risky. Besides that .wasm import posed many challenges in our codebase due to complex interactions with TS compiler which spawned thread for each encountered .wasm import. This commit removes: - cli/compilers/wasm.rs - cli/compilers/wasm_wrap.js - two integration tests related to .wasm imports
2020-04-30Unstable methods should not appear in runtime or d.ts (#4957)Luca Casonato
Co-authored-by: Kitson Kelly <me@kitsonkelly.com>
2020-04-25remove bootstrap methods from global scope after bootstrapping (#4869)Bartek Iwańczuk
2020-04-23Rename deno_core::Isolate to deno_core::CoreIsolate (#4851)Ryan Dahl
2020-04-23Upgrade to rusty_v8 v0.4.0 (#4856)Bert Belder
2020-01-29workers: proper TS libs, more spec-compliant APIs (#3812)Bartek Iwańczuk
* split lib.deno_main.d.ts into: - lib.deno.shared_globals.d.ts - lib.deno.window.d.ts - lib.deno.worker.d.ts * remove no longer used libs: - lib.deno_main.d.ts - lib.deno_worker.d.ts * change module loading to use proper TS library for compilation * align to Worker API spec: - Worker.terminate() - self.close() - self.name
2020-01-27refactor: isomorphic snapshot for CLI (#3728)Bartek Iwańczuk
2020-01-24Break out runtime lib to main and worker (#3771)Kitson Kelly
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2020-01-22Reland "Create an old program to be used in snapshot." (#3747)Bartek Iwańczuk
* read CLI assets from disk during snapshotting
2020-01-21Revert "Create an old program to be used in snapshot. (#3644)"Ry Dahl
Ref #3712. This change allowed the deno_typescript crate to reference cli/js/lib.deno_runtime.d.ts which breaks "cargo package". We intend to reintroduce a revised version of this patch later once "cargo package" is working and tested. This reverts commit 737ab94ea1bdf65eeef323ea37e84bcf430fb92c.
2020-01-21refactor: Rename JS entry functions (#3732)Bartek Iwańczuk
2020-01-12Create an old program to be used in snapshot. (#3644)Kitson Kelly
2020-01-08refactor: module loading in EsIsolate (#3615)Bartek Iwańczuk
* refactored RecursiveLoad - it was renamed to RecursiveModuleLoad, it does not take ownership of isolate anymore - a struct implementing Stream that yields SourceCodeInfo * untangled module loading logic between RecursiveLoad and isolate - that logic is encapsulated in EsIsolate and RecursiveModuleLoad, where isolate just consumes modules as they become available - does not require to pass Arc<Mutex<Isolate>> around anymore * removed EsIsolate.mods_ in favor of Modules and moved them inside EsIsolate * EsIsolate now requires "loader" argument during construction - struct that implements Loader trait * rewrite first methods on isolate as async
2020-01-07core: factor out EsIsolate from Isolate (#3613)Bartek Iwańczuk
2020-01-05Rename crates: 'deno' to 'deno_core' and 'deno_cli' to 'deno' (#3600)Ry Dahl
2019-10-04Merge deno_cli_snapshots into deno_cli (#3064)Ryan Dahl