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

586 commits

Author SHA1 Message Date
Aaron O'Mullan
e24b8f075e
chore: deno_http v0.43.1 (#14392) 2022-04-25 21:31:34 +02:00
Divy Srivastava
609c359dd4
fix(ext/http): truncate read bytes when streaming bodies (#14389)
stream shutdown wasn't happening correctly (moved it to call op_http_shutdown) & extra zeroed bytes were being sent for when body length not a multiple of 64*1024
2022-04-25 19:20:29 +02:00
Ben Heidemann
ddbfa1418c
feat(ext/console): Add string abbreviation size option for "Deno.inspect" (#14384) 2022-04-25 13:59:15 +02:00
Divy Srivastava
6dcf3a447c
perf(ext/http): fast path for uncompressed bodies (#14366) 2022-04-25 08:13:22 +05:30
Aaron O'Mullan
e2fba7b967
perf(ext/http): faster is_content_compressible (#14383)
Cleanup + benches
2022-04-24 21:45:56 +02:00
Aaron O'Mullan
4b7d306a19
perf(serde_v8): zero-copy StringOrBuffer (#14381) 2022-04-24 09:28:46 -03:00
Divy Srivastava
2eb8c3b82f
chore(ext/fetch): custom arity (#14198) 2022-04-23 22:19:06 +05:30
Luca Casonato
1ad8c11bc9
chore: bump crates (#14365) 2022-04-22 16:54:42 +02:00
Divy Srivastava
57f7e07c13
Reland "perf(http): optimize ReadableStreams backed by a resource" (#14346) 2022-04-22 16:19:08 +05:30
Divy Srivastava
2a86b8fb02
Reland "feat(ext/http): stream auto resp body compression" (#14345) 2022-04-21 12:37:49 +05:30
denobot
29c8cd8aae
1.21.0 (#14336)
Co-authored-by: ry <ry@users.noreply.github.com>
Co-authored-by: David Sherret <dsherret@gmail.com>
2022-04-20 21:50:16 -04:00
Bartek Iwańczuk
03019e7781
Revert various PRs related to "ext/http" (#14339)
* Revert "feat(ext/http): stream auto resp body compression (#14325)"
* Revert "core: introduce `resource.read_return` (#14331)"
* Revert "perf(http): optimize `ReadableStream`s backed by a resource (#14284)"
2022-04-21 02:22:55 +02:00
Leo Kettmeir
8a7539cab3
feat(runtime): two-tier subprocess API (#11618) 2022-04-21 00:20:33 +02:00
Luca Casonato
8b25807054
feat(ext/http): stream auto resp body compression (#14325)
This commit adds support for auto response body compression for
streaming bodies.
2022-04-20 22:53:56 +02:00
Divy Srivastava
2612b6f20f
core: introduce resource.read_return (#14331) 2022-04-20 18:39:13 +02:00
Divy Srivastava
57a8fc37fc
perf(http): optimize ReadableStreams backed by a resource (#14284) 2022-04-20 18:16:44 +05:30
David Sherret
ae479b1036
perf(fmt/lint): incremental formatting and linting (#14314) 2022-04-19 22:14:00 -04:00
Divy Srivastava
1c05e41f37
perf(runtime): bypass tokio file and bump op buffer size to 64K (#14319) 2022-04-19 20:11:31 +05:30
Nayeem Rahman
c30d95f2e3
feat(ext/web): add globalThis.reportError() (#13799) 2022-04-19 10:59:51 +02:00
David Sherret
a64e63c361
perf: move Deno.writeTextFile and like functions to Rust (#14221)
Co-authored-by: Luca Casonato <hello@lcas.dev>
2022-04-18 18:00:14 -04:00
Bartek Iwańczuk
a87be28a46
feat: Better formatting for AggregateError (#14285)
This commit adds "aggregated" field to "deno_core::JsError" that stores
instances of "JsError" recursively to properly handle "AggregateError"
formatting. Appropriate logics was added to "PrettyJsError" and
"console" API to format AggregateErrors.

Co-authored-by: Nayeem Rahman <nayeemrmn99@gmail.com>
2022-04-16 16:12:26 +02:00
Bartek Iwańczuk
0bb96cde72
refactor: update runtime code for primordial check x in y (#13642)
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2022-04-16 14:09:07 +02:00
David Sherret
0e4574b2e3
chore: forward v1.20.6 release commit to main (#14288) 2022-04-14 15:50:48 -04:00
Nayeem Rahman
7d50a5fd43
refactor(core/error): Clarify JsError message fields (#14269) 2022-04-13 16:41:39 +02:00
Nayeem Rahman
4d18f558e4
feat(ext/web): Add error events for event listener and timer errors (#14159)
- feat: Add handleable error event for even listener errors
- feat: Add handleable error event for setTimeout()/setInterval() errors
- feat: Add Deno.core.destructureError()
- feat: Add Deno.core.terminate()
- fix: Don't throw listener errors from dispatchEvent()
- fix: Use biased mode when selecting between mod_evaluate() and
  run_event_loop() results
2022-04-13 11:50:57 +02:00
David Sherret
b2aaf708ab
chore: forward v1.20.5 release commit to main (#14232) 2022-04-07 14:40:20 -04:00
EduM22
181e378032
fix(ext/crypto): check extractable in exportKey (#14222) 2022-04-07 18:28:56 +05:30
Divy Srivastava
995d1666ff
chore(ext/websocket): custom arity (#14202) 2022-04-04 15:19:50 +05:30
Divy Srivastava
cc49b5e0d8
chore(ext/http): custom arity (#14200) 2022-04-04 15:19:35 +05:30
Divy Srivastava
6bb555b549
chore(ext/broadcast_channel): custom arity (#14199) 2022-04-04 15:18:29 +05:30
Divy Srivastava
797cf9cdd9
chore(ext/webstorage): custom arity (#14201) 2022-04-04 15:07:26 +05:30
Divy Srivastava
1f7dd5eda9
chore(ext/url): cleanup url ops (#14177) 2022-04-03 18:12:38 +05:30
Bartek Iwańczuk
6c25b5135d
chore: update tokio, tokio-util and libc dependencies (#14174) 2022-04-02 19:54:40 +02:00
Aaron O'Mullan
94885bc293
experiment(serde_v8): derive_more enabled opaque wrappers (#14096) 2022-04-02 14:37:11 +02:00
David Sherret
7fec7c834c
1.20.4 (#14168) 2022-03-31 15:48:35 -04:00
Andreu Botella
d983b577bc
chore(wasm): Don't await on the argument to handleWasmStreaming (#14000)
`handleWasmStreaming` is the function that provides the binding with
the `fetch` API needed for `WebAssembly.instantiateStreaming()` and
`WebAssembly.compileStreaming()`. When I implemented it in #11200, I
thought V8 was calling these functions with the argument of the
`WebAssembly` streaming functions, without doing any resolving, and so
`handleWasmStreaming` awaits for the parameter to resolve. However,
as discovered in
https://github.com/denoland/deno/issues/13917#issuecomment-1065805565,
V8 does in fact resolve the parameter if it's a promise (and handles
rejections arising from that).

This change removes the `async` IIFE inside `handleWasmStreaming`,
letting initial errors be handled synchronously (which will however
not throw synchronously from the `WebAssembly` namespace functions).
Awaiting is still necessary for reading the bytes of the response,
though, and so there is an `async` IIFE for that.
2022-03-29 14:44:33 +02:00
Nayeem Rahman
317f13b63f
fix(ext/fetch): extend deprecated fetch() overload with string | Request (#14134) 2022-03-28 12:35:48 +02:00
Luca Casonato
37b0ec454c
chore: forward v1.20.3 release commit to main (#14121) 2022-03-25 18:53:55 +01:00
Rafael Ávila de Espíndola
3511b7602b
chore: update rusqlite (#14117) 2022-03-25 13:32:50 +01:00
Luca Casonato
25b73a366f
fix(ext/ffi): enforce unstable check on ops (#14115) 2022-03-25 12:29:54 +01:00
Yoshiya Hinosawa
3462d87503
fix: deprecate URL as the first arg of fetch (#14113) 2022-03-25 20:23:55 +09:00
apeltop
bb3387de17
chore(ext): fix typo in ext/webgpu, ext/fetch (#14106) 2022-03-25 00:36:30 +01:00
Kitson Kelly
cff1e92ecf 1.20.2 2022-03-24 14:47:06 +11:00
Divy Srivastava
5edcd9dd35
perf(http): avoid Set.has() when closing connection resource (#14085) 2022-03-23 13:05:34 +05:30
Yoshiya Hinosawa
7feb25d448
feat(unstable): add ref/unref to Listener (#13961)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-03-23 12:04:20 +09:00
Divy Srivastava
5c9844e5f7
perf(http): avoid checking promise every request (#14079) 2022-03-23 07:23:59 +05:30
Nayeem Rahman
d2c099ce34
fix(ext/fetch): Connect async error stack with user code (#13899) 2022-03-22 18:08:33 +01:00
David Sherret
49012cbc33
feat: upgrade to swc_ecmascript 0.137.0 (#14067) 2022-03-22 09:19:53 -04:00
Andreu Botella
12d28dffc6
fix(fetch): Fix uncaught rejection panic with WebAssembly.instantiateStreaming (#13925)
When an exception is thrown during the processing of streaming WebAssembly,
`op_wasm_streaming_abort` is called. This op calls into V8, which synchronously
rejects the promise and calls into the promise rejection handler, if applicable.
But calling an op borrows the isolate's `JsRuntimeState` for the duration of the
op, which means it is borrowed when V8 calls into `promise_reject_callback`,
which tries to borrow it again, panicking.

This change changes `op_wasm_streaming_abort` from an op to a binding
(`Deno.core.abortWasmStreaming`). Although that binding must borrow the
`JsRuntimeState` in order to access the `WasmStreamingResource` stored in the
`OpTable`, it also takes ownership of that `WasmStreamingResource` instance,
which means it can drop any borrows of the `JsRuntimeState` before calling into
V8.
2022-03-22 11:33:29 +01:00
Aaron O'Mullan
45ef3c91c2
perf(http): avoid per header alloc (#14051) 2022-03-21 12:56:30 +01:00
Andreu Botella
593801e265
cleanup(web, fetch): dedupe minesniff / "extract a MIME type" algorithm (#14044)
Closes #14002
2022-03-20 14:31:12 +01:00
Jason
0bc286ab47
fix(ext/console): fix error with a Proxy of a Map (#14032) 2022-03-20 20:21:42 +09:00
Bartek Iwańczuk
52a6e9ef4a
feat(ext/net): Deno.upgradeHttp handles unix connections (#13987) 2022-03-19 14:21:49 +01:00
Leo Kettmeir
e55dee7fd8
refactor: cleanup assert() & AssertionError definitions (#13859) 2022-03-19 13:57:37 +01:00
Aapo Alasuutari
ad8e238348
chore(core,ext): minor JS optimisations (#13950) 2022-03-19 18:26:54 +09:00
Ryan Dahl
fce60f2cc2
v1.20.1 2022-03-16 21:40:31 -04:00
Ryan Dahl
f7ab41583e
fix: cargo publish fails without absolute paths (#13993)
This reverts commit 4e3ed37037.

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-03-17 01:25:44 +01:00
Ryan Dahl
418c1eb4b3
v1.20.0 2022-03-16 16:07:35 -04:00
Bert Belder
c5270abad7
feat(unstable): Add Deno.upgradeHttp API (#13618)
This commit adds "Deno.upgradeHttp" API, which
allows to "hijack" connection and switch protocols, to eg.
implement WebSocket required for Node compat.

Co-authored-by: crowlkats <crowlkats@toaxl.com>
Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-03-16 14:54:18 +01:00
Divy Srivastava
7044bf523b
perf(web): optimize Blob.text and Blob.arrayBuffer (#13981) 2022-03-16 19:16:52 +05:30
Ryan Dahl
45b3aa22c0
feat(ext/fetch): Allow Response status 101 (#13969)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-03-16 14:30:43 +01:00
Divy Srivastava
697b60a335
perf(web): use DOMString for BlobParts (#13979) 2022-03-16 12:58:38 +05:30
木杉
395f527238
chore(ext/webidl): change spec link (#13960) 2022-03-16 03:17:50 +01:00
Aaron O'Mullan
bd481bf095
feat(ops): optional OpState (#13954) 2022-03-16 00:33:46 +01:00
Andreu Botella
672f66dde1
perf(web): Optimize TextDecoder by adding a new U16String type (#13923) 2022-03-16 00:22:00 +01:00
Aaron O'Mullan
bb53135ed8
cleanup(core): OpPair => OpDecl (#13952) 2022-03-15 23:43:17 +01:00
wspsxing
fe606c52e1
fix: upgrade reqwest to 0.11.10 (#13951) 2022-03-14 23:12:59 -04:00
Aaron O'Mullan
88d0f01948
feat(ops): custom arity (#13949)
Also cleanup & drop ignored wildcard op-args
2022-03-14 23:38:53 +01:00
Andreu Botella
9f494dc405
feat(ext/web): Add AbortSignal.timeout() (#13687) 2022-03-14 20:19:22 +01:00
Andreu Botella
c6bf07ec6d
fix(core): Don't override structured clone error messages from V8 (#13942)
In the implementation of structured serialization in
`Deno.core.serialize`, whenever there is a serialization error, an
exception will be thrown with the message "Failed to serialize
response", even though V8 provides a message to use in such cases.
This change instead throws an exception with the V8-provided message,
if there is one.
2022-03-14 19:35:15 +01:00
Divy Srivastava
b4e42953e1
feat(core): codegen ops (#13861)
Co-authored-by: Aaron O'Mullan <aaron.omullan@gmail.com>
2022-03-14 18:44:15 +01:00
Divy Srivastava
4e3ed37037
chore: improve build times for ext/ changes (#13927) 2022-03-14 09:08:54 +05:30
Filip Skokan
f9b4d262b3
fix(ext/crypto): handle JWK import with "use" (#13912) 2022-03-11 20:26:16 +05:30
Filip Skokan
6ecadf6398
fix(ext/crypto): use EcKeyImportParams dictionary (#13894) 2022-03-11 19:35:40 +05:30
Yoshiya Hinosawa
3c11768aab
v1.19.3 2022-03-10 23:29:14 +09:00
Divy Srivastava
a5957f46ee
chore(ext/crypto): remove old todos (#13887) 2022-03-09 18:13:11 +05:30
Satya Rohith
788553bf2f
chore: bump deno_http to 0.33.0 (#13867) 2022-03-07 23:16:03 +05:30
Satya Rohith
670aef5c1a
fix(ext/http): drop content-length header on compression (#13866) 2022-03-07 22:43:15 +05:30
Satya Rohith
d5642f5df7
chore: bump deno_http to 0.32.0 (#13850) 2022-03-07 00:15:10 +05:30
Aaron O'Mullan
72d593fc5c
perf(ext/web): optimize atob/btoa (#13841)
Follow up to #13839, optimizing `base64_roundtrip` ~20x (~125ms => ~6.5ms)
2022-03-05 20:12:30 +01:00
Gianluca Oldani
7e3496403a
feat(ext/net): Use socket2 crate to create TcpListener (#13808) 2022-03-05 00:43:48 +01:00
Satya Rohith
70690f54af
chore: update deps (#13821) 2022-03-05 03:38:04 +05:30
Bartek Iwańczuk
060dabee4c
feat(net): add Deno.UnixConn interface (#13787) 2022-03-04 20:33:13 +01:00
Kitson Kelly
d1db500cda
feat(ext/http): auto-compression of fixed response bodies (#13769)
Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
Co-authored-by: Satya Rohith <me@satyarohith.com>
Co-authored-by: Luca Casonato <lucacasonato@yahoo.com>
2022-03-04 16:04:39 +11:00
Satya Rohith
95459e60f6 chore: bump crate version for 1.19.2 (#13824) 2022-03-03 15:05:18 -05:00
Divy Srivastava
8b2989c417
feat(ext/crypto): AES-GCM support for 128bit IVs (#13805) 2022-03-02 10:56:10 +05:30
Bartek Iwańczuk
7e3d9084b6
feat: Add Deno.TcpConn class, change return type from Deno.connect (#13714) 2022-02-27 15:18:30 +01:00
David Sherret
4deefafdd1 chore: bump crate versions for 1.19.1 (#13760) 2022-02-24 17:45:39 -05:00
Yoshiya Hinosawa
3e8180c793
feat(ext/net): support cert, key options in listenTls (#13740) 2022-02-24 13:16:56 +09:00
Geert-Jan Zwiers
6613a312b1
docs: code example to structuredClone, CompressionStream, DecompressionStream (#13719)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-02-22 20:41:59 +01:00
Aapo Alasuutari
b1a6555c05
feat(ext/ffi): Support read only global statics (#13662) 2022-02-18 17:51:19 +05:30
Bartek Iwańczuk
e17ab6322e
chore: release crates for v1.19.0 (#13698) 2022-02-17 00:57:40 +01:00
David Sherret
b98afb59ae
feat: deno vendor (#13670) 2022-02-16 13:14:19 -05:00
Luca Casonato
02c95d367e
chore: make new TCP conn methods unstable (#13686) 2022-02-16 17:32:29 +01:00
Leo Kettmeir
8891c19c57
fix(ext/console): print circular ref indicator in cyan (#13684) 2022-02-16 16:21:59 +01:00
ylxdzsw
4dff70b434
docs(ext/fetch): fix copy-paste errors in Request docs (#13681) 2022-02-16 13:50:15 +01:00
Luca Casonato
19c8d7702f
chore: improve error messages in CompressionStream (#13585)
This commit makes the error messages that one sees when passing
something other than a BufferSource to a (De)CompressionStream. The
WPT tests already pass, because they just check for error type
(TypeError), and not error message. A TypeError was already thrown for
invalid values via serde_v8.
2022-02-16 12:21:46 +01:00
Divy Srivastava
77a9683425
fix(ext/crypto): optional additionalData in encrypt/decrypt (#13669) 2022-02-16 16:27:14 +05:30
ylxdzsw
074f53234a
feat(ext/http): add support for unix domain sockets (#13628) 2022-02-16 00:16:12 +01:00
Luca Casonato
bdc8006a36
feat(runtime): web streams in fs & net APIs (#13615)
This commit adds `readable` and `writable` properties to `Deno.File` and
`Deno.Conn`. This makes it very simple to use files and network sockets
with fetch or the native HTTP server.
2022-02-15 13:35:22 +01:00
Andreu Botella
760f4c9e24
chore(ext/timers): move ext/timers to ext/web (#13665) 2022-02-15 12:17:30 +01:00
Surma
5e845442fa
docs(websockets): add comment about Deno.upgradeWebSocket() for WebSocket servers (#13659) 2022-02-13 14:47:46 +01:00
Geert-Jan Zwiers
911ddbc733
chore(ext/fetch): render jsdoc code example properly (#13656) 2022-02-12 16:15:54 +01:00
Divy Srivastava
e218d567d5
fix(ext/crypto): support EC p256 private key material in exportKey (#13547)
Co-authored-by: Luca Casonato <hello@lcas.dev>
2022-02-08 18:48:28 +05:30
Bartek Iwańczuk
bf22f114a6
refactor: update runtime code for primordial check for iterators (#13510) 2022-02-07 13:54:32 +01:00
Zach
a7850d7fe6
fix(ext/console): fix uncaught TypeError in css styling (#13567)
When using css coloring in the console, non-color values should be ignored rather than throw exceptions.
Fixes #13469
2022-02-06 19:00:06 +09:00
Bartek Iwańczuk
82284d8052
chore: forward v1.18.2 to main (#13595) 2022-02-04 21:44:38 +01:00
Leo Kettmeir
2f438f4106
feat(ext/console): better circular information in object inspection (#13555) 2022-02-04 21:10:47 +01:00
Bartek Iwańczuk
e1d3bdfbd5
refactor: fix primordials for WebGPU (#13594) 2022-02-04 16:30:32 +01:00
Bartek Iwańczuk
8176a4d166
refactor: primordials for instanceof (#13527) 2022-02-01 18:06:11 +01:00
Divy Srivastava
abf89f8c46
fix(ext/crypto): utf16 jwk encoding (#13535) 2022-02-01 17:32:10 +05:30
Yosi Pramajaya
3e566bb457
feat(ext/net): Add Conn.setNoDelay and Conn.setKeepAlive (#13103) 2022-01-31 16:36:54 +01:00
Divy Srivastava
efa02ffa2a
fix(ext/crypto): enforce 128bits tagLength for AES-GCM decryption (#13536) 2022-01-30 18:42:29 +05:30
Bartek Iwańczuk
5cf23176dc
chore: forward v1.18.1 to main (#13514) 2022-01-27 18:52:34 +01:00
Bartek Iwańczuk
f248e6f177
Revert "refactor: update runtime code for primordial checks for "instanceof" (#13497)" (#13511)
This reverts commit 884143218f.
2022-01-27 16:27:22 +01:00
Bartek Iwańczuk
884143218f
refactor: update runtime code for primordial checks for "instanceof" (#13497) 2022-01-27 13:36:36 +01:00
Aaron O'Mullan
bd5d445da9
chore: re-enable wgpu_sync (#13453) 2022-01-24 23:47:05 +01:00
Leo Kettmeir
30ddf436d0
feat(ext/web): add CompressionStream API (#11728)
Co-authored-by: Luca Casonato <hello@lcas.dev>
Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
2022-01-24 18:03:06 +01:00
Divy Srivastava
a96b294a8a
fix(ext/crypto): duplicate RsaHashedImportParams types (#13466) 2022-01-22 09:12:18 +05:30
Divy Srivastava
16776c9ade
chore: bump crate version for 0.18.0 (#13441) 2022-01-20 20:50:39 +05:30
Divy Srivastava
23647a0d8a
fix(ext/ffi): update copyright year to 2022 (#13440) 2022-01-20 19:57:25 +05:30
Aaron O'Mullan
3ab68bd0a2
revert(#13402): experiment: wgpu sync (#13439) 2022-01-20 15:23:53 +01:00
Divy Srivastava
443d8fc41c
chore(ext/console): update ansi-regex (#13435) 2022-01-20 15:21:04 +05:30
Yoshiya Hinosawa
4c1053ad33
chore: update copyright year (#13434) 2022-01-20 16:10:16 +09:00
Luca Casonato
82b086752a
feat(ext/crypto): support importing raw EC keys (#13079)
Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2022-01-19 20:50:28 +05:30
Divy Srivastava
4da41ca8fd
fix(ext/crypto): validate maskGenAlgorithm asn1 in importKey (#13421) 2022-01-19 20:12:43 +05:30
Aaron O'Mullan
2ab21dafa7
experiment: wgpu sync (#13402) 2022-01-19 13:38:51 +01:00
Leo Kettmeir
c98fbe2fd6
chore: update urlpattern (#13422) 2022-01-19 11:57:27 +01:00
Sean Michael Wykes
9139985180
feat(ext/crypto): implement pkcs8/JWK for P-384 curves (#13154) 2022-01-19 12:14:35 +05:30
Sean Michael Wykes
77e58fe7f9
feat(ext/crypto): implement pkcs8/spki/jwk exportKey for ECDSA and ECDH (#13104) 2022-01-19 09:08:35 +05:30
Bartek Iwańczuk
b10563cb20
fix(runtime): don't crash when window is deleted (#13392)
This commit fixes an error when user deletes "window" global JS
variable. Instead of relying on "window" or "globalThis" to dispatch
"load" and "unload" events, we are default to global scope of the
worker.
2022-01-18 00:13:14 +01:00
Bartek Iwańczuk
bc666e42a8
fix(ext/console): don't depend on globalThis present (#13387) 2022-01-17 23:23:49 +01:00
David Sherret
ad224f53c7
chore: upgrade to rust 1.58 (#13377) 2022-01-15 07:10:12 +01:00
Leo Kettmeir
cf2d2b7280
fix(streams): update TypeError message for pending reads when releasing reader (#13376) 2022-01-14 18:47:16 +01:00
Leo Kettmeir
659bbd731c
feat(streams): reject pending reads when releasing reader (#13375) 2022-01-14 17:34:54 +01:00
Divy Srivastava
919ded1a0b
feat(ext/crypto): implement AES-GCM decryption (#13319) 2022-01-14 14:18:53 +05:30
Bartek Iwańczuk
9975ede773
chore: forward v1.17.3 to main (#13364) 2022-01-13 20:47:42 +01:00
DjDeveloper
62291e9b0e
feat(ext/ffi): UnsafeFnPointer API (#13340) 2022-01-12 12:38:26 +01:00
Leo Kettmeir
f955afc5ea
chore: bump rust-urlpattern to 0.1.3 (#13328) 2022-01-11 22:42:58 +01:00
Luca Casonato
f3ece7457a
fix(ext/web): handle no arguments in atob (#13341) 2022-01-11 17:31:13 +01:00
DjDeveloper
5680d33dd9
feat(ext/ffi): support alias names for symbol definitions (#13090) 2022-01-11 07:21:16 +01:00
Sean Michael Wykes
91f6c5fc7e
feat(ext/crypto): implement AES-KW for wrapKey/unwrapKey (#13286) 2022-01-11 10:14:47 +05:30
Ryan Dahl
1fb5858009
chore: update copyright to 2022 (#13306)
Co-authored-by: Erfan Safari <erfanshield@outlook.com>
2022-01-07 22:09:52 -05:00
Sean Michael Wykes
59f0eafd19
feat(ext/crypto): JWK support for unwrapKey/wrapKey (#13261) 2022-01-07 16:39:01 +05:30
Leo Kettmeir
2067820714
feat(ext/websocket): server automatically handle ping/pong for incoming WebSocket (#13172) 2022-01-06 17:41:16 +01:00
Bartek Iwańczuk
46f2ff1205
chore: forward 1.17.2 to main (#13295) 2022-01-06 13:20:42 +01:00
Leo Kettmeir
c40419b55b
feat(ext/websocket): add header support to WebSocketStream (#11887) 2022-01-05 17:41:44 +01:00
Divy Srivastava
c74eb7a889
feat(ext/crypto): implement AES-GCM encryption (#13119) 2022-01-05 20:42:30 +05:30
DjDeveloper
9778545048
fix(ext/ffi): throw errors instead of panic (#13283) 2022-01-05 12:55:31 +05:30
Sean Michael Wykes
c4a0a43ce8
fix(ext/crypto) - exportKey JWK for AES/HMAC must use base64url (#13264)
Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2022-01-05 01:00:37 +01:00
Andreu Botella
22d140ffb1
refactor(ext/web): Don't rely on NaN comparisons in TextEncoderStream (#13151)
In the `transform` function to `TextEncoderStream`'s internal
`TransformStream`, if `chunk` is the empty string and
`this.#pendingHighSurrogate` is null, then `lastCodeUnit` will be NaN.
As it turns out, this does not cause a bug because the comparison to
check for lone surrogates turns out to be false for NaN, but to rely on
it makes the code brittle.
2022-01-05 00:42:30 +01:00
Sean Michael Wykes
340764adec
fix(ext/crypto): use forgiving base64 encoding for JWK (#13240)
Implements "forgiving" in JWK decode passing suitable config to base64::decode_config
2022-01-03 17:54:45 +05:30
Sean Michael Wykes
9a42d65fc7
feat(ext/crypto): support AES-CTR encrypt/decrypt (#13177)
Fixes #13201.
2022-01-03 12:27:28 +01:00
Andreu Botella
0ead12d673
fix(doc): Make private types which show up in the rustdocs public (#13230)
`CrossIsolateStore`, `ExtensionBuilder` and `InMemoryChannelResource`
are private types which are referred to by other public APIs, and so
don't show up as links in the rustdoc. This is especially confusing for
`ExtensionBuilder`, since there is nothing in the docs that explains how
to build an extension.

Exposing these three types doesn't add any new capabilities:
`ExtensionBuilder` can be created from `Extension::builder()`,
`SharedArrayBufferStore` and `CompiledWasmModuleStore` already enable
doing anything that `CrossIsolateStore` can do by itself, and
`InMemoryChannelResource` isn't constructable.
2021-12-30 02:05:26 +01:00
Sean Michael Wykes
07618c861e
fix(ext/crypto) include AES-CTR for deriveKey (#13174) 2021-12-27 08:25:17 -05:00
Zach
de2df20d57
fix(ext/console): map basic css color keywords to ansi (#13175) 2021-12-23 13:06:24 +01:00
Bartek Iwańczuk
9391ba1098
chore: merge v1.17.1 into main (#13184) 2021-12-22 22:20:17 +01:00
Divy Srivastava
04fe513003
refactor(ext/crypto): cleanup decrypt code (#13120) 2021-12-20 16:07:36 +01:00
Leo Kettmeir
ef95d7b1e9
fix(ext/websocket): WebSocketStream don't error with "sending after closing" when closing (#13134) 2021-12-20 11:36:46 +01:00
Divy Srivastava
6de53b631f
refactor: use once_cell instead of lazy_static (#13135) 2021-12-18 16:14:42 -05:00
Luke Channings
e5a8588370
fix(ext/ffi): use c_char instead of i8 for reading strings (#13118) 2021-12-17 10:42:45 +01:00
Bartek Iwańczuk
e0cba6b19b
chore: release crates for v1.17.0 (#13112) 2021-12-16 18:51:23 +01:00
Sean Michael Wykes
60faf7a0ed
feat(ext/crypto): support importing ECSDA and ECDH (#13088)
Co-authored-by: Luca Casonato <hello@lcas.dev>
2021-12-16 17:28:43 +01:00
Andreu Botella
8efe829fca
feat(fetch): support abort reasons in fetch (#13106) 2021-12-16 12:58:24 +01:00
Andreu Botella
01a6b66034
feat: support abort reasons in Deno APIs and WebSocketStream (#13066) 2021-12-16 12:57:26 +01:00
Luca Casonato
f0e1a6b84c
refactor(ext/crypto): clean up encrypt rust code (#13094) 2021-12-15 22:18:26 +01:00
Luca Casonato
ec7d90666f
fix(ext/crypto): various cleanup in JWK imports (#13092)
This aligns all of the error messages, and makes falsey comparisons
more strict.
2021-12-15 15:46:29 +01:00
Elias Sjögreen
ee49cce726
feat(ext/ffi): implement UnsafePointer and UnsafePointerView (#12828) 2021-12-15 15:41:49 +01:00
Ben Noordhuis
4d176b7b7c
fix(ext/net): make unix and tcp identical on close (#13075)
std/http/server knows how to handle "Listener has been closed"
exceptions but not "operation canceled" errors.

Make "unix" listen sockets throw the same exception as "tcp" listen
sockets when the socket is closed and has a pending accept operation.

There is still a discrepancy when multiple accept requests are posted
but that's probably a less visible issue and something for another day.

Fixes #13033
2021-12-14 23:27:04 +01:00
Luca Casonato
b220a58d1a
feat(ext/crypto): support exporting RSA JWKs (#13081)
This commit adds support for exporting RSA JWKs in the Web Crypto API.
It also does some minor fixes for RSA JWK imports.

Co-authored-by: Sean Michael Wykes <sean.wykes@nascent.com.br>
2021-12-14 17:02:14 +01:00
Luca Casonato
5fe4d5c818
feat(ext/crypto): support importing RSA JWKs (#13071)
This commit adds support for importing RSA JWKs in the Web Crypto API.

Co-authored-by: Sean Michael Wykes <sean.wykes@nascent.com.br>
2021-12-14 12:25:07 +01:00
Luca Casonato
8fdade79da
refactor(ext/crypto): generateKey rust cleanup (#13069) 2021-12-13 18:45:08 +01:00
Yoshiya Hinosawa
308813ae29
fix(ext/web): set location undefined when --location is not specified (#13046) 2021-12-14 00:35:59 +09:00
Luca Casonato
5afb2cca65
refactor(ext/crypto): clean up exportKey rust code (#13052) 2021-12-13 13:22:03 +01:00
Luca Casonato
cbfc8dd59d
refactor(ext/crypto): symmetric jwk decode in rust (#13047) 2021-12-10 22:23:19 +01:00
Andreu Botella
0f0dd5b7ec
feat(ext/web): implement AbortSignal.prototype.throwIfAborted() (#13044)
See whatwg/dom#1034.
2021-12-10 15:12:38 +01:00
Luca Casonato
2926827726
refactor(ext/crypto): clean up rust side importKey (#13036)
This commit cleans up the Rust side of `import_key` by using a bunch of
enums instead of structs with "type" and "data" fields.

This commit does add some duplicated code for the time being, because
a lot of the other ops still need to get the same cleanup treatment.
2021-12-10 15:06:03 +01:00
Kitson Kelly
616ff1d482
chore: place @deprecated tag after documentation block (#13037) 2021-12-10 11:05:50 +11:00
Sean Michael Wykes
0129c74fd9
refactor(ext/crypto): various cleanups in js code (#13027)
Co-authored-by: Luca Casonato <hello@lcas.dev>
2021-12-09 23:32:10 +01:00
Kitson Kelly
345f0fbe5c
feat(cli): update to TypeScript 4.5 (#12410)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2021-12-10 09:12:21 +11:00
Yacine Hmito
a3d024ac2e
feat(crypto): support importKey in SPKI format (#12921)
This commit adds support for `spki` key format for `crypto.subtle.importKey` for the RSA* algorithms.
2021-12-09 20:32:55 +01:00
Luca Casonato
e70dc53460
refactor(ext/crypto): de-duplicate copyBuffer code (#13030)
This commit de-duplicates the buffer copying code in ext/crypto.

Co-authored-by: yacinehmito <yacinehmito@users.noreply.github.com>
2021-12-09 16:50:04 +01:00
Luca Casonato
fce7e4bd31
refactor(ext/crypto): clean up exportKey logic (#13029)
This commit de-duplicates and cleans up some logic in `exportKey`. There
are no functional changes in this commit (just moves code around).
2021-12-09 16:47:17 +01:00
Luca Casonato
abd25e5982
refactor(ext/crypto): clean up importKey logic (#13028)
This commit de-duplicates and cleans up some logic in `importKey`. There
are no functional changes in this commit (just moves code around).
2021-12-09 16:20:14 +01:00
Yoshiya Hinosawa
69ad5f0e78
feat(ext/timers): add refTimer, unrefTimer API (#12953) 2021-12-09 17:00:55 +09:00
Andreu Botella
318f48f9ad
feat(streams): support abort reasons in streams (#12991) 2021-12-08 23:31:22 +01:00
Andreu Botella
33da15ae5a
refactor(timers): refactor timers to use one async op per timer (#12862)
This change also makes the timers implementation closer to the spec, and
sets up the stage to implement AbortSignal.timeout() (whatwg/dom#1032).

Fixes #8965
Fixes #10974
Fixes #11398
2021-12-07 13:39:58 +01:00
Ryan Dahl
a2f1357fe8
chore: upgrade to rustls 0.20 (#12488)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Co-authored-by: Bert Belder <bertbelder@gmail.com>
2021-12-07 00:48:11 +01:00
Divy Srivastava
d31378726e
feat(ext/crypto): implement unwrapKey (#12539) 2021-12-05 04:55:11 +01:00
Bartek Iwańczuk
c59f90d01f
chore: upgrade to Rust 1.57.0 (#12968) 2021-12-04 14:19:06 +01:00
Luca Casonato
72e9720e91
chore: merge v1.16.4 into main (#12984) 2021-12-04 01:26:54 +01:00
Leo Kettmeir
46794d4e43
refactor(ext/fetch): pass opstate in FetchHandler::fetch_file 2021-12-03 14:25:16 +01:00
Ryan Dahl
14f4102ece
refactor: deno_tls does not depend on reqwest (#12961) 2021-12-01 13:20:34 -05:00
Ryan Dahl
084caffc08
refactor: cli doesn't need to depend on deno_tls (#12952)
also move create_http_client to deno_fetch
2021-12-01 11:13:11 -05:00
Ryan Dahl
f3b74350da
refactor: remove deno_fetch::HttpClientDefaults (#12931)
More clean up that should have been in cc83ad3
2021-11-29 10:29:41 -05:00
Michael Busby
6c09e02304
feat(ext/net): enable sending to broadcast address (#12860)
You can now send UDP datagrams to the broadcast address.
2021-11-29 11:14:46 +01:00
Ryan Dahl
cc83ad39ce
refactor: add deno_fetch::Options for init (#12904)
deno_fetch::init has a lot of parameters and generic on two types 
that keeps expanding over time. This refactor adds deno_fetch::Options 
struct for more clearly defining the various parameters.
2021-11-28 13:07:03 -05:00
Divy Srivastava
96d02deed6
feat(ext/crypto): support importing exporting AES JWK keys (#12444) 2021-11-28 16:48:49 +01:00
Andreu Botella
1974eb1021
fix(websocket): bad rid on WebSocketStream abort(#12913)
Fix a bad resource ID error when aborting a WebSocketStream immediately
after its creation.
2021-11-28 12:25:49 +01:00
Yury Selivanov
1d3f734e18
feat(ext/net): ALPN support in Deno.connectTls() (#12786) 2021-11-26 19:59:53 +01:00
Andreu Botella
d763633781
feat(etc/fetch): Support WebAssembly.instantiateStreaming for file fetches (#12901)
Fetching of local files, added in #12545, returns a response with no
headers, including the `Content-Type` header. This currently makes it
not work with the WebAssembly streaming APIs, which require the response
to have a content type of `application/wasm`.

Since the only way to obtain a `Response` object with a non-empty `url`
field is via `fetch()`, this change changes the content type requirement
to only apply to responses whose url has the `file:` scheme.
2021-11-26 19:52:41 +11:00
Luca Casonato
2853e37604
fix(ext/crypto): throw on key & op algo mismatch (#12838) 2021-11-25 15:57:01 +01:00
Bert Belder
c6f3493f18
chore: merge v1.16.3 into main (#12892) 2021-11-24 15:56:18 -08:00
Luca Casonato
2eae1ae665
revert: store header keys lower case internally (#12837)
This reverts commit 49ec3d10ad.
2021-11-23 01:23:11 +01:00
Luca Casonato
71ceca0ffc
fix(ext/crypto): don't panic on decryption failure (#12840) 2021-11-22 23:58:21 +01:00
Bert Belder
6a797f7ba9
chore(ext/http): deno fmt (#12798) 2021-11-17 15:34:41 -08:00
David Sherret
cd61cedd19
chore: bump crates for 1.16.2 (#12792) 2021-11-17 10:14:23 -05:00
Ryan Dahl
b2036a4db7
refactor: re-export anyhow from deno_core (#12777) 2021-11-16 09:02:28 -05:00
Luca Casonato
3250ffe020
chore: bump crate versions for 1.16.1 (#12729) 2021-11-11 11:16:05 +01:00
Luca Casonato
08067b5e12
fix: add typings for AbortSignal.reason (#12730) 2021-11-11 10:28:06 +01:00
upendra1997
e00bfecf96
fix(crypto): handling large key length in HKDF (#12692) 2021-11-11 10:04:17 +01:00
Bert Belder
72a6231a61
refactor(ext/http): rewrite hyper integration and fix bug (#12732)
Fixes: #12193
Fixes: #12251
Closes: #12714
2021-11-10 14:51:43 -08:00
Aaron O'Mullan
375ce63c63
feat(core): streams (#12596)
This allows resources to be "streams" by implementing read/write/shutdown. These streams are implicit since their nature (read/write/duplex) isn't known until called, but we could easily add another method to explicitly tag resources as streams.

`op_read/op_write/op_shutdown` are now builtin ops provided by `deno_core`

Note: this current implementation is simple & straightforward but it results in an additional alloc per read/write call

Closes #12556
2021-11-09 19:26:17 +01:00
Luca Casonato
4f64acd4e4
chore: bump crate versions for 1.16.0 (#12706) 2021-11-09 13:03:17 +01:00
Luca Casonato
0de6d1edc4
fix(fetch): set content-length for empty POST/PUT (#12703)
This commit changes `fetch` to set `content-length: 0` on POST and PUT
requests with no body.
2021-11-09 12:10:40 +01:00
Luca Casonato
75793baae8
Revert "refactor(ext/http): rewrite hyper integration and fix bug (#12332)" (#12704)
This reverts commit 5b1e537446.
2021-11-09 12:10:21 +01:00
Luca Casonato
66974a8794
fix(ext/net): expose all tls ops (#12699)
This makes it possible for implementers to cherry-pick which ops they
want to use.
2021-11-09 02:07:12 +01:00
Leo Kettmeir
ccd730a8b7
feat(ext/web): add AbortSignal.reason (#12697) 2021-11-08 23:37:06 +01:00
Bert Belder
5b1e537446
refactor(ext/http): rewrite hyper integration and fix bug (#12332)
Fixes: #12193
2021-11-08 12:49:11 -08:00
Leo Kettmeir
c91da1222b
feat(ext/web): WritableStreamDefaultController.signal (#12654) 2021-11-08 12:54:24 +01:00
Leo Kettmeir
ed761bf83f
BREAKING chore(ext/web): remove ReadableStream.getIterator (#12652) 2021-11-05 22:21:25 +01:00
Leo Kettmeir
26a5471302
fix: typings for BYOB stream readers (#12651) 2021-11-05 12:56:28 +01:00
Ryan Dahl
7c2abb9d57
fix: Deno.emit crashes with BorrowMutError (#12627)
Warn on await_holding_refcell_ref clippy rule to avoid this in the future.

Fixes #12453
2021-11-03 09:27:36 -04:00
Leo Kettmeir
95b2955712
feat(ext/web): BYOB support for ReadableStream (#12616)
This commit introduces support for BYOB readers in the WHATWG Streams API implementation.
2021-11-03 10:47:40 +01:00
Bartek Iwańczuk
8e31bbbe55
chore: update to Rust edition 2021 (#12578) 2021-11-02 10:03:37 -04:00
Kitson Kelly
d3662e487d
feat(ext/fetch): support fetching local files (#12545)
Closes #11925
Closes #2150

Co-authored-by: Bert Belder <bertbelder@gmail.com>
2021-11-01 15:29:46 +11:00
Aaron O'Mullan
e98a36b213
cleanup(ext/fetch): consistent op names (#12612)
Rename `op_create_http_client` to `op_fetch_custom_client` to follow prefix/namespaced convention
2021-10-31 19:14:22 +01:00
Kenta Moriuchi
95b9e5f30f
feat(ext/console): Display error.cause in console (#12462) 2021-10-30 19:25:46 +02:00
Aaron O'Mullan
94a81e5e9b
cleanup(ext/net): consistent op names (#12607) 2021-10-30 18:51:42 +02:00
Luca Casonato
b7341438f2
feat: stabilize Deno.startTls (#12581)
This commit stabilizes `Deno.startTls` and removes `certFile` from the
`StartTlsOptions`.
2021-10-29 17:13:31 +02:00
Malted
8e0fd1dca1
fix(ext/fetch): Replace redundant local variable with inline return statement (#12583) 2021-10-29 13:42:10 +02:00
Andreu Botella
bc8e94155a
fix(encoding): support additional encoding labels (#12586) 2021-10-29 10:31:42 +05:30
Andreu Botella
74a93fdf63
fix(webidl): Don't throw when converting a detached buffer source (#12585)
The Web IDL conversion to `BufferSource` and similar types shouldn't
check whether the buffer is detached.

In the case of `TextDecoder`, our implementation would still throw after
the Web IDL conversions because we're creating a new `Uint8Array` from
the buffer source's buffer, which throws if it's detached. This change
also fixes this bug.
2021-10-28 23:17:27 +02:00
Andreu Botella
507ab50e0f
perf(encoding): avoid copying the input data in TextDecoder (#12573)
The implementation of `TextDecoder` had a bug where it was copying the
input data in every case. This change removes that copy in
non-`SharedArrayBuffer` cases.

Since passing a shared buffer source to Rust would fail, this copy of
the input data was making `TextDecoder` work in cases where the input
is shared. In order to avoid a breaking change, the copy is retained in
those cases.
2021-10-29 07:32:58 +11:00
Kitson Kelly
1c739470b5
feat(ext/webstorage): use implied origin when --location not set (#12548)
Closes #11882

BREAKING CHANGE: Previously when `--location` was set, the unique storage key was derived from the the URL of the location instead of just the origin. This change correctly uses just the origin. This may cause previously persisted storage to change its key and data to not be available with the same location as before.
2021-10-27 11:10:27 +11:00
Leo K
6268703487
fix(ext/http): allow multiple values in upgrade header for websocket (#12551)
Co-authored-by: Aaron O'Mullan <aaron.omullan@gmail.com>
2021-10-26 23:06:44 +02:00
Ryan Dahl
9161e74a7d
Use libffi-rs instead of deno-libffi (#12555)
Fork is no longer necessary since https://github.com/tov/libffi-rs/pull/33
landed.
2021-10-26 16:30:27 -04:00
Bert Belder
cf9c4f0031
feat(ext/net): add TlsConn.handshake() (#12467)
A `handshake()` method was added that returns when the TLS handshake is
complete. The `TlsListener` and `TlsConn` interfaces were added to
accomodate this new method.

Closes: #11759.
2021-10-26 22:27:47 +02:00
Aaron O'Mullan
c27ef0ac7b
perf(http): encode string bodies in op-layer (#12451)
Using serde_v8's StringOrBuffer
2021-10-26 22:00:01 +02:00
Andreu Botella
e39dace8cb
fix(tls): Make TLS clients support HTTP/2 (#12530)
`fetch()` and client-side websocket used to support HTTP/2, but this
regressed in #11491. This patch reenables it by explicitly adding `h2`
and `http/1.1` to the list of ALPN protocols on the HTTP and websocket
clients.
2021-10-25 18:41:06 +02:00
Yoshiya Hinosawa
c7dcf1cbdd
chore: bump crate version for 1.15.3 (#12531) 2021-10-25 15:48:01 +09:00
Bartek Iwańczuk
2997021615
fix: declare web types as global (#12497)
Co-authored-by: Feng Yu <F3n67u@outlook.com>
2021-10-21 08:47:14 +02:00
Bert Belder
6a96560986
fix(ext/net): fix TLS bugs and add 'op_tls_handshake' (#12501)
A bug was fixed that could cause a hang when a method was
called on a TlsConn object that had thrown an exception earlier.

Additionally, a bug was fixed that caused TlsConn.write() to not
completely flush large buffers (>64kB) to the socket.

The public `TlsConn.handshake()` API is scheduled for inclusion in the
next minor release. See https://github.com/denoland/deno/pull/12467.
2021-10-20 01:30:04 +02:00
Leo K
d6062b2653
fix(ext/websocket): prevent 'closed normally' panic (#12437) 2021-10-19 18:21:15 +02:00
Bartek Iwańczuk
1cd9272a91
chore: release crates for v1.15.2 (#12478) 2021-10-18 20:30:00 +02:00
Satya Rohith
63379185e2
docs(ext/url): typo in URLPatternResult (#12470) 2021-10-18 00:07:18 +05:30
Bert Belder
ff932b411d
fix(core): poll async ops eagerly (#12385)
Currently all async ops are polled lazily, which means that op
initialization code is postponed until control is yielded to the event
loop. This has some weird consequences, e.g.

```js
let listener = Deno.listen(...);
let conn_promise = listener.accept();
listener.close();
// `BadResource` is thrown. A reasonable error would be `Interrupted`.
let conn = await conn_promise;
```

JavaScript promises are expected to be eagerly evaluated. This patch
makes ops actually do that.
2021-10-17 19:50:42 +02:00
Ikko Ashimine
a1d6b53acd
docs(ext/http): fix typo in http/lib.rs (#12466) 2021-10-17 20:04:44 +09:00
Libing Chen
004d07dccd
fix(docs): correct pattern.match() to pattern.exec() (#12450) 2021-10-15 11:25:48 +02:00
Kenta Moriuchi
1d55fcb74c
fix(console): fix display of primitive wrapper objects (#12425) 2021-10-14 12:52:08 +09:00