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

4605 commits

Author SHA1 Message Date
denobot
709cfd6d91
1.32.4 (#18668)
Bumped versions for 1.32.4

Please ensure:
- [x] Target branch is correct
- [x] Crate versions are bumped correctly
- [x] deno_std version is incremented in the code (see
`cli/deno_std.rs`)
- [x] Releases.md is updated correctly

To make edits to this PR:
```shell
git fetch upstream release_1_32.4 && git checkout -b release_1_32.4 upstream/release_1_32.4
```

cc @levex

Co-authored-by: levex <levex@users.noreply.github.com>
2023-04-12 17:17:55 +02:00
Luca Casonato
e9f41bed23 refactor(ext/fs): abstract FS via FileSystem trait (#18599)
This commit abstracts out the specifics of the underlying system calls
FS operations behind a new `FileSystem` and `File` trait in the
`ext/fs` extension.

This allows other embedders to re-use ext/fs, but substituting in a
different FS backend.

This is likely not the final form of these traits. Eventually they will
be entirely `deno_core::Resource` agnostic, and will live in a seperate
crate.

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-04-12 15:52:08 +02:00
David Sherret
4fab252153 fix(npm): cache bust npm specifiers more aggressively (#18636)
Part 1: #18622 
Part 2: This PR

Closes #16901

---------

Co-authored-by: Luca Casonato <hello@lcas.dev>
2023-04-12 15:52:08 +02:00
Nayeem Rahman
b183737fc9 fix(core): preserve syntax error locations in dynamic imports (#18664)
Fixes #6259.

Adds the location for v8 syntax errors to the message (`message += " at
{location}"`) when rethrowing them for dynamic imports.

Discussing with @bartlomieju on discord I proposed just preserving v8's
error and not reconstructing it, allowing the standard stack trace to
just point to the syntax error instead of the dynamic import. But on
further thought this way has parity with SWC's syntax errors + has the
advantage of showing both the syntax error and dynamic import location.

```ts
// temp.js
await import("./temp2.js");

// temp2.js
function foo() {
  await Promise.resolve();
}

// Before:
// error: Uncaught (in promise) SyntaxError: Unexpected reserved word
// await import("./temp2.js");
// ^
//     at async file:///.../temp.js:1:1

// After:
// error: Uncaught (in promise) SyntaxError: Unexpected reserved word at file:///.../temp2.js:2:3
// await import("./temp2.js");
// ^
//     at async file:///.../temp.js:1:1
```
2023-04-12 15:52:08 +02:00
Satya Rohith
477f49bca2 fix(ext/cache): cache.put overwrites previous call (#18649) 2023-04-12 15:52:08 +02:00
Levente Kurusa
a72396fa84 refactor(node/crypto): port polyfill to Rust for randomInt, randomFill, randomFillSync (#18658)
Pretty much as per the title, I'd welcome some feedback especially
around the
array/buffer handling in the two randomFill functions.
2023-04-12 15:52:08 +02:00
David Sherret
0014ebb91c fix(npm): do not "npm install" when npm specifier happens to match package.json entry (#18660) 2023-04-12 15:52:08 +02:00
Geert-Jan Zwiers
dc1eb76235 chore(cli): clean up unused number value (#18661)
This PR removes an accidentally declared number value.
2023-04-12 15:52:08 +02:00
Luca Casonato
7ced470477 fix(ext/kv): keys must be arrays (#18655)
There was some leftover code from previous iterations, where keys could
be single parts instead of arrays also. This didn't match the types.
2023-04-12 15:52:08 +02:00
Divy Srivastava
f731dbd981 fix(ext/node): add X509Certificate (#18625)
Towards #18455
2023-04-12 15:52:07 +02:00
David Sherret
0117281eef fix(npm): reload an npm package's dependency's information when version not found (#18622)
This reloads an npm package's dependency's information when a
version/version req/tag is not found.

This PR applies only to dependencies of npm packages. It does NOT yet
cause npm specifiers to have their dependency information cache busted.
That requires a different solution, but this should help cache bust in
more scenarios.

Part of #16901, but doesn't close it yet
2023-04-12 15:52:07 +02:00
David Sherret
3da1d5f8eb refactor(npm): use deno_npm and deno_semver (#18602) 2023-04-12 15:52:03 +02:00
David Sherret
acb9dca497 chore: fix flaky tests checking ms when CI is slow (#18559) 2023-04-12 15:49:40 +02:00
Divy Srivastava
05bc5e522d fix(ext/node): implement hkdf-expand (#18612)
Towards https://github.com/denoland/deno/issues/18455
2023-04-12 15:49:40 +02:00
Marvin Hagemeister
b7af3caf78 fix(ext/node): fix unable to resolve fraction.js (#18544)
Turns out `autoprefixer` is a better reproduction case then
`microbundle`.

Fixes #18535 
Fixes #18600

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-04-12 15:49:40 +02:00
Divy Srivastava
63454729a2 fix(ext/node): add symmetric keygen (#18609)
Towards #18455
2023-04-12 15:49:40 +02:00
Geert-Jan Zwiers
b039c5f5ac fix(ext/node): json encode binary command name (#18596)
Fixes https://github.com/denoland/deno/issues/18588
2023-04-12 15:49:40 +02:00
Divy Srivastava
4f5d637841 chore(cli/bench): add ws echo bench (#18595) 2023-04-12 15:49:39 +02:00
Bartek Iwańczuk
aec781cf8f tests: cleanup "node_compat_tests" (#18594)
A few drive-by cleanup while I'm working on the "crypto"
module. It makes it easier and faster to debug the failing
test case.
2023-04-12 15:49:39 +02:00
Bartek Iwańczuk
5e8209abb3 refactor(ext/http): bring back 'reusePort' option for 'Deno.serve()' (#18590)
Closes https://github.com/denoland/deno/issues/18582
2023-04-12 15:49:39 +02:00
Matt Mastracci
fcb5a89d91 refactor(core): Improve ergonomics of managing ASCII strings (#18498)
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-04-12 15:49:39 +02:00
Bartek Iwańczuk
aa3f85ddd2 refactor: remove "ext/flash" (#18578)
With https://github.com/denoland/deno/pull/18568 landed we no longer
need "ext/flash". 

This commit removes "deno_flash" extension completely.

This should have some impact on the binary and snapshot size.

Closes https://github.com/denoland/deno/issues/17356
2023-04-12 15:44:07 +02:00
Bartek Iwańczuk
fe21f65b6b refactor: "Deno.serve()" API uses "Deno.serveHttp()" internally (#18568)
This commit changes implementation of "Deno.serve()" API to use
"Deno.serveHttp()" under the hood. This change will allow us to
remove the "flash" server implementation, bringing stability to the
"Deno.serve()" API.

"cli/tests/unit/flash_test.ts" was renamed to "serve_test.ts".

Closes https://github.com/denoland/deno/issues/15574
Closes https://github.com/denoland/deno/issues/15504
Closes https://github.com/denoland/deno/issues/15646
Closes https://github.com/denoland/deno/issues/15909
Closes https://github.com/denoland/deno/issues/15911
Closes https://github.com/denoland/deno/issues/16828
Closes https://github.com/denoland/deno/issues/18046
Closes https://github.com/denoland/deno/issues/15869
2023-04-12 15:44:04 +02:00
Yoshiya Hinosawa
bb7b58a991 Revert "fix(cli): don't store blob and data urls in the module cache (#18261)" (#18572)
This reverts commit b4c61c146a.

cc @nayeemrmn
2023-04-12 15:44:00 +02:00
denobot
73d472149c
1.32.3 (#18558)
Co-authored-by: David Sherret <dsherret@gmail.com>
2023-04-01 18:51:46 -04:00
Nayeem Rahman
f6f48bcec2 fix(test): don't swallow sanitizer errors with permissions (#18550)
Missing `return` from #18246.
2023-04-01 17:34:09 -04:00
David Sherret
cf3d38d5a7 fix(lsp): add a document preload file system entry limit (#18553)
I was testing this out and it's badly needed. For now, it's not
configurable and limited to 1,000 file system entries.

Related to #18538
2023-04-01 17:34:09 -04:00
David Sherret
b1e2601e05 fix(repl): disable language server document preloading in the repl (#18543)
This was an oversight because the repl uses the language server under
the hood. Also, never preloads from a root directory.

Part of #18538
2023-04-01 17:34:08 -04:00
David Sherret
f981becf3e perf(check): faster source hashing (#18534) 2023-04-01 17:34:08 -04:00
David Sherret
94d8ac598c fix(check): ensure diagnostics caused by changes in other files get invalidated between runs (#18541)
Regression caused by the performance improvement in #18329. Figuring
this out was hard. It's luckily still fast after this change.

Closes #18516
2023-04-01 17:34:08 -04:00
denobot
1e10dd1b61
1.32.2 (#18533)
Bumped versions for 1.32.2

---------

Co-authored-by: mmastrac <mmastrac@users.noreply.github.com>
Co-authored-by: Matt Mastracci <matthew@mastracci.com>
2023-03-31 14:01:12 -06:00
Bartek Iwańczuk
7583cb4c52 Revert "fix(cli): deno upgrade file permission (#18427)" (#18467)
This reverts commit 0742ea1170.

Closes https://github.com/denoland/deno/issues/18466
2023-03-31 11:44:37 -06:00
David Sherret
12f3c1a359 fix: upgrade to TypeScript 5.0.3 (#18532) 2023-03-31 11:43:20 -06:00
David Sherret
cd7071beb2 fix(lsp): better handling of data: urls (#18527)
1. Log instead of error when the referrer can't be found
2. Fixes typescript to resolve data urls correctly. Properly documented
here:
https://github.com/denoland/TypeScript/pull/4/files#diff-180da7c288743d11d8590d30f0c07c48e5dcf291aa671bbea0dd520a9a1359d2

Closes #18524
2023-03-31 11:43:20 -06:00
David Sherret
5d20c36eaf fix(lsp): include all diagnosable documents on initialize (#17979)
Closes https://github.com/denoland/vscode_deno/issues/797
Closes https://github.com/denoland/deno/issues/11190
Closes https://github.com/denoland/vscode_deno/issues/811
Closes https://github.com/denoland/vscode_deno/issues/761
Closes https://github.com/denoland/vscode_deno/issues/585
Closes https://github.com/denoland/vscode_deno/issues/561
Closes https://github.com/denoland/vscode_deno/issues/410
2023-03-31 11:43:20 -06:00
Luca Casonato
5949321c55 fix(dts): improve types for the Deno.KV API (#18510) 2023-03-31 11:43:20 -06:00
Luca Casonato
e81f677fe4 feat(ext/kv): return versionstamp from set/commit (#18512)
This commit updates the `Deno.Kv` API to return the new commited
versionstamp for the mutated data from `db.set` and `ao.commit`. This is
returned in the form of a `Deno.KvCommitResult` object that has a
`versionstamp` property.
2023-03-31 11:43:20 -06:00
Geert-Jan Zwiers
7f88b9e442 fix(coverage): ignore files from npm registry (#18457)
Fixes https://github.com/denoland/deno/issues/17664 and part of
https://github.com/denoland/deno/issues/18454 by excluding files
belonging to npm modules by default in the coverage output.
2023-03-31 11:43:20 -06:00
David Sherret
2153d443c8 fix(lsp): textDocument/references should respect includeDeclaration (#18496) 2023-03-31 11:43:20 -06:00
David Sherret
04de3496cc docs: clarify Deno.consoleSize returns the window size (#18508)
Closes #18477
2023-03-31 11:43:20 -06:00
Bartek Iwańczuk
5ea494578a Revert "refactor(ext/node): Use Deno.inspect (#17960)" (#18491)
This reverts commit a3529d0232.

This change made debugging Node tests very hard - `AssertionError` is
now printed as `[Circular *1]` giving no visibility what failed.

We need to align two implementations together and remove this one then.
2023-03-31 11:43:20 -06:00
David Sherret
9bc81b8ac7 fix(repl): improve package.json support (#18497)
1. Fixes a cosmetic issue in the repl where it would display lsp warning
messages.
2. Lazily loads dependencies from the package.json on use.
3. Supports using bare specifiers from package.json in the REPL.

Closes #17929
Closes #18494
2023-03-31 11:43:20 -06:00
Yoshiya Hinosawa
6d03a55934 chore(ext/node): run node compat parallel tests in core number concurrency (#18505)
We currently run the all test cases in `parallel` category at the same
time, which invokes hundreds process at the same time, and that seems
causing some flakiness in CI. (maybe related to #18487)

This PR limits the concurrency to the number of cpu cores. This is more
aligned to how Node.js run their `parallel` test in their repository.
42c4a35952/Makefile (L356)
2023-03-31 11:43:20 -06:00
Bartek Iwańczuk
c385678d66 test: fix test_check_origin_not_supported (#18504)
Merge of dotland and dotcom caused this test to fail.
2023-03-31 11:43:19 -06:00
Bartek Iwańczuk
8497cef156 refactor(ext/node): add NodeEnv::Fs associated type (#18484)
This commit adds associated type to "NodeEnv" trait, called "Fs".

The "Fs" type has a trait bound on "NodeFs", which specifies APIs
required for all ops and resolution APIs to function.

A "RealFs" implementation of "NodeFs" is exported from the "deno_node"
crate, that provides a default implementation for the trait.

All code in "deno_node" extension was changed to use the "NodeFs" trait
to handle file system operations, instead of relying on APIs from the
standard library.
2023-03-31 11:43:19 -06:00
David Sherret
e7b80efca1 refactor(lsp): remove boolean parameters on documents.documents(...) (#18493)
I think this makes things clearer at the call sites.
2023-03-31 11:43:19 -06:00
Andrew Nester
b5024c6998 test(ext/node): add timers_tests.ts from std/node (#18472) 2023-03-31 11:43:19 -06:00
Andrew Nester
c31ddbde4b test(ext/node): add string_decoder_test.ts from std/node (#18473) 2023-03-31 11:43:19 -06:00
David Sherret
dba4b6ca80 chore: fix flaky pty_internal_repl (#18486) 2023-03-31 11:43:19 -06:00
Bartek Iwańczuk
e9aa09bfd4 test(lsp): make lsp_completions_auto_import more robust (#18482)
A completely unrelated change in
https://github.com/denoland/deno/pull/18286 threw of this test.

These changes make it more robust and easier to update in such cases.
2023-03-31 11:43:19 -06:00