summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-03-13Revert "feat(core): prevent isolate drop for CLI main worker (#18059)" (#18157)Ryan Dahl
Fixes https://github.com/denoland/deno/issues/18120 https://github.com/denoland/deno/issues/18137 https://github.com/denoland/fresh/issues/1073 This reverts commit 0cce9c2bcc9667935a571d30847e66ef5d01a196.
2023-03-13fix(core): Upgrades bytes crate from =1.2.1 to ^1.4.0 (#18123)sean watters
Motivation: currently can't embed `deno_core` in any project that depends on later version of `bytes` crate.
2023-03-13wpt: only tag daily runs as master (#18155)Filip Skokan
This PR updates the WPT upload script so that it only labels runs that come from the daily WPT job as "master". This is so that only the daily synchronized runs get selected when viewing dashboards such as [this](https://wpt.fyi/results/?label=master&label=experimental&product=deno&product=node.js&product=chrome&product=edge&product=firefox&product=safari&aligned&view=subtest&q=deno%3A%21missing).
2023-03-13feat(ext/fetch): support fallible request-builder hooks (#18116)Luca Bruno
This tweaks the signature of `request_builder_hook` in order to support fallible hooks. The rationale for this is mostly on two sides: * it allows a hook to inspect and possibly drop an outgoing request (e.g. for policying purposes), bubbling up a detailed error message to the user. * it wires into newer `reqwest` API which allows to split and then reassemble a `RequestBuilder`, although only in a fallible way (https://github.com/seanmonstar/reqwest/pull/1770)
2023-03-13fix(core): `SafePromiseAll` to be unaffected by `Array#@@iterator` (#17542)Kenta Moriuchi
2023-03-12refactor(npm): push npm struct creation to a higher level (#18139)David Sherret
This has been bothering me for a while and it became more painful while working on #18136 because injecting the shared progress bar became very verbose. Basically we should move the creation of all these npm structs up to a higher level. This is a stepping stone for a future refactor where we can improve how we create all our structs.
2023-03-11fix(check): regression where config "types" entries caused type checking ↵David Sherret
errors (#18124) Closes #18117 Closes #18121 (this is just over 10ms faster in a directory one up from the root folder) cc @nayeemrmn
2023-03-11chore: typo (#18128)Ikko Eltociear Ashimine
2023-03-10build: run clippy with --all-features (#18115)Bartek Iwańczuk
2023-03-10chore(ci): update other workflows to use cargo-toolchain.toml (#18109)David Sherret
I accidentally missed these in #18104
2023-03-10chore: forward v1.31.2 release commit to main (#18114)denobot
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2023-03-10refactor: use `pin!` macro from std (#18110)Yusuke Tanaka
<!-- Before submitting a PR, please read http://deno.land/manual/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. --> This commit replaces `pin_mut!` macro with `pin!` macro that has been provided from std since Rust 1.68.0. With the std version we can not only expect its stability but also pass an expression (rather than identifier) as an argument to the macro.
2023-03-09chore(cli): fix outdated comment (#18106)Lino Le Van
2023-03-09refactor(core): remove RuntimeOptions::extensions_with_js (#18099)Bartek Iwańczuk
This commit removes "deno_core::RuntimeOptions::extensions_with_js". Now it's embedders' responsibility to properly register extensions that will not contains JavaScript sources when running from an existing snapshot. Prerequisite for https://github.com/denoland/deno/pull/18080
2023-03-10fix(prompt): better output with control chars (#18108)Bartek Iwańczuk
2023-03-09chore(ci): ensure Rust toolchain installation is based on ↵David Sherret
rust-toolchain.toml (#18104) It seems like `dtolnay/rust-toolchain` does not want to support rust-toolchain.toml unfortunately and we had thought it did.
2023-03-09fix: Split extension registration and snapshotting (#18098)Bartek Iwańczuk
This commit partially reverts changes from https://github.com/denoland/deno/pull/18095. Turns out I made a mistake that became apparent when working on removing "RuntimeOptions::extensions_with_js" in a follow up.
2023-03-09refactor(tests/lsp): consolidate more into test LspClient and reduce ↵David Sherret
verbosity (#18100)
2023-03-09chore: bump rusty_v8 to 0.64.0 (#18096)Divy Srivastava
2023-03-09chore: update Rust to 1.68.0 (#18102)Bartek Iwańczuk
2023-03-09refactor: Split extension registration for runtime and snapshotting (#18095)Bartek Iwańczuk
This commit splits "<ext_name>::init" functions into "init_ops" and "init_ops_and_esm". That way we don't have to construct list of ESM sources on each startup if we're running with a snapshot. In a follow up commit "deno_core" will be changed to not have a split between "extensions" and "extensions_with_js" - it will be embedders' responsibility to pass appropriately configured extensions. Prerequisite for https://github.com/denoland/deno/pull/18080
2023-03-09fix(ext/webstorage): check size of inputs before insert (#18087)Divy Srivastava
2023-03-09refactor(core): Extension::builder_with_deps (#18093)Bartek Iwańczuk
Prerequisite for https://github.com/denoland/deno/pull/18080
2023-03-09fix(rumtime): Add `Deno.` prefix for registered symbols (#18086)Kenta Moriuchi
2023-03-09perf(core): over-allocate in ModuleMap when running from snapshot (#18083)Bartek Iwańczuk
This commit changes "ModuleMap" initialization to over-allocate by 16 for vectors storing module information and module V8 handles. In 99% cases there's gonna be at least one additional module loaded, so it's very wasteful to have to reallocate when the module is executed (IIRC Rust will double the size of the vector) and move all of the elements.
2023-03-09perf: don't add unload event listener (#18082)Bartek Iwańczuk
This commit changes how "unload" event is handled - before this commit an event listener was added unconditionally in the runtime bootstrapping function, which for some reason was very expensive (0.3ms). Instead of adding an event listener, a check was added to "dispatchEvent" function that performs the same action (so it's only called if there's an event dispatched).
2023-03-08refactor(lsp): improve test client initialization (#18015)David Sherret
2023-03-08fix(runtime/windows): ensure `Deno.stdin.setRaw(false)` properly disables ↵Roy Ivy III
raw mode (#17983)
2023-03-08fix(npm): improve peer dependency resolution with circular dependencies (#18069)David Sherret
This improves peer dependency resolution yet again. We did not handle scenarios like the following: ``` // a -> b -> c -> d -> c -> b (peer) ``` ...which would maybe work ok the first time its run in some cases, but then lead to a lockfile that would error on load. This now keeps track of circular dependencies and updates nodes accordingly. That said, there is still a lurking bug in this code somewhere that I've added a comment for (there is a mitigation on the tail end that seems to work well). The current state is much better than before and I can look into it later. I think it's something small that's incorrect.
2023-03-08feat(core): prevent isolate drop for CLI main worker (#18059)Divy Srivastava
``` Benchmark 1: deno run -A ../empty.js Time (mean ± σ): 20.5 ms ± 0.5 ms [User: 13.4 ms, System: 5.1 ms] Range (min … max): 19.8 ms … 24.0 ms 119 runs Benchmark 2: target/release/deno run -A ../empty.js Time (mean ± σ): 18.8 ms ± 0.3 ms [User: 13.0 ms, System: 4.9 ms] Range (min … max): 18.3 ms … 19.9 ms 129 runs ``` --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-03-08chore: update tempfile dependency (#18077)Bartek Iwańczuk
2023-03-08deps: bump once_cell to ^1.17.1 (#18075)Miroslav Bajtoš
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-08fix: attempt to only allow one deno process to update the node_modules ↵David Sherret
folder at a time (#18058) This is implemented in such a way that it should still allow processes to go through when a file lock wasn't properly cleaned up and the OS hasn't released it yet (but with a 200ms-ish delay). Closes #18039
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-03-08refactor(runtime): conditionally register Extension with source files (#18068)Bartek Iwańczuk
Since we are snapshotting extension source at build time, there's no need to define list of sources for the extension at runtime. This commit changes "deno_node" extension by removing "init_polyfill" function in favor of "init_polyfill_ops_and_esm()" and "init_polyfill_ops()". The former is used during snapshot and when "deno_runtime" is compiled with "dont_create_runtime_snapshot" cargo feature flag. The latter is used when running a worker from an existing snapshot. This is a start of a bigger refactor to all extensions - thanks to this change, we don't have to iterate over all defined source files for extension at runtime, and because of that we don't have to create a filepath for each of the source files. It's not a big deal, but we are iterating over 300 files on each start, and concatenating 3 strings before creating a "PathBuf" for ~200 of them. This is already visible on the startup flamegraphs and should be avoided.
2023-03-08perf: move setting up Deno namespace to snapshot time (#18067)Bartek Iwańczuk
No need to do it on startup every time.
2023-03-07refactor(core): don't use Result in ExtensionBuilder::state (#18066)Bartek Iwańczuk
There's no point for this API to expect result. If something fails it should result in a panic during build time to signal to embedder that setup is wrong.
2023-03-07fix(cli): add space after period in `--v8-flags` (#18063)Caleb Cox
Add space between period and "Any" in `--v8-flags` help text.
2023-03-07perf: move runtime bootstrap code to snapshot time (#18062)Bartek Iwańczuk
This commit moves some of the code from "99_main.js" to be executed during the snapshot time instead of on each worker bootstrap. These should minimally help with startup time benchmark.
2023-03-07chore(docs): Fixed manual link (#18060)ayame113
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-03-07refactor: Add "deno_fs" extension crate (#18040)Bartek Iwańczuk
This commit factors out APIs related to file system from "runtime/" to a separate "deno_fs" extension crate.
2023-03-07chore(tests): use temp dir in test `missing_deno_dir` (#18057)Nick Hanley
Fixes #18056
2023-03-06chore: remove duplicate copyright disclaimer (#18055)Tristan F
Removes duplicate copyright disclaimer from `/lockfile/lib.rs`
2023-03-06refactor: use v8::String::new_external_onebyte_static where appropriate (#18051)Bartek Iwańczuk
2023-03-06chore(tests): ability to capture stdout and stderr separately (#18035)David Sherret
This is to allow making assertions on stdout and stderr separately.
2023-03-06fix(ext/node): remove unused _hex module (#18045)Divy Srivastava
2023-03-06perf(ext/node): improve createHash performance (#18033)Divy Srivastava
``` > deno run -A ../test.mjs cpu: unknown runtime: deno 1.31.1 (aarch64-apple-darwin) benchmark time (avg) (min … max) p75 p99 p995 ------------------------------------------------- ----------------------------- 2.22 µs/iter (2.2 µs … 2.28 µs) 2.22 µs 2.28 µs 2.28 µs > target/release/deno run -A test.mjs cpu: unknown runtime: deno 1.31.1 (aarch64-apple-darwin) benchmark time (avg) (min … max) p75 p99 p995 ------------------------------------------------- ----------------------------- 864.9 ns/iter (825.05 ns … 1.22 µs) 864.93 ns 1.22 µs 1.22 µs ```
2023-03-05refactor: move "pathFromURL" to deno_web extension (#18037)Bartek Iwańczuk
This API is required by several extensions like "ext/node", "ext/ffi" and also FS APIs that we want to move to a separate crate. Because of that "pathFromURL" API was moved to "deno_web" extension so other extension crates can rely on it.