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

110 commits

Author SHA1 Message Date
Aaron O'Mullan
5f41f822e7
perf(webidl): optimize createRecordConverter() (#12286)
Cuts self-time by ~6x, 172ns/iter => 22ns/iter benched on 1M Response builds / HeadersInit calls
2021-10-04 15:39:32 +02:00
Andreu Botella
2170a41d97
feat(web): Implement DOMException's stack property. (#12294)
As per WebIDL (https://heycam.github.io/webidl/#es-DOMException-specialness),
if `Error` objects have a `stack` property, so should `DOMException`
instances.
2021-10-03 17:21:49 +02:00
Divy Srivastava
8884141c3f
fix(ext/crypto): missing Aes key typings (#12307) 2021-10-03 15:24:46 +02:00
Ahab
198f5b9514
fix(ext/net): should not panic when listening to unix abstract address (#12300) 2021-10-02 19:09:59 +02:00
Divy Srivastava
21520f5ff1
feat(ext/crypto): decode RSAES-OAEP-params with default values (#12292) 2021-10-02 15:20:53 +02:00
Divy Srivastava
1dfa35b2ba
fix(ext/crypto): use NotSupportedError for importKey() (#12289) 2021-10-01 13:16:11 +02:00
Aaron O'Mullan
f68825eda0
perf(fetch): optimize fillHeaders() key iteration (#12287)
Reduces self-time by ~70x (~70ms => ~1ms on 1M iters)

for...in filtered by hasOwnProperty yields the same set of keys as Object.keys()
2021-10-01 12:17:16 +02:00
Divy Srivastava
5065c7bcd9
feat(ext/crypto): implement wrapKey (#12125) 2021-10-01 11:39:49 +02:00
Divy Srivastava
c0b6c0eea5
fix(ext/crypto): decode id-RSASSA-PSS with default params (#12147) 2021-10-01 11:14:16 +02:00
Aaron O'Mullan
7f390612a3
perf(web): optimize byteLowerCase() (#12282) 2021-10-01 01:03:51 +02:00
Aaron O'Mullan
72836478f2
perf(webidl): optimize createDictionaryConverter() (#12279)
On a benchmark constructing Responses with headers this shaves off 25%
2021-09-30 21:33:12 +02:00
Aaron O'Mullan
68e5cdaff0
perf(web): ~400x faster http header trimming (#12277)
Use a regex substring match with a first/last char fastpath instead of 2 regex replaces. Roughly ~400x faster (423ms vs 0.7ms in profiled runs)
2021-09-30 18:39:55 +02:00
Luca Casonato
0d7a417f33
feat(tls): custom in memory CA certificates (#12219)
This adds support for using in memory CA certificates for
`Deno.startTLS`, `Deno.connectTLS` and `Deno.createHttpClient`.

`certFile` is deprecated in `startTls` and `connectTls`, and removed
from `Deno.createHttpClient`.
2021-09-30 09:26:15 +02:00
mynane
62920e4ef5
fix(ext/http): merge identical if/else branches (#12269) 2021-09-29 11:55:10 -07:00
Aaron O'Mullan
4cf744032d
perf(web/Event): move last class field to constructor (#12265) 2021-09-29 20:50:25 +02:00
Ahab
923d9c7786
fix(ext/fetch): avoid panic when header is invalid (#12244) 2021-09-29 18:42:06 +02:00
Aaron O'Mullan
c896ba2e19
perf(webidl/DOMString): don't wrap string primitives (#12266) 2021-09-29 18:06:29 +02:00
Aaron O'Mullan
e8901281da
chore: bump crate versions for 1.14.2 (#12253) 2021-09-28 12:19:03 +02:00
Aaron O'Mullan
9167f0c6bd
perf(fetch): optimize newInnerRequest blob url check (#12245)
Avoid "blob:" prefix check on requests built in the http module since those can never be blob objects

Reduces cost of `newInnerRequest()` from 20ms to 0.1ms in my profiled run on ~2.5M reqs
2021-09-27 13:19:24 +02:00
Aaron O'Mullan
0964685486
refactor(fetch/Request): inline defaultInnerRequest (#12241)
Similar to #12235
2021-09-27 11:13:27 +02:00
Aaron O'Mullan
8aba521e18
perf(fetch/Response): avoid class fields (#12237) 2021-09-27 10:51:32 +02:00
Aaron O'Mullan
34a15545c9
refactor(fetch/response): inline defaultInnerResponse (#12235)
Not useful to have the defaults externally defined when they're only used in `newInnerResponse()`. Also match order in `newInnerResponse()` and `cloneInnerResponse`
2021-09-26 23:46:56 +02:00
Aaron O'Mullan
5788f2e082
perf(web): optimize Event constructor (#12231)
Assign in constructor instead of using class initializers which are currently ~10x slower
2021-09-26 20:41:05 +02:00
Aaron O'Mullan
1749e79f97
perf(webidl/ByteString): 3x faster ASCII check (#12230) 2021-09-26 20:40:37 +02:00
Aaron O'Mullan
7f2976b3e6
perf(fetch): optimize InnerBody constructor (#12232)
Avoid initializers due to overhead
2021-09-26 20:40:16 +02:00
Ben Noordhuis
2b6f8d0187
fix(ext/http): include port number in h2 urls (#12181) 2021-09-26 20:26:16 +02:00
Aaron O'Mullan
6c007aa5ab
perf(fetch/headers): optimize appendHeader (#12234)
Use a single regex to check for `\0`, `\n`, `\r` instead of 3 `String.includes(...)` calls
2021-09-26 20:19:02 +02:00
Luis Malheiro
b095157c1d
perf(ext/fetch): Use the WebIDL conversion to DOMString rather than USVString for Response constructor (#12201) 2021-09-25 15:30:31 +02:00
Dan Rose
09f2cdbc72
fix(ext/web): FileReader error messages (#12218) 2021-09-25 15:28:17 +02:00
Aaron O'Mullan
3c88dffd32
fix(http): panic when responding to a closed conn (#12216)
Our oneshot receiver in `HyperService::call` would unwrap and panic, the `.await` on the oneshot receiver happens when the sender is dropped.

The sender is dropped in `op_http_response` because:
1. We take `ResponseSenderResource`
2. Then get `ConnResource` and early exit on failure (conn already closed)
3. The taken sender then gets dropped in this early exit before any response is sent over the channel

Fallbacking to returning a dummy response to hyper seems to be a fine quickfix
2021-09-25 13:22:19 +02:00
Ben Noordhuis
16ea39ee48
fix(ext/http): fortify "is websocket?" check (#12179)
Check for expected headers more rigorously and check that it's a
HTTP/1.1 GET request. The logic mirrors what Deno Deploy and the
tungstenite crate do.

The presence of "Sec-Websocket-Version: 13" is now also enforced.
I don't expect that to break anything: conforming clients already
send it and tungstenite can't talk to older clients anyway.

The new code is more efficient due to heap-allocating less and aligns
more closely with the checks in ext/http/01_http.js now.
2021-09-25 10:02:26 +02:00
李瑞丰
46245b830a
fix(ext/webidl): correctly apply [SymbolToStringTag] to interfaces (#11851)
Co-authored-by: Luca Casonato <hello@lcas.dev>
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2021-09-25 02:07:22 +09:00
Aaron O'Mullan
e0c858fa27
perf(ext/fetch): skip USVString webidl conv on string constructor (#12168)
* perf(ext/fetch): skip USVString webidl conv on string constructor
* Rename webidl convert to RequestInfo_DOMString

To disambiguate and hint that it normalizes to DOMString instead of USVString since DOMString => USVString is handled by `op_url_parse` when calling `new URL(...)`
2021-09-23 11:40:58 +02:00
Ben Noordhuis
82cfb46bd1
chore(ext/net): improve embedder friendliness (#12178)
Default to None if UnsafelyIgnoreCertificateErrors is not present in the
OpState.

Embedders may not have a need for restricting outgoing TLS connections
and having them hunt through the source code for the magic incantation
that makes the borrow panics go away, is less user friendly.
2021-09-22 11:12:08 +02:00
Kitson Kelly
2a56cd545c
chore: bump crate versions for 1.14.1 (#12172) 2021-09-22 06:53:47 +10:00
Aaron O'Mullan
22a6f4166e
cleanup(ext/fetch): drop redundant webidl converters in fetch() (#12167)
Since those inputs are passed to `new Request(...)` which applies webidl converters
2021-09-21 18:51:56 +02:00
Aaron O'Mullan
0aa6fefce7
perf(ext/web): optimize EventTarget (#12166)
and all its subclasses including `AbortSignal` ...

Instead of storing associated data in a global `WeakMap` we store them as private attributes (via a Symbol) on the object instances
2021-09-21 17:51:44 +02:00
Aaron O'Mullan
f827b93df4
perf(web): optimize AbortController (#12165)
- Use regular class constructor and symbol "private" attributes
- Lazy init Set of follower signals
2021-09-21 17:38:57 +02:00
Satya Rohith
923c5432e0
chore: bump deno_net (#12157) 2021-09-21 09:20:21 +05:30
Satya Rohith
3708cbc600
refactor(ext/net): make op_connect & op_connect_tls public (#12150) 2021-09-20 19:35:23 +05:30
Squirrel
4b79e5a459
chore: Remove unused deps from Cargo.toml files (#12106) 2021-09-17 14:39:32 +02:00
Divy Srivastava
868f38d452
fix(ext/crypto): use DataError in importKey() (#12071) 2021-09-16 09:58:29 +02:00
Divy Srivastava
9270cad67c
fix(ext/crypto): don't use core.decode for encoding jwk keys (#12088) 2021-09-16 09:12:38 +02:00
David Sherret
16c27fce1f
chore: bump crate versions for 0.14 (#12072) 2021-09-14 15:38:35 -04:00
Divy Srivastava
c41460ecc4
feat(ext/crypto): import RSA pkcs#8 keys (#11891) 2021-09-14 15:21:20 +02:00
Andreu Botella
4d6f412b0b
refactor(core): Turn the wasm_streaming_feed binding into ops (#11985)
Async WebAssembly compilation was implemented by adding two
bindings: `set_wasm_streaming_callback`, which registered a callback to
be called whenever a streaming wasm compilation was started, and
`wasm_streaming_feed`, which let the JS callback modify the state of the
v8 wasm compiler.

`set_wasm_streaming_callback` cannot currently be implemented as
anything other than a binding, but `wasm_streaming_feed` does not really
need to use anything specific to bindings, and could indeed be
implemented as one or more ops. This PR does that, resulting in a
simplification of the relevant code.

There are three operations on the state of the v8 wasm compiler that
`wasm_streaming_feed` allowed: feeding new bytes into the compiler,
letting it know that there are no more bytes coming from the network,
and aborting the compilation. This PR provides `op_wasm_streaming_feed`
to feed new bytes into the compiler, and `op_wasm_streaming_abort` to
abort the compilation. It doesn't provide an op to let v8 know that the
response is finished, but closing the resource with `Deno.core.close()`
will achieve that.
2021-09-13 14:27:54 +02:00
Luca Casonato
d0b5ff6db9
feat(ext/crypto): generate ECDH keys (#11870)
Add support for ECDH algorithm in SubtleCrypto#generateKey.
2021-09-13 11:35:49 +02:00
Divy Srivastava
2199bdaf64
feat(ext/crypto): export RSA keys as pkcs#8 (#11880) 2021-09-13 11:33:28 +02:00
Nayeem Rahman
2cc1577d28
fix(ext/fetch): Properly cancel upload stream when aborting (#11966)
Co-authored-by: Luca Casonato <lucacasonato@yahoo.com>
2021-09-13 01:19:38 +02:00
Divy Srivastava
0520ae62dd
fix(ext/crypto): add HkdfParams and Pkdf2Params types (#11991) 2021-09-12 23:02:49 +02:00