summaryrefslogtreecommitdiff
path: root/cli
AgeCommit message (Collapse)Author
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-08refactor(lsp): improve test client initialization (#18015)David Sherret
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-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-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-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(tests): ability to capture stdout and stderr separately (#18035)David Sherret
This is to allow making assertions on stdout and stderr separately.
2023-03-05refactor: move definition of Deno.build from "runtime" to "core" (#18036)Bartek Iwańczuk
We use information about build in several extension crates like "ext/node" or "runtime/". In an effort to move "fs" APIs to a separate crate it is a prerequisite to have this information available outside of the "runtime/" crate. This commit moves definition of "build" object to "Deno.core" that is later forwarded to "Deno.build".
2023-03-05fix(check): include dts files in tsc roots (#18026)Nayeem Rahman
2023-03-05fix(ext/crypto): correctly limit ECDSA and hash algorithms (#18030)Filip Skokan
Closes #18029
2023-03-05refactor(runtime): remove 40_files.js, 40_write_file.js and 40_read_file.js ↵Bartek Iwańczuk
(#18018) JavaScript APIs from "runtime/js/40_files.js" combined abstractions for stdio streams ("Stdout", "Stderr", "Stdin") and file system file ("File", "FsFile"). APIs from "runtime/js/40_read_file.js" and "runtime/js/40_write_file.js" were implemented using ops from "runtime/ops/fs.rs". This file was removed and relevant APIs were moved to "deno_io/12_io.js" and "runtime/js/30_fs.js". This work is meant to enable factoring out "deno_fs" crate.
2023-03-05refactor(core): include_js_files! 'dir' option doesn't change specifiers ↵Bartek Iwańczuk
(#18019) This commit changes "include_js_files!" macro from "deno_core" in a way that "dir" option doesn't cause specifiers to be rewritten to include it. Example: ``` include_js_files! { dir "js", "hello.js", } ``` The above definition required embedders to use: `import ... from "internal:<ext_name>/js/hello.js"`. But with this change, the "js" directory in which the files are stored is an implementation detail, which for embedders results in: `import ... from "internal:<ext_name>/hello.js"`. The directory the files are stored in, is an implementation detail and in some cases might result in a significant size difference for the snapshot. As an example, in "deno_node" extension, we store the source code in "polyfills" directory; which resulted in each specifier to look like "internal:deno_node/polyfills/<module_name>", but with this change it's "internal:deno_node/<module_name>". Given that "deno_node" has over 100 files, many of them having several import specifiers to the same extension, this change removes 10 characters from each import specifier.
2023-03-05test(compile): Add a test for dynamic imports in `deno compile` (#18017)Andreu Botella
denoland/eszip#115 added support for statically-analyzed dynamic imports in eszip, which made `deno compile` support dynamic imports starting from #17858. This PR adds a test for it. ---- This test is adapted from PR #17663. Closes #17908
2023-03-04refactor: remove `Semaphore::new(1)` and use `TaskQueue` (#18014)David Sherret
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-04refactor: simplify to string calls (#18011)Geert-Jan Zwiers
2023-03-04chore(docs): add note about loadavg returning 0 on windows (#18006)Geert-Jan Zwiers
2023-03-03fix: lazily surface errors in package.json deps parsing (#17974)David Sherret
Closes #17941
2023-03-03chore: update deno_std submodule to 0.178.0 (#18003)Bartek Iwańczuk
2023-03-03feat(ops): reland fast zero copy string arguments (#17996)Divy Srivastava
Reland https://github.com/denoland/deno/pull/16777 The codegen is disabled in async ops and when fallback to slow call is possible (return type is a Result) to avoid hitting this V8 bug: https://github.com/denoland/deno/issues/17159
2023-03-02chore(cli): update deno_lint to 0.41.0 (#17997)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 updates deno_lint crate to 0.41.0. The new version contains a braking change that requries a minor code fix here, which is also addressed in this commit.
2023-03-01fix(core): introduce `SafeRegExp` to primordials (#17592)Kenta Moriuchi
2023-02-28chore(test): remove TestCommandOutput macros (#17975)David Sherret
2023-02-27chore: test builders for integration tests (#17965)David Sherret
Start of adding test builders to simplify integration tests. I only updated a few test files. We can complete upgrading over time.
2023-02-27chore(ext/node): suppress node compat tests stdout by default (#17909)Yoshiya Hinosawa
2023-02-26fix(ext/node): util.types.isSharedArrayBuffer (#17836)Yoshiya Hinosawa
2023-02-25chore: fix flaky package_json_basic tests (#17940)David Sherret
https://github.com/denoland/deno/actions/runs/4267836955/jobs/7429836369 Closes #17946
2023-02-24chore: forward v1.31.1 release commit to main (#17939)denobot
Co-authored-by: David Sherret <dsherret@gmail.com>
2023-02-25fix(npm): skip analyzing more specifiers in package.json (#17938)David Sherret
2023-02-25fix: regression remapping remote specifier to local file (#17935)David Sherret
Tests added to deno_graph, which were previously not there. Closes #17932
2023-02-24fix(npm): lazily install package.json dependencies only when necessary (#17931)David Sherret
This lazily does an "npm install" when any package name matches what's found in the package.json or when running a script from package.json with deno task. Part of #17916 Closes #17928
2023-02-24fix: ignore workspace specifiers in package.json (#17934)David Sherret
Part of #17916
2023-02-24refactor(flash): move remoteAddr to options bag (#17913)Leo Kettmeir
Applies suggestion from #17912
2023-02-24fix: ensure concurrent non-statically analyzable dynamic imports do not ↵David Sherret
sometimes fail (#17923) Closes #17918
2023-02-24feat: add `DENO_NO_PACKAGE_JSON` env var (#17926)David Sherret
Depends on #17924 Part of #17916
2023-02-24fix(npm): package.json auto-discovery should respect `--no-config` and ↵David Sherret
`--no-npm` (#17924) Part of #17916
2023-02-24fix: remote modules should be allowed to import data urls (#17920)David Sherret
This was a regression that has already been broken for some time, but that also became broken for when using an import map 1.31. Closes #17914
2023-02-241.31.0 (#17906)denobot
Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-02-23fix(npm): allow resolving from package.json when an import map exists (#17905)David Sherret