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

1135 commits

Author SHA1 Message Date
David Sherret
4b3845b998
feat(repl): support import declarations in the REPL (#11086) 2021-06-24 09:00:46 -04:00
Kitson Kelly
8ed83cba7e
fix(lsp): handle invalid config setting better (#11104)
Fixes #11100 
Fixes #10808
2021-06-24 22:41:04 +10:00
Benjamin Gruenbaum
20b0a5125a
feat(core): support AbortSignal in readFile (#10943) 2021-06-22 11:45:26 -04:00
Luca Casonato
6261c89e04
feat: transfer MessagePort between workers (#11076)
Add support for transferring `MessagePort`s between workers.
2021-06-22 16:30:16 +02:00
Yoshiya Hinosawa
4e3ec47857
fix(runtime): fix signal promise API (#11069) 2021-06-22 15:17:44 +09:00
Vladimir Ivanov
cd59601b34
fix(extensions/fetch): Filter out custom HOST headers (#11020)
This commit updates "fetch" API to ignore custom "Host" headers
and return value provided by "reqwest".
2021-06-22 05:42:04 +02:00
Tomofumi Chiba
4f1b1903cf
feat(fetch): add programmatic proxy (#10907)
This commit adds new options to unstable "Deno.createHttpClient" API.

"proxy" and "basicAuth" options were added that allow to use custom proxy
when client instance is passed to "fetch" API.
2021-06-22 05:21:57 +02:00
Charlie Moog
580c9f9ef0
fix(core): don't panic on stdout/stderr write failures in Deno.core.print (#11039) 2021-06-22 04:39:59 +02:00
Muthu Kumar
388274e02e
fix: move stable/unstable types/APIs to their correct places (#10880)
- Moved ppid and memoryUsage types from deno.unstable to deno.ns.
- Moved sleepSync to unstable object, shutdown to stable object.
2021-06-22 03:03:00 +02:00
Bartek Iwańczuk
9105892ec8
refactor: unify JavaScript script execution method (#11043)
This commit renames "JsRuntime::execute" to "JsRuntime::execute_script". Additionally
same renames were applied to methods on "deno_runtime::Worker" and
"deno_runtime::WebWorker".

A new macro was added to "deno_core" called "located_script_name" which
returns the name of Rust file alongside line no and col no of that call site.
This macro is useful in combination with "JsRuntime::execute_script"
and allows to provide accurate place where "one-off" JavaScript scripts
are executed for internal runtime functions.

Co-authored-by: Nayeem Rahman <nayeemrmn99@gmail.com>
2021-06-22 01:45:41 +02:00
Kitson Kelly
a5eb2dfc93
fix(#10761): graph errors reported as diagnostics for Deno.emit() (#10767)
Fixes #10761
2021-06-22 07:27:32 +10:00
Kitson Kelly
281c4cd8fc
feat(cli): support "types" when type checking (#10999)
Fixes #10677
2021-06-22 07:18:32 +10:00
Kitson Kelly
cda15f2a98
feat: Deno namespace configurable and unfrozen (#11062)
Closes #11033
2021-06-22 07:17:35 +10:00
David Sherret
2d2b5625e0
feat(repl): Type stripping in the REPL (#10934) 2021-06-21 15:13:25 -04:00
Luca Casonato
f9ff981daf
feat: MessageChannel and MessagePort (#11051)
This commit introduces support for MessageChannel and MessagePort.
MessagePorts can be transfered across other MessagePorts.
2021-06-21 19:53:52 +02:00
Satya Rohith
952caa79b3
feat(lsp): quick fix actions to ignore lint errors (#10627)
Closes #10122
2021-06-21 16:43:35 +10:00
David Sherret
60071c941b
fix(lsp): do not rename in strings and comments (#11041) 2021-06-19 11:23:50 -04:00
Nayeem Rahman
2ea41d3ac1
fix(core/modules): Prepare modules only once per runtime (#11015)
This commit changes module loading implementation in "deno_core"
to call "ModuleLoader::prepare" hook only once per entry point.

This is done to avoid multiple type checking of the same code
in case of duplicated dynamic imports.

Relevant code in "cli/module_graph.rs" was updated as well.
2021-06-19 16:14:43 +02:00
Bartek Iwańczuk
a8e4fc15e5
fix: Worker accepts specifier as URL (#11038)
This commit updates type declarations for Worker to accept specifiers
as either strings or URL, bringing it in line with TypeScript
declarations and browser behavior.
2021-06-18 21:34:51 +02:00
David Sherret
984b8bf0c8
fix(inspector): Deno.inspect should inspect the object the proxy represents rather than the target of the proxy (#10977) 2021-06-15 15:33:13 -04:00
David Sherret
b4026dac9c
fix(repl): Complete declarations (#10963) 2021-06-15 09:31:36 -04:00
Bartek Iwańczuk
1246a433f8
fix: poll connection after writing response chunk in Deno.serveHttp() (#10961)
This commit changes "op_http_response_write" to first send response chunk
and then poll the underlying HTTP connection.

Previously after writing a chunk of response HTTP connection wasn't polled
and thus data wasn't written to the socket until after next op interacting 
with the connection.
2021-06-14 22:10:55 +02:00
Bartek Iwańczuk
1e1959f6fa
fix: hang in Deno.serveHttp() (#10923)
Waiting on next request in Deno.serveHttp() API hanged
when responses were using ReadableStream. This was caused
by op_http_request_next op that was never woken after
response was fully written. This commit adds waker field to
DenoService which is called after response is finished.
2021-06-14 14:52:49 +02:00
David Sherret
9d706d71b5
chore: Fix broken test on Windows (#10900) 2021-06-10 12:35:38 -04:00
David Sherret
26a97a1f3b
chore(tests): Kill orphaned deno processes spawned during the tests (#10922) 2021-06-10 10:38:03 -04:00
Kitson Kelly
e779ea9565
fix(runtime): early binding to dispatchEvent in workers (#10904) 2021-06-09 22:21:02 +10:00
Divy Srivastava
89290741d1
feat(compile): Initialize runtime_compiler ops for standalone binaries (#10052) 2021-06-07 14:02:53 +02:00
Kitson Kelly
3b3be024fa
feat(lsp): add test code lens (#10874)
Ref #8643
2021-06-07 21:38:07 +10:00
Kitson Kelly
d6f6e157bd
tests(lsp): fix flakey lsp integration test (#10875) 2021-06-07 19:12:07 +10:00
jeiea
633c5aab1f
fix(#10747): cannot read config option in windows (#10791)
Fixes #10747
2021-06-06 15:00:17 +10:00
Luca Casonato
c73ef5fa14
refactor(web): use encoding_rs for text encoding (#10844)
This commit removes all JS based text encoding / text decoding. Instead
encoding now happens in Rust via encoding_rs (already in tree). This
implementation retains stream support, but adds the last missing
encodings. We are incredibly close to 100% WPT on text encoding now.

This should reduce our baseline heap by quite a bit.
2021-06-05 23:10:07 +02:00
Divy Srivastava
e67010b5e2
feat(cli/compile): Support data uri dynamic imports in deno compile (#9936) 2021-06-05 16:24:17 +02:00
Kitson Kelly
e8be116ab6
fix(lsp): refactor, fix issues and add benchmark for code lens (#10841) 2021-06-05 07:31:44 +10:00
Bartek Iwańczuk
5457e741fa
fix: hang in op_http_next_request (#10836)
This commit adds "CancelHandle" to "ConnResource" and changes
"op_http_next_request" to await for the cancel signal. In turn
when async iterating over "Deno.HttpConn" the iterator breaks
upon closing of the resource.
2021-06-04 01:32:36 +02:00
Yusuke Tanaka
41e9a21307
fix(cli): output json with trailing newline character (#10830) 2021-06-03 20:49:02 +02:00
Casper Beyer
ece56d9935
feat(runtime): support URL overloads for Deno.symlink and Deno.symlinkSync (#10664) 2021-06-03 16:16:00 +02:00
Casper Beyer
dc69b03339
feat(runtime): support URL overloads for Deno.rename/Deno.renameSync (#10512) 2021-06-03 16:14:37 +02:00
Kitson Kelly
844a1317ec
fix(#10775): diagnostics update on dependency changes (#10817)
Fixes #10775
2021-06-03 21:13:53 +10:00
Kitson Kelly
473713c621
fix(#10815): lsp only responds to formatting for md, json, jsonc (#10816)
Fixes #10815
2021-06-02 20:29:58 +10:00
Kitson Kelly
bb5bf91067
feat(lsp): registry auto discovery (#10813)
Closes: #10194
Fixes: #10468
2021-06-01 21:53:08 +10:00
Kitson Kelly
9abb899f5f
fix(lsp): updates to workspace config are processed sync (#10812) 2021-06-01 19:24:36 +10:00
Nayeem Rahman
6dd7a7ecd9
fix(cli): represent bare imports as module graph error slots (#10804)
Fixes #10795
2021-06-01 16:45:37 +10:00
Yoshiya Hinosawa
595700c993
feat: add FsWatcher interface (#10798) 2021-06-01 15:35:06 +09:00
Casper Beyer
330cd6b7ea
feat(cli): support URL overloads for Deno.utime and Deno.utimeSync (#10792) 2021-05-31 20:05:57 +02:00
Nayeem Rahman
3a33510bd4
fix(cli): Don't statically error on dynamic unmapped bare specifiers (#10618)
Fixes #10168
Fixes #10615
Fixes #10616
2021-05-31 10:20:34 +10:00
Kitson Kelly
bbefceddb9
fix(#10765): lsp import fixes include extensions (#10778)
Fixes #10765
2021-05-29 21:21:11 +10:00
Kitson Kelly
59237d195f
feat(cli): upgrade to TypeScript 4.3 (#9960) 2021-05-28 09:33:11 +10:00
crowlKats
b21fa78a1e
feat(cli): add origin data dir to deno info (#10589)
Co-authored-by: Nayeem Rahman <nayeemrmn99@gmail.com>
Co-authored-by: Luca Casonato <lucacasonato@yahoo.com>
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2021-05-27 14:23:12 +09:00
Luca Casonato
d5d59bb794
fix(fetch): make prototype properties writable (#10769) 2021-05-26 23:44:42 +02:00
Yoshiya Hinosawa
c8b3f85796
fix(extension/file): update File constructor following the spec (#10760) 2021-05-25 22:35:17 +09:00
Kitson Kelly
cd4194a5e4
feat(lsp): diagnostics for deno types and triple-slash refs (#10699)
Fixes #9823
2021-05-25 12:34:01 +10:00
Casper Beyer
6044b037fb
fix(cli/test): don't use reserved symbol : in specifier (#10751) 2021-05-24 17:26:04 +02:00
Ben Noordhuis
af1546391c feat(extensions): BroadcastChannel WPT conformance
Replaces the file-backed provider by an in-memory one because proper
file locking is a hard problem that detracts from the proof of concept.

Teach the WPT runner how to extract tests from .html files because all
the relevant tests in test_util/wpt/webmessaging/broadcastchannel are
inside basics.html and interface.html.
2021-05-23 15:16:42 +02:00
Yoshiya Hinosawa
b3f2502b32
fix(test): ensure coverage dir exists (#10717) 2021-05-21 22:57:00 +09:00
Yoshiya Hinosawa
4a9b40b717
fix(runtime/http): fix empty blob response (#10689) 2021-05-21 10:11:53 +09:00
Kitson Kelly
8708d3c045
chore(lsp): provide test for lsp deadlock issue (#10679)
Resolves: #10587
2021-05-21 07:35:37 +10:00
Casper Beyer
c9db09630d
fix(cli/tools/test_runner): --doc should not require permissions (#10719) 2021-05-20 15:02:39 +02:00
Kitson Kelly
014d8d51c0
fix(lsp): re-enable the per resource configuration without a deadlock (#10625)
Fixes #10603
2021-05-20 19:56:48 +10:00
Casper Beyer
df7639c096
test(cli/dts): typecheck examples in declaration files (#10707)
This commits adds two integration tests that typecheck examples
in the docstrings in Deno declaration files.
2021-05-19 18:41:36 +02:00
Casper Beyer
8a9b83b3ea
docs(cli/dts): fix plugin example (#10647) 2021-05-19 15:07:10 +02:00
Nayeem Rahman
b43b639f45
fix(runtime/http): expose nextRequest() errors in respondWith() (#10384) 2021-05-19 21:39:52 +09:00
Kitson Kelly
91decbfabf
fix(#10695): deps diagnostics include data property (#10696)
Fixes #10695
2021-05-19 22:28:23 +10:00
Satya Rohith
5127bb0d89
fix(runtime): support source maps with Deno.emit() and bundle (#10510)
Closes: #10413
2021-05-19 14:18:01 +10:00
Yusuke Tanaka
cda09c166f
chore: update deno_lint binary used in CI to v0.5.0 (#10652) 2021-05-18 17:24:01 +02:00
Kitson Kelly
12bfdef62c
feat(lsp): provide X-Deno-Warning as a diagnostic (#10680)
Closes #9932
2021-05-18 20:19:52 +10:00
Satya Rohith
d69a5fbe1a
feat(lsp): support formatting json and markdown files (#10180)
Resolves #9447
Resolves #9415
2021-05-18 16:35:46 +10:00
Kitson Kelly
27e7bb090e
refactor: share test harness for lsp between bench and integration (#10659) 2021-05-18 06:45:13 +10:00
Luca Casonato
30b2779bb6
tests: fix broken tests on main (#10663) 2021-05-17 12:59:11 +02:00
Luca Casonato
5151afa123
fix: static import permissions in dynamic imports
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2021-05-17 09:45:54 +02:00
Casper Beyer
910935c071
feat(runtime): support urls for Deno.realPath and Deno.realPathSync (#10626) 2021-05-17 06:31:21 +02:00
Bartek Iwańczuk
57927781ed
v1.10.0 2021-05-12 02:06:07 +02:00
Bartek Iwańczuk
8d88a83b88
disable test_watch integration test (#10594) 2021-05-11 22:09:44 +02:00
Tim Ramlot
635253bd3a
feat(runtime/worker): Structured cloning worker message passing (#9323)
This commit upgrade "Worker.postMessage()" implementation to use 
structured clone algorithm instead of non-spec compliant JSON serialization.
2021-05-11 21:09:09 +02:00
Bert Belder
640d431b35
fix(tls): flush send buffer in the background after closing TLS stream (#10146)
In #9118, TLS streams were split into a "read half" and a "write half"
using tokio::io::split() to allow concurrent Conn#read() and
Conn#write() calls without one blocking the other. However, this
introduced a bug: outgoing data gets discarded when the TLS stream is
gracefully closed, because the read half is closed too early, before all
TLS control data has been received.

Fixes: #9692
Fixes: #10049
Fixes: #10296
Fixes: denoland/deno_std#750
2021-05-11 03:11:26 +02:00
Casper Beyer
36c5461129
feat(test): add support for type checking documentation (#10521)
This commit adds support for type checking codeblocks in the JS doc 
comments.
2021-05-11 01:54:39 +02:00
Bartek Iwańczuk
c44e53a5b6
chore: upgrade crates (#10559) 2021-05-10 22:39:16 +02:00
Ryan Dahl
18c75f0e42
Switch grant/deny prompt to yes/no (#10547) 2021-05-10 07:11:34 -04:00
Bartek Iwańczuk
32ad8f77d6
test: run deno test --watch test only on unix (#10550) 2021-05-10 10:51:49 +02:00
Liam Murphy
7a9ebd1585
feat: add deno test --watch (#9160)
This commit implements file watching for deno test.

When a file is changed, only the test modules which 
use it as a dependency are rerun.

This is accomplished by reworking the file watching infrastructure 
to pass the paths which have changed to the resolver, and then 
constructing a module graph for each test module to check if it 
contains any changed files.
2021-05-10 08:06:13 +02:00
Thiago Padilha
18a684ab1c
fix: TextEncoder#encodeInto spec compliance + perf gains (#10129) 2021-05-08 23:31:40 +02:00
Aaron O'Mullan
1e8e44f4c3
refactor(ops): replace ZeroCopyBuf arg by 2nd generic deserializable arg (#10448) 2021-05-06 19:32:03 +02:00
Luca Casonato
f208e6a26f
chore: update wgpu and realign to spec (#9760) 2021-05-06 16:48:45 +02:00
Yoshiya Hinosawa
e64cf4eeac
test(compile): show command output to testing log for debugging purpose (#10503) 2021-05-05 17:42:45 +09:00
Satya Rohith
89b61b5d05
fix(cli): give context when failed to load import map (#10478) 2021-05-04 14:27:20 +02:00
Anonymous
688557e226
fix(op_crates/fetch): check fetch() argument length (#10474) 2021-05-03 09:05:42 +02:00
Casper Beyer
40961cda58
fix(test): change inflection depending on number of pending tests (#10466) 2021-05-02 08:30:30 -04:00
Divy Srivastava
bb12c7a57a
fix(test): re-enable "compile_windows_ext" test (#10131)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2021-05-01 23:13:06 +09:00
Andy Hayden
684c357136
Rename crate_ops to extensions (#10431) 2021-04-30 15:51:48 -04:00
Casper Beyer
abaec7a88e
fix(cli/tools/test): print module tests originate from (#10428) 2021-04-30 11:56:47 -04:00
William Perron
a50dab683f
fix(op_crate/fetch): infinite loop on fill headers (#10406)
Fixes a pesky bug in the fetch implementation where if the init part is
specified in `fetch` instead of the `Request` constructor, the
fillHeaders function receives two references to the same object, causing
it to append to the same list being iterated over.
2021-04-29 13:56:59 -04:00
Casper Beyer
c455c28b83
feat(test): run test modules in parallel (#9815)
This commit adds support for running test in parallel.

Entire test runner functionality has been rewritten
from JavaScript to Rust and a set of ops was added to support reporting in Rust.

A new "--jobs" flag was added to "deno test" that allows to configure 
how many threads will be used. When given no value it defaults to 2.
2021-04-28 20:17:04 +02:00
Aaron O'Mullan
0260b488fb
core: introduce extensions (#9800)
Extensions allow declarative extensions to "JsRuntime" (ops, state, JS or middleware).

This allows for:
- `op_crates` to be plug-and-play & self-contained, reducing complexity leaked to consumers
- op middleware (like metrics_op) to be opt-in and for new middleware (unstable, tracing,...)
- `MainWorker` and `WebWorker` to be composable, allowing users to extend workers with their ops whilst benefiting from the other infrastructure (inspector, etc...)

In short extensions improve deno's modularity, reducing complexity and leaky abstractions for embedders and the internal codebase.
2021-04-28 18:41:50 +02:00
Bartek Iwańczuk
b28f9445aa
refactor(core): simplify module loading code (#10385)
General cleanup of module loading code, tried to reduce indentation in various methods
on "JsRuntime" to improve readability.

Added "JsRuntime::handle_scope" helper function, which returns a "v8::HandleScope".
This was done to reduce a code pattern that happens all over the "deno_core".

Additionally if event loop hangs during loading of dynamic modules a list of
currently pending dynamic imports is printed.
2021-04-28 18:28:46 +02:00
Satya Rohith
2bd087ab1b
chore: upgrade dprint plugins (#10397) 2021-04-28 10:08:51 -04:00
Casper Beyer
3a03084580
test(cli): run unit tests using Deno.test (#10330)
Co-authored-by: Luca Casonato <lucacasonato@yahoo.com>
2021-04-27 13:14:01 +02:00
Aaron O'Mullan
83770e898e
fix(console): circular customInspect (#10338) 2021-04-27 11:54:47 +02:00
Bert Belder
299518d935 fix(tls): throw meaningful error when hostname is invalid (#10387)
`InvalidDNSNameError` is thrown when a string is not a valid hostname,
e.g. it contains invalid characters, or starts with a numeric digit. It
does not involve a (failed) DNS lookup.
2021-04-26 23:40:45 +02:00
Ryan Dahl
f7c298e297
Remove denort optimization (#10350)
denort is an optimization to "deno compile" to produce slightly smaller
output. It's a decent idea, but causes a lot of negative side-effects:

- Deno's link time is a source of constant agony both locally and in CI,
  denort doubles link time.
- The release process is a long and arduous undertaking with many manual
  steps. denort necessitates an additional manual zip + upload from M1
  apple computers.
- The "deno compile" interface is complicated with the "--lite" option.
  This is confusing for uses ("why wouldn't you want lite?").

The benefits of this feature do not outweigh the negatives. We must find
a different approach to optimizing "deno compile" output.
2021-04-26 13:28:38 -04:00
Casper Beyer
e4e7d957e8
feat(core): enable wasm threading support (#10116) 2021-04-26 17:54:07 +02:00
Ryan Dahl
9c3da280e0
remove #![deny(warnings)] (#10376)
Prefer RUSTFLAGS="-D warnings" to prevent warnings, but cannot 
enable yet due to #10378.
2021-04-26 10:10:57 -04:00
Casper Beyer
f3751e498f
feat(cli): add test permissions to Deno.test (#10188)
This commits adds adds "permissions" option to the test definitions 
which allows tests to run with different permission sets than 
the process's permission.

The change will only be in effect within the test function, once the 
test has completed the original process permission set is restored.

Test permissions cannot exceed the process's permission.
You can only narrow or drop permissions, failure to acquire a 
permission results in an error being thrown and the test case will fail.
2021-04-25 23:38:59 +02:00
Nayeem Rahman
fb1ccc3d88
refactor(cli): rename Deno.emit() bundle options to "module" and "classic" (#10332) 2021-04-26 06:54:57 +10:00
Jesse Jackson
feb6af7732
fix(op_crates/fetch): Prevent throwing when inspecting a request (#10335)
Fixes: #10334
2021-04-23 20:38:45 +02:00
Aaron O'Mullan
dd156e886b
refactor(core): rename send() to opcall() (#10307)
I think it's a better fit since recv() was killed and opcall <> syscall (send/recv 
was too reminiscent of request/response and custom payloads)
2021-04-23 11:50:45 -04:00
Luca Casonato
0cef6aca86
chore: update dependencies (#10325)
This updates swc_* crates to latest, and various other deps.
2021-04-23 13:37:09 +02:00
Nayeem Rahman
8a416a5ba2
fix(runtime/js/http): cancel body on response failure (#10225) 2021-04-23 12:34:04 +02:00
Ryan Dahl
b837fc300d
fix(#10302): flaky worker test (#10303) 2021-04-21 22:02:11 -04:00
Aaron O'Mullan
8d0e0ead51
fix(fetch): Response inspect regression (#10295) 2021-04-21 23:03:04 +02:00
Satya Rohith
3b78f6c449
fix: do not panic on not found cwd (#10238) 2021-04-21 17:52:00 +02:00
Satya Rohith
15ffdd2624
fix(runtime): include HTTP op in WebWorker (#10207) 2021-04-20 16:26:31 +02:00
Luca Casonato
9e6cd91014
chore: align fetch to spec (#10203)
This commit aligns the `fetch` API and the `Request` / `Response`
classes belonging to it to the spec. This commit enables all the
relevant `fetch` WPT tests. Spec compliance is now at around 90%.

Performance is essentially identical now (within 1% of 1.9.0).
2021-04-20 14:47:22 +02:00
Jean Pierre
2079da0f1c
feat(lsp): Implement textDocument/documentSymbol (#9981)
Co-authored-by: Kitson Kelly <me@kitsonkelly.com>
2021-04-20 11:29:27 +10:00
Jean Pierre
6d404ec54b
feat(lsp): Implement textDocument/semanticTokens/full (#10233)
Co-authored-by: Kitson Kelly <me@kitsonkelly.com>
2021-04-20 11:26:36 +10:00
Kitson Kelly
b6203cb465
revert: Conn type changes in #10012 and #10061 (#10255)
Fixes #10200 (again)

This reverts commit 9c7c9a35c1 and a8057e3e06.
2021-04-20 10:12:33 +10:00
Luca Casonato
fe59e7ae60
fix(rt/http): correct URL in Request (#10256)
This commit fixes the URL returned from `request.url` in the HTTP server
to be fully qualified. This previously existed, but was removed and
accidentially not readded during optimizations of the HTTP ops.

Returning a non fully qualified URL from `Request#url` is not spec
compliant.
2021-04-19 17:07:44 +02:00
Liam Murphy
4786e1d92d
fix(runtime): handle race condition in postMessage where worker has terminated (#10239)
The panic was caused by the lack of an error class mapping for
futures::channel::TrySendError, but it shouldn't have been throwing an error in
the first place - when a worker has terminated, postMessage should just return.
The issue was that the termination message hadn't yet been recieved, so it was
carrying on with trying to send the message. This adds another check on the Rust
side for if the channel is closed, and if it is the worker is treated as
terminated.
2021-04-19 16:57:02 +02:00
Jean Pierre
65a2a04d3b
feat(lsp): implement textDocument/prepareCallHierarchy (#10061) 2021-04-19 15:11:26 +10:00
Luca Casonato
0552eaf569
chore: align Headers to spec (#10199)
This commit aligns `Headers` to spec. It also removes the now unused
03_dom_iterable.js file. We now pass all relevant `Headers` WPT. We do
not implement any sort of header filtering, as we are a server side
runtime.

This is likely not the most efficient implementation of `Headers` yet.
It is however spec compliant. Once all the APIs in the `HTTP` hot loop
are correct we can start optimizing them. It is likely that this commit
reduces bench throughput temporarily.
2021-04-19 01:00:13 +02:00
Ryan Dahl
fe9cee620a
fix(#10182): hang during http server response (#10197) 2021-04-15 18:48:56 -04:00
Luca Casonato
353e79c796
chore: align FormData to spec (#10169)
This PR aligns `FormData` to spec. All WPT tests are passing.
2021-04-14 22:49:16 +02:00
crowlKats
a8057e3e06
feat(cli/dts): stricter typings for Listener & Conn (#10012) 2021-04-13 13:33:17 +02:00
Casper Beyer
ec1fce58d9
fix(core): remove wasm-test-streaming flag (#10158) 2021-04-13 06:20:05 -04:00
Bert Belder
b9f758d3ad upgrade: rusty_v8 0.22.0 (V8 9.1.269.2) (#10152) 2021-04-13 02:54:36 +02:00
Aaron O'Mullan
46b1c653c0
refactor(deno): remove concept of bin & json ops (#10145) 2021-04-12 15:55:05 -04:00
Nayeem Rahman
a20504642d
fix(runtime/js/http): Correctly parse user response headers (#10076) 2021-04-12 10:24:45 -04:00
Casper Beyer
9d53dab4df
feat(runtime): add truncate and truncateSync methods to Deno.File (#10130) 2021-04-12 14:32:58 +02:00
Casper Beyer
da9219341f
feat(runtime): add stat and statSync methods to Deno.File (#10107) 2021-04-12 13:33:05 +02:00
Aaron O'Mullan
bf99039ea9
feat: Add Deno.memoryUsage() (#9986) 2021-04-12 10:47:44 +02:00
Nayeem Rahman
8b49d948f5
fix(runtime/js/timers): Use (0, eval) instead of eval() (#10103) 2021-04-12 01:40:42 +02:00
Liam Murphy
3c645457a4
fix(op_crates/console): console.table value misalignment with varying keys (#10127) 2021-04-11 14:19:50 +02:00
Nayeem Rahman
8aa0d5f96e
feat: set useDefineForClassFields to true (#10119)
Fixes: #9773
2021-04-11 07:56:40 +10:00
Luca Casonato
8d55d8b6be
feat(unstable): ALPN config in listenTls (#10065)
This commit adds the ability for users to configure ALPN protocols when
calling `Deno.listenTls`.
2021-04-10 22:04:44 +02:00
crowlKats
e7b7129b7a
feat(permissions): allow run permission to take values (#9833)
This commit adds allowlist support to `--allow-run` flag.

Additionally `Deno.permissions.query()` allows to query for specific
programs within allowlist.
2021-04-10 00:12:00 +02:00
Bartek Iwańczuk
1c7217e390
chore: upgrade dependencies (#10094)
This commit upgrades:
- swc_ecmascript
- swc_bundler
- deno_doc
- deno_lint
- dprint-plugin-typescript
2021-04-09 23:35:29 +02:00
Nayeem Rahman
c86ee742a2
fix: async op error stacktraces (#10080)
Co-authored-by: Aaron O'Mullan <aaron.omullan@gmail.com>
2021-04-09 11:55:33 -04:00
Ryan Dahl
c6e7a243d5
API change: Deno.startHttp -> Deno.serveHttp (#10087) 2021-04-09 11:54:27 -04:00
Kitson Kelly
d9d4a5d73c
feat(lsp): add registry import auto-complete (#9934) 2021-04-09 11:27:27 +10:00
Bartek Iwańczuk
70af812876
feat: native HTTP bindings (#9935)
Co-authered-by: Luca Casonato <lucacasonato@yahoo.com>
Co-authered-by: Ben Noordhuis <info@bnoordhuis.nl>
Co-authered-by: Ryan Dahl <ry@tinyclouds.org>
2021-04-08 18:34:15 -04:00
Luca Casonato
4e70ff80c2
chore: update deps (#10058)
This commit updates crate dependencies.
2021-04-08 18:46:14 +02:00
Inteon
d050b491b1
fix(core): error handling in examples (#9867) 2021-04-08 18:04:02 +02:00
Satya Rohith
543080de55
fix(runtime/readFile*): close resources on error during read (#10059)
This commit ensures readFile, readFileSync, readTextFile,
and readTextFileSync does not leak resources on error.
2021-04-08 16:36:52 +02:00
Luca Casonato
966ce7de8a
feat: blob URL support (#10045)
This commit adds blob URL support. Blob URLs are stored in a process
global storage, that can be accessed from all workers, and the module
loader. Blob URLs can be created using `URL.createObjectURL` and revoked
using `URL.revokeObjectURL`.

This commit does not add support for `fetch`ing blob URLs. This will be
added in a follow up commit.
2021-04-07 15:22:14 +02:00
Luca Casonato
da60e2afcb
chore: deprecate Deno.Buffer and read/write utils (#9793)
This commit marks the `Deno.Buffer` / `Deno.readAll` /
`Deno.readAllSync` / `Deno.writeAll` / `Deno.writeAllSync` utils as
deprecated, and schedules them for removal in Deno 2.0. These
utilities are implemented in pure JS, so should not be part of the
Deno namespace.

These utilities are now available in std/io/buffer and std/io/util:
https://github.com/denoland/deno_std/pull/808.

This additionallty removes all internal dependance on Deno.Buffer.
2021-04-06 00:05:36 +02:00
Luca Casonato
284e6c3039
chore: update std submodule (#10017) 2021-04-05 15:57:52 +02:00
Nayeem Rahman
1312a57984
fix: Properly await already evaluating dynamic imports (#9984) 2021-04-04 07:26:00 -04:00
Jean Pierre
035f7b0ca0
feat(lsp): implement textDocument/foldingRange (#9900)
Co-authored-by: Kitson Kelly <me@kitsonkelly.com>
2021-04-02 17:21:07 +11:00
Kitson Kelly
ec6317e894
fix(lsp): ensure insert_text is passed back on completions (#9951)
Fixes #9920
2021-04-01 20:18:51 +11:00
Aaron O'Mullan
fec1b2a5a4
refactor: new optimized op-layer using serde_v8 (#9843)
- Improves op performance.
- Handle op-metadata (errors, promise IDs) explicitly in the op-layer vs
  per op-encoding (aka: out-of-payload).
- Remove shared queue & custom "asyncHandlers", all async values are
  returned in batches via js_recv_cb.
- The op-layer should be thought of as simple function calls with little
  indirection or translation besides the conceptually straightforward
  serde_v8 bijections.
- Preserve concepts of json/bin/min as semantic groups of their
  inputs/outputs instead of their op-encoding strategy, preserving these
  groups will also facilitate partial transitions over to v8 Fast API for the
  "min" and "bin" groups
2021-03-31 10:37:38 -04:00
Kitson Kelly
881e1e8164
fix(cli): re-add dom.asynciterable lib (#9888)
Fixes: #9881
2021-03-25 22:09:03 +11:00
Kitson Kelly
5ebb401703
feat(lsp): add import completions (#9821) 2021-03-25 11:13:37 +11:00
Jean Pierre
77cfadf532
feat(lsp): implement textDocument/selectionRange (#9845)
Ref: #8643
2021-03-24 10:33:25 +11:00
Aaron O'Mullan
876f075dde
feat(core): Deno.core.heapStats() (#9659)
This commit implements "Deno.core.heapStats()" function 
that allows to programatically measure isolate heap-usage.
2021-03-23 15:33:06 +01:00
Inteon
1251c89321
refactor: Move bin ops to deno_core and unify logic with json ops (#9457)
This commit moves implementation of bin ops to "deno_core" crates
as well as unifying logic between bin ops and json ops to reuse
as much code as possible (both in Rust and JavaScript).
2021-03-20 17:51:08 +01:00
Andrew Mitchell
277e19f4d2
fix(cli/bundle): display anyhow error chain (#9822) 2021-03-18 20:02:29 -04:00
Aaron O'Mullan
7d12dd1899
fix: fallback to default UA and CA data for Deno.createHttpClient() (#9830) 2021-03-18 23:54:26 +01:00
Luca Casonato
62716422b9
chore(console): distinguish between log levels (#9824)
Change `Console.#printFunc` to pass a log level as the second argument
(0 = debug, 3 = error), instead of a boolean for `isErr`. This does not
change the Deno runtime behaviour at all.
2021-03-18 19:25:25 +01:00
Inteon
20627c9136
refactor: update minimal ops & rename to buffer ops (#9719)
This commit rewrites "dispatch_minimal" into "dispatch_buffer".

It's part of an effort to unify JS interface for ops for both json
and minimal (buffer) ops.

Before this commit "minimal ops" could be either sync or async
depending on the return type from the op, but this commit changes
it to have separate signatures for sync and async ops (just like 
in case of json ops).
2021-03-18 14:10:27 +01:00
crowlKats
0e70d9e59b
refactor: clean up permission handling (#9367) 2021-03-17 17:45:12 -04:00
Kitson Kelly
506b321d47
refactor(lsp): refactor completions and add tests (#9789) 2021-03-16 09:01:41 +11:00
Ryan Dahl
2ff9b01551
Revert "fix(cli/module_graph): Set useDefineForClassFields to true" (#9792)
Backwards incompatible change cannot be made in-between patch releases.

This commit broke std tests https://github.com/denoland/deno_std/runs/2112369372

This reverts commit c4709834b3.
2021-03-15 13:56:31 -04:00
Nayeem Rahman
c4709834b3
fix(cli/module_graph): Set useDefineForClassFields to true (#9774)
Fixes #9773
2021-03-15 09:19:27 +11:00
Casper Beyer
7286eea75c
fix(runtime): do not require deno namespace in workers for crypto (#9784) 2021-03-14 20:01:55 +01:00
Luca Casonato
0770449c93
refactor: move Console to op_crates/console (#9770) 2021-03-12 21:23:59 +01:00
Kitson Kelly
f800dfc3cb
chore: remove unused import on non-windows (#9743) 2021-03-10 15:17:55 +11:00
Kitson Kelly
a020ebde2d
fix(lsp): diagnostics use own thread and debounce (#9572) 2021-03-10 13:41:35 +11:00
Bartek Iwańczuk
8d3baa7777
v1.8.1 2021-03-09 21:55:44 +01:00
Nayeem Rahman
0bc488c85c
fix(runtime/js): add navigator interface objects (#9685) 2021-03-08 13:27:49 +01:00
Casper Beyer
3ec9a9bfe4
fix(coverage): ensure single line functions don't yield false positives (#9717) 2021-03-08 11:51:01 +01:00
Nayeem Rahman
33eea0400d
fix(cli/ast): Pass importsNotUsedAsValues to swc (#9714)
Fixes #9709
2021-03-08 06:40:11 +10:00
Divy Srivastava
74584eef04
fix(cli/compile): do not append .exe depending on target (#9668) 2021-03-07 08:20:01 -05:00
Nayeem Rahman
da5ca4f521
fix(cli/tests): Fix flaky worker test (#9691) 2021-03-05 05:32:17 -05:00
Casper Beyer
04740af787
test(cli): move lint command tests into a module (#9674) 2021-03-04 13:40:38 +01:00
Nayeem Rahman
0f2121355f
fix(runtime/web_worker): Don't block self.onmessage with TLA (#9619)
This commit rewrites implementation of "JsRuntime::mod_evaluate". 

Event loop is no longer polled automatically and users must manually
drive event loop forward after calling "mod_evaluate".

Co-authored-by: Nayeem Rahman <nayeemrmn99@gmail.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2021-03-04 13:19:47 +01:00
Bert Belder
1f47bdd69d
test(op_crates/web): add regression tests for past URL bugs (#9639) (#9639)
Closes: #9383
2021-03-02 19:09:58 +01:00
Bartek Iwańczuk
faf2e80272
chore: upgrade crates (#9632) 2021-03-02 13:39:56 +01:00
Nayeem Rahman
badc88b78a
refactor(op_crates/web): Move URL parsing to Rust (#9276) 2021-03-02 02:30:24 +01:00
Casper Beyer
62f33e3b14
test(cli): reorganize test subcommand testcases and fixtures (#9627) 2021-03-01 13:02:51 +01:00
Kitson Kelly
6dae627749
feat(cli): represent type dependencies in info (#9630)
Fixes #7927
2021-03-01 22:49:58 +11:00
Bartek Iwańczuk
0dc89c0a79
feat: stabilise import maps (#9526)
This commit stabilises import maps by removing requirement
on "--unstable" flag when "--import-map" flag is used.
2021-03-01 12:41:22 +01:00
crowlKats
7cd14f97c9
feat: WebGPU API (#7977)
Co-authored-by: Luca Casonato <lucacasonato@yahoo.com>
2021-03-01 11:31:13 +01:00
Luca Casonato
72425ec4ce
chore: improve internal webidl functions (#9606) 2021-03-01 01:25:31 +01:00
Nayeem Rahman
ebd2047de4
feat(cli/source_map): Use top user frame for error source lines (#9604)
This commit changes formatting of JS errors; by not showing 
source lines for internal code. Where possible, instead using 
the top stack frame associated with user code i.e. the first 
location that is colourful and not a "deno:" URL.
2021-02-26 12:40:05 +01:00
Ryan Dahl
3d87198ba0
Upgrade rusty_v8 (V8 9.0.257.3) (#9605) 2021-02-25 19:22:01 -05:00
Luca Casonato
975705a649
chore(core): optional args for registerErrorClass (#9602) 2021-02-25 20:06:06 +01:00
Liam Murphy
cdae4423c2
feat(cli/doc): use type definitions "deno doc" if available (#8459)
This commit adds support for type definitions in "deno doc";
with this change "deno doc" is able to leverage the same directives
as TS compiler.

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2021-02-25 16:24:05 +01:00
Casper Beyer
687ff2ab14
fix(runtime): do not panic on irregular dir entries (#9579) 2021-02-25 05:16:18 -05:00
Kitson Kelly
d7837c8eb5
feat(cli): update to TypeScript 4.2 (#9341) 2021-02-25 15:16:19 +11:00
Kitson Kelly
097e9c44f4
feat(runtime): stabilise permissions and add event target capabilities (#9573) 2021-02-25 14:33:09 +11:00
Casper Beyer
ae8874b4b2
feat: add "deno coverage" subcommand (#8664)
This commit adds a new subcommand called "coverage" 
which can generate code coverage reports to stdout in 
multiple formats from code coverage profiles collected to disk.

Currently this supports outputting a pretty printed diff and 
the lcov format for interoperability with third-party services and tools.

Code coverage is still collected via other subcommands 
that run and collect code coverage such as 
"deno test --coverage=<directory>" but that command no 
longer prints a pretty printed report at the end of a test 
run with coverage collection enabled.

The restrictions on which files that can be reported on has 
also been relaxed and are fully controllable with the include 
and exclude regular expression flags on the coverage subcommand.

Co-authored-by: Luca Casonato <lucacasonato@yahoo.com>
2021-02-24 15:27:51 +01:00
Yosi Pramajaya
f6a80f34d9
test: Fix --reload in integration_tests (#9345)
This commit removes redundant "--reload" args because "util::deno_cmd"
recreates "DENO_DIR". 

This commit also fixes ta_reload in integration tests to actually test reload.
2021-02-24 15:18:35 +01:00
Casper Beyer
9cc7e32e37
feat: add exit sanitizer to Deno.test (#9529)
This adds an exit sanitizer to ensure that code being tested or 
dependencies of that code can't accidentally call "Deno.exit"
leading to partial test runs and false results.
2021-02-24 13:55:50 +01:00
Inteon
dccf5e0c5c
refactor(core): Allow multiple overflown responses in single poll (#9433)
This commit rewrites "JsRuntime::poll" function to fix a corner case that
might caused "overflown_response" to be overwritten by other overflown response.

The logic has been changed to allow returning multiple overflown response
alongside responses from shared queue.
2021-02-23 13:08:50 +01:00
Kohei Ueno
2e3d72064a
fix: panic caused by Deno.env.set("", "") (#9583) 2021-02-23 04:24:59 -05:00
David DeSimone
8be0c8b43a
fix(tests): fix fetchConnectionError test if port is in use (#9465)
Fixes #9379
2021-02-22 13:26:17 +01:00
Bartek Iwańczuk
05911e5d7f
chore: disable flaky test (#9568) 2021-02-22 11:46:17 +01:00
Satya Rohith
4f391ecec0
chore: upgrade internal dprint plugins (#9566)
Co-authored-by: David Sherret <dsherret@gmail.com>
2021-02-22 00:17:31 +01:00
Luca Casonato
9d70ea2e9f
feat(unstable): per op metrics (#9240) 2021-02-21 19:20:31 +01:00
Satya Rohith
06fcfc5c0a
feat: add --ext flag to deno eval (#9295)
This PR deprecates the "--ts"/"-T" flag of "deno eval" (which will later be removed in 2.0)
and introduces "--ext" which is used by "deno fmt" for content type selection. 
This is to ensure we have a single flag that can be used across subcommands 
to select the language (JS/TS).
2021-02-21 17:58:32 +01:00
DjDeveloper
fe1b512820
fix(op_crates/websocket): default to close code 1005 (#9339)
Currently if WebSocket is closed without code, it will error 
while on Chrome it would close with code 1005 instead.

Co-authored-by: crowlKats <13135287+crowlKats@users.noreply.github.com>
2021-02-21 17:51:46 +01:00
Casper Beyer
eefd522f04
fix(runtime/testing): false positive for timers when an error is thrown (#9553) 2021-02-21 17:21:25 +01:00