1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-30 16:40:57 -05:00
Commit graph

8765 commits

Author SHA1 Message Date
Bartek Iwańczuk
91ea2cdc57 refactor: use v8::String::new_external_onebyte_static where appropriate (#18051) 2023-03-10 12:56:33 +09:00
David Sherret
bd6fd4ea5f chore(tests): ability to capture stdout and stderr separately (#18035)
This is to allow making assertions on stdout and stderr separately.
2023-03-10 12:56:18 +09:00
Divy Srivastava
f065380414 fix(ext/node): remove unused _hex module (#18045) 2023-03-10 12:56:05 +09:00
Divy Srivastava
38b4411cae perf(ext/node): improve createHash performance (#18033)
```
> 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-10 12:55:55 +09:00
Bartek Iwańczuk
ce7a23b86d refactor: move "pathFromURL" to deno_web extension (#18037)
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.
2023-03-10 12:55:47 +09:00
Bartek Iwańczuk
b6a4b1c794 refactor(core): InternalModuleLoader checks if all files were used (#18005)
This commit changes "InternalModuleLoader" from "deno_core" to 
store a list of used modules during snapshotting. If a module was not
used during snapshotting "InternalModuleLoader" will panic in its "Drop"
handler signaling to the embedder that they made a mistake somewhere.
2023-03-10 12:55:33 +09:00
Bartek Iwańczuk
4fbc51ca46 refactor: move definition of Deno.build from "runtime" to "core" (#18036)
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-10 12:55:19 +09:00
Nayeem Rahman
38ed6d55f7 fix(check): include dts files in tsc roots (#18026) 2023-03-10 12:55:13 +09:00
Divy Srivastava
be3d72876a chore(ext/node): cleanup empty internal_bindings (#18032) 2023-03-10 12:52:10 +09:00
Filip Skokan
7e0cc3cb2f fix(ext/crypto): correctly limit ECDSA and hash algorithms (#18030)
Closes #18029
2023-03-10 12:52:00 +09:00
Bartek Iwańczuk
d583c593c0 refactor(runtime): merge "spawn" into "process" (#18022)
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-10 12:51:42 +09:00
Divy Srivastava
f9a235f2eb chore(core): remove argc field from OpDecl (#18024)
https://github.com/denoland/deno/pull/18023#discussion_r1125611859
2023-03-10 12:51:31 +09:00
Aapo Alasuutari
8db0d393c3 feat(ext/ffi): Make External pointers keep reference to V8 buffer (#17955) 2023-03-10 12:51:22 +09:00
Divy Srivastava
ed6b60ddbe feat(ops): relational ops (#18023)
Join two independent ops into one. A fast impl of one + a slow callback
of another. Here's an example showing optimized paths for latin-1 via
fast call and the next-best fallback using V8 apis.

```rust
#[op(v8)]
fn op_encoding_encode_into_fallback(
  scope: &mut v8::HandleScope,
  input: serde_v8::Value,
// ...

#[op(fast, slow = op_encoding_encode_into_fallback)]
fn op_encoding_encode_into(
  input: Cow<'_, str>,
// ...
```

Benchmark results of the fallback path:
```
time target/release/deno run -A --unstable ./cli/tests/testdata/benches/text_encoder_into_perf.js
________________________________________________________
Executed in   70.90 millis    fish           external
   usr time   57.76 millis    0.23 millis   57.53 millis
   sys time   17.02 millis    1.28 millis   15.74 millis

target/release/deno_main run -A --unstable ./cli/tests/testdata/benches/text_encoder_into_perf.js
________________________________________________________
Executed in  154.00 millis    fish           external
   usr time   67.14 millis    0.26 millis   66.88 millis
   sys time   38.82 millis    1.47 millis   37.35 millis
```
2023-03-10 12:48:52 +09:00
Bartek Iwańczuk
dea5de1c45 refactor(runtime): remove 40_files.js, 40_write_file.js and 40_read_file.js (#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-10 12:47:49 +09:00
Bartek Iwańczuk
1b1de27958 refactor: remove unused 40_diagnostics.js file (#18021)
This file was not used anywhere - even though it exposed an unstable
"Deno.DiagnosticCategory" API. Seems like a left over from when we
had "Deno.emit" API.
2023-03-10 12:47:38 +09:00
Bartek Iwańczuk
ce75e31625 refactor(core): include_js_files! 'dir' option doesn't change specifiers (#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-10 12:47:26 +09:00
Andreu Botella
c58790ef13 test(compile): Add a test for dynamic imports in deno compile (#18017)
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-10 12:47:20 +09:00
David Sherret
65d6704818 refactor: remove Semaphore::new(1) and use TaskQueue (#18014) 2023-03-10 12:47:14 +09:00
Bartek Iwańczuk
02026506f5 refactor(runtime): factor out deno_io extension crate (#18001)
This is a prerequisite to factor out FS ops to a separate crate.
2023-03-10 12:47:08 +09:00
Bartek Iwańczuk
3494c78679 refactor: move TaskQueue from deno_runtime to deno_core (#18016)
This utility is useful in several contexts so it seems reasonable to
have it in `deno_core`.
2023-03-10 12:47:04 +09:00
Bartek Iwańczuk
073dcf2ea5 refactor(runtime): factor out FsPermissions for fs ops (#18012)
This will help us with moving fs ops to a separate extension crate.
2023-03-10 12:47:00 +09:00
Geert-Jan Zwiers
7ec260dddf refactor: simplify to string calls (#18011) 2023-03-10 12:46:55 +09:00
Geert-Jan Zwiers
f763f2e298 chore(docs): add note about loadavg returning 0 on windows (#18006) 2023-03-10 12:46:51 +09:00
David Sherret
483caf2820 fix: lazily surface errors in package.json deps parsing (#17974)
Closes #17941
2023-03-10 12:46:44 +09:00
Bartek Iwańczuk
066dedf509 chore: update deno_std submodule to 0.178.0 (#18003) 2023-03-10 12:46:36 +09:00
Filip Skokan
ac6316837c wpt: unlock nightly with --no-ignore (#17998)
When I was testing the code in #17892 I had updated expectations and
didn't catch this.

This PR fixes the the expectation file format to not be checked when
--no-ignore is passed during
[nightly](https://github.com/denoland/deno/actions/runs/4319520368/jobs/7538796572#step:9:46)
runs.
2023-03-10 12:46:30 +09:00
Divy Srivastava
eda8c83d8b feat(ops): reland fast zero copy string arguments (#17996)
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-10 12:46:24 +09:00
Filip Skokan
7991eeb240 test(wpt): implement process timeout, fix expectations update, and more... (#17892)
- relands #17872
- updates the timeouts to be re-configurable just for CI
- fixes `./tools/wpt.ts update`
- adds option not "ignore" during, applied to wpt epoch runs only
2023-03-10 12:44:53 +09:00
Yusuke Tanaka
d3c02a68d3 chore(cli): update deno_lint to 0.41.0 (#17997)
<!--
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-10 12:44:45 +09:00
Kenta Moriuchi
d13055e317 fix(core): introduce SafeRegExp to primordials (#17592) 2023-03-10 12:44:33 +09:00
David Sherret
8a6fad7e0d chore: fix cargo build rebuilding deno_runtime each time (#17978) 2023-03-10 12:44:27 +09:00
David Sherret
483ccbe220 chore(test): remove TestCommandOutput macros (#17975) 2023-03-10 12:44:23 +09:00
Aapo Alasuutari
57573c6d20 fix(ext/ffi): Remove deno_core::OpState qualifiers, fix ops returning pointer defaults (#17959) 2023-03-10 12:44:14 +09:00
David Sherret
9fecdc29b4 chore: test builders for integration tests (#17965)
Start of adding test builders to simplify integration tests.

I only updated a few test files. We can complete upgrading over time.
2023-03-10 12:44:09 +09:00
Geert-Jan Zwiers
b3b6b53df9 chore(ext/node): fix variable name (#17948) 2023-03-10 12:44:06 +09:00
Bartek Iwańczuk
5149d07335 fix(lockfile): don't touch lockfile is npm specifiers are identical (#17973)
We were unconditionally inserting npm specifiers into the lockfile,
marking it as "dirty" and requiring saving.
2023-03-10 12:43:35 +09:00
Yoshiya Hinosawa
f1c756f589 chore(ext/node): suppress node compat tests stdout by default (#17909) 2023-03-10 12:43:29 +09:00
Dominic DiGiacomo
de08015925 deps: bump regexp to ^1.7.0 (#17966) 2023-03-10 12:43:14 +09:00
sean watters
ca90cbf370 fix(cli,ext/web): Upgrading uuid from =1.1.2 to 1.3.0 (#17963)
Resolves https://github.com/denoland/deno/issues/17962
2023-03-10 12:43:02 +09:00
luketpeterson
b36b4122c1 chore: Changing dependency on tokio-util from version-lock to semver minimum (#17863) 2023-03-10 12:42:51 +09:00
Aapo Alasuutari
ebcd1daa4c chore(ext/ffi): Use queueMicrotask in tests (#17954) 2023-03-10 12:42:39 +09:00
Yoshiya Hinosawa
e2951cbaac refactor(ext/node): remove _process/stdio.js (#17911) 2023-03-10 12:42:24 +09:00
Yoshiya Hinosawa
e5ff08d85c fix(ext/node): util.types.isSharedArrayBuffer (#17836) 2023-03-10 12:42:14 +09:00
David Sherret
a07adc1a88 chore: fix flaky package_json_basic tests (#17940)
https://github.com/denoland/deno/actions/runs/4267836955/jobs/7429836369

Closes #17946
2023-03-10 12:41:41 +09:00
denobot
86785f2119
1.31.1 (#17936)
Co-authored-by: David Sherret <dsherret@gmail.com>
2023-02-24 21:17:58 -05:00
David Sherret
b5b331e31a
fix(npm): skip analyzing more specifiers in package.json (#17938) 2023-02-25 02:16:26 +00:00
David Sherret
d6192ce8fd
fix: regression remapping remote specifier to local file (#17935)
Tests added to deno_graph, which were previously not there.

Closes #17932
2023-02-25 01:23:51 +00:00
David Sherret
033b70af19
fix(npm): lazily install package.json dependencies only when necessary (#17931)
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-24 19:35:43 -05:00
David Sherret
5683daf1aa
fix: ignore workspace specifiers in package.json (#17934)
Part of #17916
2023-02-24 19:27:50 -05:00