0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-10-31 09:14:20 -04:00
Commit graph

4531 commits

Author SHA1 Message Date
David Sherret
675179a176
chore(types): fix type checking errors in 99_main_compiler.js (#18403) 2023-03-24 10:35:44 -04:00
Divy Srivastava
d740a9e43d
feat(ext/node): implement crypto.createSecretKey (#18413)
This commit adds the `crypto.createSecretKey` API.

Key management: This follows the same approach as our WebCrypto
CryptoKey impl where we use WeakMap for storing key material and a
handle is passed around, such that (only internal) JS can access the key
material and we don't have to explicitly close a Rust resource.

As a result, `createHmac` now accepts a secret KeyObject.

Closes https://github.com/denoland/deno/issues/17844
2023-03-24 14:13:26 +00:00
Yoshiya Hinosawa
3d75fb2be7
fix(ext/node): make cipher/decipher transform stream (#18408) 2023-03-24 22:29:14 +09:00
Heyang Zhou
94ef428b56
fix(ext/kv): add missing getMany method (#18410)
The `getMany` method was missing from the implementation of the
`Deno.Kv` class. This patch fixes it.
2023-03-24 20:06:27 +08:00
Bartek Iwańczuk
275dee60e7
refactor: make version and user_agent &'static str (#18400)
These caused a bunch of unnecessary allocations on each startup.
2023-03-23 23:27:58 +01:00
Matt Mastracci
ad77ba0f7b
fix(core): panic at build time if extension code contains anything other than 7-bit ASCII (#18372)
This will improve diagnostics and catch any non-ASCII extension code
early.

This will use `debug_assert!` rather than `assert!` to avoid runtime
costs, and ensures (in debug_assert mode only) that all extension source
files are ASCII as we load them.
2023-03-23 16:00:46 -06:00
denobot
e8348231df
chore: forward v1.32.1 release commit to main (#18399)
Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-03-23 22:55:23 +01:00
Cre3per
eb25e50edb
fix(cli): restore deno run - to handle stdin as typescript (#18391)
Bug reported here shortly after merging `--ext` changes
https://github.com/denoland/deno/pull/17172#issuecomment-1480898098

Also found a missing `--check` in integration tests for `--ext` that
would have missed a bug if there was one.

Fixes #18392
2023-03-23 12:45:43 -04:00
David Sherret
81c5ddf9f2
fix(inspect): ensure non-compact output when object literal has newline in entry text (#18366)
Fixes `Deno.inspect` to make an object literal non-compact when an entry
has multiple lines in it.
2023-03-23 10:58:53 -04:00
David Sherret
6e5a631fe0
refactor(lsp): add LspClientUrl (#18376)
This will make it a bit harder to accidentally use a client url in the
wrong place. I don't fully understand why we do this mapping, but this
will help prevent bugs like #18373

Closes #18374
2023-03-23 14:23:04 +00:00
Ryan Dahl
a3529d0232
refactor(ext/node): Use Deno.inspect (#17960)
No need for two almost identical implementations of the same thing

---------

Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
Co-authored-by: Aapo Alasuutari <aapo.alasuutari@gmail.com>
2023-03-23 10:01:07 -04:00
Bartek Iwańczuk
2117d9c1a7
refactor(init): remove CURRENT_STD_URL (#18375)
There's no point in having `Lazy<Url>`, since the only use case 
is string substitution in the "deno init" subcommand.
2023-03-23 03:11:18 +00:00
David Sherret
64f491422b
fix(lsp): ensure enablePaths works when clients do not provide a trailing slash for workspace dir (#18373)
Closes https://github.com/denoland/vscode_deno/issues/827
2023-03-23 01:58:38 +00:00
denobot
25b564bf86
1.32.0 (#18367)
Bumped versions for 1.32.0

---------

Co-authored-by: mmastrac <mmastrac@users.noreply.github.com>
Co-authored-by: Matt Mastracci <matthew@mastracci.com>
Co-authored-by: David Sherret <dsherret@users.noreply.github.com>
2023-03-22 22:22:24 +00:00
Heyang Zhou
533e33131f
fix(ext/kv): reverse mapping between AnyValue::Bool and KeyPart::Bool (#18365)
Previously the mapping between `AnyValue::Bool` and `KeyPart::Bool` was
inverted.

This patch also allows using the empty key `[]` as range start/end to
`snapshot_read`.
2023-03-22 21:53:16 +01:00
Heyang Zhou
a117d3d91e
chore(ext/kv): disable ci tests on darwin (#18364)
https://github.com/denoland/deno/issues/18363
2023-03-22 20:46:26 +01:00
Ryan Dahl
f9c8d98b77
Revert "refactor: rename Deno.openKv() to Deno.kv() (#18349)" (#18362)
This reverts commit 50b793c9ed.
2023-03-22 20:23:36 +01:00
Matt Mastracci
cebefa8783
chore(test_util): replace tempdir code w/tempdir crate (#18340) 2023-03-22 12:55:19 -06:00
Bartek Iwańczuk
df614ff6e5
test: ignore flaky node:child_process tests (#18360) 2023-03-22 18:39:13 +00:00
Matt Mastracci
03e236b614
chore(cli): measure performance against wall-clock (#18357)
Fixes test flake by requiring perf to be <150% of wall-clock time rather
than <500ms.
2023-03-22 18:06:29 +00:00
Matt Mastracci
79fb3b1f35
chore(cli): ensure no signal on test exit (#18354)
If deno crashes on exit, we get a failure on the exit code (None instead
of Some(0) but we never see the signal.
2023-03-22 18:00:07 +00:00
David Sherret
1f635b1eac
fix: include error in message about not being able to create the TypeScript cache (#18356) 2023-03-22 13:59:55 -04:00
Matt Mastracci
42d13c4e6a
chore(cli): disable flash_test as it is causing SIGSEGV (#18358) 2023-03-22 13:42:50 -04:00
Bartek Iwańczuk
2ac2906b2b
test: ignore fetchWithInvalidContentLength and fetchConnectionError on Windows (#18351)
https://github.com/denoland/deno/issues/18350
2023-03-22 10:19:11 -04:00
Cre3per
fd0658fb42
feat(cli): --ext parameter for run, compile, and bundle (#17172)
Adds `--ext` to `deno run`, closes #5088

Additionally

- Adds `--ext` to `deno compile` and `deno bundle`
2023-03-22 10:15:53 -04:00
Ryan Dahl
50b793c9ed
refactor: rename Deno.openKv() to Deno.kv() (#18349) 2023-03-22 10:02:40 -04:00
Bartek Iwańczuk
e73e8410f6
chore: upgrade rusty_v8 to 0.66.0 (#18339) 2023-03-22 13:38:56 +01:00
Bartek Iwańczuk
aa7f02946d
test: mark two unit tests as flaky (#18344)
Temporarily marking two "fetch" tests as flaky, since
they've been failing on CI for the past 24h.
2023-03-22 13:30:54 +01:00
Nayeem Rahman
5804d7434e
fix(ext/kv): don't request permissions for ":memory:" (#18346)
Currently `Deno.openKv(":memory:")` requests read+write permissions for
`./:memory:` even though no file is read or written. Also added some
guards for special sqlite paths that were unintentionally opted into.
2023-03-22 06:49:29 -04:00
Heyang Zhou
92ebf4afe5
feat(ext/kv): key-value store (#18232)
This commit adds unstable "Deno.openKv()" API that allows to open
a key-value database at a specified path.

---------

Co-authored-by: Luca Casonato <hello@lcas.dev>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-03-22 12:13:24 +08:00
Bartek Iwańczuk
8bcffff9dc
test: disable macos_shared_libraries test (#18342)
This test is flaky: https://github.com/denoland/deno/issues/18341
2023-03-21 18:23:35 -06:00
Bartek Iwańczuk
619806d7a9
perf: disable WAL for transpiled source cache (#18084)
Disable Write-Ahead Log for the cached module source database.

This brings SQLite connection cost on startup from 2.5% to 1.6%.
2023-03-22 00:01:15 +00:00
Bartek Iwańczuk
7d9653d51f
Revert "fix(cli) Better error messages on corrupt databases that aren… (#18337)
…'t automatically re-created (#18330)"

This reverts commit 2ef8269fdb.

Printing these messages by default (instead of requiring `-L debug`
flag) caused
various tests to start printing it and mismatch in output assertions.
2023-03-21 22:38:18 +00:00
Matt Mastracci
0b4770fa7d
perf(core) Reduce script name and script code copies (#18298)
Reduce the number of copies and allocations of script code by carrying
around ownership/reference information from creation time.

As an advantage, this allows us to maintain the identity of `&'static
str`-based scripts and use v8's external 1-byte strings (to avoid
incorrectly passing non-ASCII strings, debug `assert!`s gate all string
reference paths).

Benchmark results:

Perf improvements -- ~0.1 - 0.2ms faster, but should reduce garbage
w/external strings and reduces data copies overall. May also unlock some
more interesting optimizations in the future.

This requires adding some generics to functions, but manual
monomorphization has been applied (outer/inner function) to avoid code
bloat.
2023-03-21 22:33:12 +00:00
David Sherret
253b556e6f
perf(check): type check local files only when not using --all (#18329)
Closes #18171
2023-03-21 18:19:42 -04:00
Bartek Iwańczuk
7e61e8f0e0
chore: update formatting configuration (#18331) 2023-03-21 17:01:53 -04:00
Bartek Iwańczuk
cc46f6776c
Revert "perf: disable TSC snapshot compression (#18333)" (#18336)
This reverts commit 0d27de943a.
2023-03-21 19:11:22 +00:00
Matt Mastracci
a561cc28cd
chore(cli) Use with_context(|| format!(...)) rather than context(format!(...)) to avoid allocations in non-error path (#18332) 2023-03-21 12:13:32 -06:00
Bartek Iwańczuk
0d27de943a
perf: disable TSC snapshot compression (#18333)
This commit disables compression of the TSC snapshot.
The compression only decreased the size of snapshot by 0.5Mb
and it took about 40s during release build to compress.

With recent gains in TS 5.0 upgrade in terms of size and performance
it makes sense to remove this compression.
2023-03-21 17:53:46 +00:00
Matt Mastracci
2ef8269fdb
fix(cli) Better error messages on corrupt databases that aren't automatically re-created (#18330) 2023-03-21 17:19:10 +00:00
David Sherret
2fcf1f14cf
feat: TypeScript 5.0.2 (except decorators) (#18294)
This upgrades TypeScript to 5.0.2, but does not have ES decorator
support because swc does not support that yet.
2023-03-21 15:46:40 +00:00
Yoshiya Hinosawa
aa729a42b4
chore(tools): restore node compat test setup script (#18290) 2023-03-21 22:38:07 +09:00
ayame113
c34e26a9d5
docs: fix broken Deno.FsFile#readable example code (#18277) 2023-03-21 16:22:21 +09:00
Yoshiya Hinosawa
896d7f02cb
chore(ext/console): inspect anonymous function as [Function (anonymous)] (#18283)
This PR changes the inspect result of anonymous functions from
`[Function]` to `[Function (anonymous)]`. This behavior is aligned
to `util.inspect` of Node.js.
2023-03-21 13:12:13 +09:00
Sam Gwilym
4c34a2f2df
feat(ext/net): Add multicasting APIs to DatagramConn (#10706) (#17811) 2023-03-20 22:27:00 +01:00
Bartek Iwańczuk
cd53ab5427
refactor(ext/node): untangle dependencies between js files (#18284)
Moving some code around in `ext/node` is it's a bit better well defined
and makes it possible for others to embed it.

I expect to see no difference in startup perf with this change.
2023-03-20 14:05:13 -04:00
Bartek Iwańczuk
aba5329aec
refactor(ext/node): make initialization functions sync (#18282)
These functions don't need to be async, as they are only calling
synchronous JavaScript code. As a follow up, all 3 functions
should be merge together - this will reduce roundtrips for
calling V8 from Rust, which is somewhat expensive
2023-03-20 00:40:21 -04:00
Andreu Botella
090169cfbc
feat(compile): Add support for web workers in standalone mode (#17657)
This commit adds support for spawning Web Workers in self-contained
binaries created with "deno compile" subcommand.

As long as module requested in "new Worker" constructor is part of the
eszip (by means of statically importing it beforehand, or using "--include"
flag), then the worker can be spawned.
2023-03-19 23:32:54 +01:00
Max Dahlgren
bf149d047f
test(ext/node): port _fs tests from std/node (#18262)
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2023-03-20 01:10:39 +09:00
Sanskar Gauchan
3b1cb8af69
test(ext/node): add querystring_test.ts and readline_test.ts (#18256) 2023-03-19 19:49:11 +09:00