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

2471 commits

Author SHA1 Message Date
Aaron O'Mullan
058579da56
refactor(ops): remove variadic buffers (#9944) 2021-04-02 09:47:57 -04:00
Kitson Kelly
adf5761090 v1.8.3 2021-04-02 22:22:08 +11:00
Kitson Kelly
df1d36a759 chore: bump dependent crates for cli (#9964) 2021-04-02 22:22:08 +11: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
David Sherret
6048ce5a34
chore(cli): add "Deno" to the windows file description (#9959) 2021-04-02 10:10:00 +11:00
defectivepixel
2d7fdb0a19
chore(cli): fix futime and futimeSync code examples (#9953) 2021-04-02 08:53:31 +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
Aaron O'Mullan
269ea88e0e
bench: track Date.now() as upper bound reference (#9922) 2021-03-29 01:12:19 +02:00
Aaron O'Mullan
7c7a62a7f8
feat(bench/deno_common): show ns/op (#9915)
It's simply the inverse of the rate (ops/s), but it's often useful to look at time per op
2021-03-27 23:17:06 -04:00
Ryan Dahl
f46e39c5c5
remove macro_use (#9884) 2021-03-26 12:34:25 -04:00
Aaron O'Mullan
6c6f3e87c1
Add bench suite of common Deno functions (#9878) 2021-03-26 09:13:53 -04:00
Luca Casonato
d5e0e8c0c2
fix: include deno.crypto in "deno types" (#9863) 2021-03-26 08:43:58 +01:00
Yusuke Tanaka
385b14463c
refactor(lsp): remove unused code (#9897) 2021-03-26 15:46:55 +11:00
Yusuke Tanaka
e7954413e1
upgrade: Rust 1.51.0 (#9895) 2021-03-25 19:17:37 +01: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
Bartek Iwańczuk
f50ed4e281
v1.8.2 2021-03-21 21:12:09 +01:00
Bartek Iwańczuk
c08284ab9d
chore: release crates (#9847) 2021-03-21 16:10:08 +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
Ryan Dahl
0d26a82ea9
upgrade: tokio 1.4.0 (#9842) 2021-03-20 11:51:27 -04: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
Bert Belder
fb5a2786ec
refactor(lsp): slightly reorganize diagnostics debounce logic (#9796)
This patch doesn't actually fix the bug I was hoping to fix, which is
that `update_diagnostics()` sometimes gets called even when there are
more updates that should be processed first. I did eventually figure out
that this issue is caused by Tokio's cooperative yielding, which
currently can't be disabled.

However overall it makes the debounce code somewhat more readable IMO,
which is why I'm suggesting to land it anyway.
2021-03-18 21:26:41 +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
Casper Beyer
b2a1ad0611
chore: Upgrade rustyline to 8.0.0 (#9781)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2021-03-15 14:08:41 +01: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
Yusuke Tanaka
c8fbf6d38a
chore: upgrade to tokio 1.3.0 (#9778) 2021-03-14 10:03:24 -04:00
Luca Casonato
fbec6e39c7
chore: bump crates (#9769) 2021-03-12 22:29:07 +01:00
Luca Casonato
0770449c93
refactor: move Console to op_crates/console (#9770) 2021-03-12 21:23:59 +01:00
Luca Casonato
e83ff62ccb
chore: split web op crate (#9635)
This commit starts splitting out the deno_web op crate into multiple
smaller crates. This commit splits out WebIDL and URL API, but in the
future I want to split out each spec into its own crate. That means we
will have (in rough order of loading): `webidl`, `dom`, `streams`,
`console`, `encoding`, `url`, `file`, `fetch`, `websocket`, and
`webgpu` crates.
2021-03-12 16:17:18 +01:00
David Sherret
3ab48864fe
fix(fmt): Correctly format hard breaks in markdown (#9742) 2021-03-10 08:17:24 -05:00
Kitson Kelly
88a7fa36aa
fix(lsp): allow on disk files to change (#9746)
Fixes #9348
2021-03-10 21:39:16 +11: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
Bartek Iwańczuk
cdc0b6958d
chore: release crates (#9731) 2021-03-09 20:12:13 +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
hvithrafn
79e2e6a1f4
chore(lsp): update lspower to 0.8.4 (#9663)
Co-authored-by: hvithrafn <hvithrafn@users.noreply.github.com>
2021-03-03 15:32:10 +11:00
Ryan Dahl
f9c8f98968
Pin lspower, because it made semvar incompatible patch release (#9656) 2021-03-02 20:04:18 -05:00
Ryan Dahl
18b894072d
v1.8.0 2021-03-02 18:23:14 -05:00
Ryan Dahl
f1fe6a57ba
Bump crate versions (#9651) 2021-03-02 15:15:43 -05: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
Kitson Kelly
dbdbe7a1cf
fix(lsp): improve exception handling on tsc snapshots (#9628)
Refs #9348
2021-03-01 11:53:20 +11:00
Bartek Iwańczuk
c2a7386a42
feat: Align import map to spec and test using WPT (#9616)
This commit updates implementation of import maps to
align it to current revision of the spec.

Existing tests were removed in favor of using suite from
WPT.
2021-03-01 01:49:08 +01:00
Luca Casonato
ff83df399a
fix: typo in coverage exit_unstable (#9626) 2021-03-01 01:25:43 +01:00
Luca Casonato
72425ec4ce
chore: improve internal webidl functions (#9606) 2021-03-01 01:25:31 +01:00
Divy Srivastava
4b56537ea9
chore: move crypto types to op_crates/crypto (#9609) 2021-02-26 12:06:26 -05:00
Ryan Dahl
07eb009044
Improve 'deno lsp' help text (#9610) 2021-02-26 15:51:25 +01:00
Divy Srivastava
67ca978f97
chore: simplify internal dependencies between crates (#9600) 2021-02-26 12:46:15 +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
Casper Beyer
2ac7798a20
feat(runtime): stabilize Deno.symlink and Deno.symlinkSync (#9226) 2021-02-26 01:13:48 +01:00
Kitson Kelly
e516e4d1d5
chore(cli/runtime): use re-export serde from deno_core (#9599) 2021-02-26 07:18:35 +11:00
Luca Casonato
975705a649
chore(core): optional args for registerErrorClass (#9602) 2021-02-25 20:06:06 +01:00
Casper Beyer
aa47f8186c
feat(runtime): stabilize Deno.link and Deno.linkSync (#9417)
This commit makes "Deno.link" and "Deno.linkSync" stable.

The permission required has been changed to read-write to 
ensure one cannot escape the sandbox.
2021-02-25 18:35:10 +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
d26bef21a5
test(lsp): add benchmarking tests (#9586)
Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
2021-02-25 16:14:17 +11: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
Kitson Kelly
90e4c5dcde
reafactor(lsp): use generics with JSON values (#9587) 2021-02-25 14:15:55 +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
Casper Beyer
af93256d05
fix(cli): capitalize inspect and inspect-brk descriptions (#9567) 2021-02-21 19:09:30 +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
Casper Beyer
b47f9cee8c
fix(repl): filter out symbol candidates (#9555) 2021-02-21 16:58:31 +01:00
Nayeem Rahman
14ec22e880
fix(core/bindings): Add stacks for dynamic import resolution errors (#9562) 2021-02-21 16:22:06 +01:00
Yusuke Tanaka
18b2dbf0d0
fix(dts): update doc of Deno.formatDiagnostics (#9564) 2021-02-21 16:17:27 +01:00
Nayeem Rahman
10fb25db63
fix(core/runtime): Fix dynamic imports for already rejected modules (#9559) 2021-02-20 22:50:13 +01:00
Yusuke Tanaka
91881b7cd3
fix: lint and fmt error if no target files are found (#9527) 2021-02-19 07:18:16 -05:00
Nayeem Rahman
555595e6d0
fix(core): Make dynamic import async errors catchable (#9505)
Fixes #6259
2021-02-19 09:36:02 +11:00
Ryan Dahl
bb30e9291e
refactor: use Mutex for ErrorBuffer (#9539)
RwLock should only be used in circumstatnces where it has some benefit.
Multiple concurrent readers is usually an undesirable design bug.
2021-02-18 15:20:52 -05:00
Satya Rohith
d9b1f96897
feat: add json(c) support to deno fmt (#9292)
This commit adds support for formatting JSON and JSONC 
in "deno fmt".

New values "json" and "jsonc" are added to "--ext" flag for 
standard input processing.
2021-02-18 17:31:32 +01:00
Kitson Kelly
2225e83da2
fix(lsp): handle data URLs properly (#9522)
Fixes #9514

Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
2021-02-18 15:37:05 +11:00
Kitson Kelly
78e34d4912
fix(lsp): document spans use original range (#9525)
Fixes: #9444

Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
2021-02-18 14:15:13 +11:00
Ryan Dahl
c7dabc99ee
Make ModuleSpecifier a type alias, not wrapper struct (#9531) 2021-02-17 13:47:18 -05:00
Bartek Iwańczuk
f6d6b24506
feat: support loading import map from URL (#9519)
This commit adds support for loading import maps from URLs,
both remote and local.

This feature is supported in CLI flag as well as in runtime
compiler API.
2021-02-17 14:32:57 +01:00
Kitson Kelly
879897ada6
feat(cli): support auth tokens for accessing private modules (#9508)
Closes #5239
2021-02-16 13:50:27 +11:00
Yuki Tanaka
ccd6ee5c23
feat(lsp): Implement textDocument/signatureHelp (#9330)
Co-authored-by: Kitson Kelly <me@kitsonkelly.com>
2021-02-16 13:34:09 +11:00
Casper Beyer
3f5265b21e
fix: align btoa to spec (#9053) 2021-02-16 02:10:59 +01:00
Kitson Kelly
7e9028b532
feat(cli): Deno.emit supports bundling as IIFE (#9291)
Closes #9204
2021-02-16 12:02:00 +11:00
Bartek Iwańczuk
8c6d147e6a
chore: Reorganise workers tests (#9493) 2021-02-15 14:48:47 +01:00
Kitson Kelly
64a1da84fe
fix(lsp): handle cached type dependencies properly (#9500) 2021-02-15 20:32:06 +11:00
Nayeem Rahman
5873adeb5e
fix(cli/source_map): Don't use file names from source maps (#9462) 2021-02-14 17:38:41 +11:00
Jared Beller
b50691efed
refactor(core): Strongly typed deserialization of JSON ops (#9423)
This PR makes json_op_sync/async generic to all Deserialize/Serialize types
instead of the loosely-typed serde_json::Value. Since serde_json::Value
implements Deserialize/Serialize, very little existing code needs to be updated,
however as json_op_sync/async are now generic, type inference is broken in some
cases (see cli/build.rs:146). I've found this reduces a good bit of boilerplate,
as seen in the updated deno_core examples.

This change may also reduce serialization and deserialization overhead as serde
has a better idea of what types it is working with. I am currently working on
benchmarks to confirm this and I will update this PR with my findings.
2021-02-13 11:56:56 -05:00
Luca Casonato
af460fc464
fix: webidl utils and align Event to spec (#9470) 2021-02-13 15:58:12 +01:00
Ryan Dahl
d2d7dc8d67
v1.7.4 2021-02-13 08:20:49 -05:00
Bartek Iwańczuk
f67b06939b
v1.7.3 2021-02-12 17:37:45 +01:00
Bartek Iwańczuk
39f3aaaa72
chore: release crates (#9481) 2021-02-12 16:23:39 +01:00
Kitson Kelly
79916226b7
fix(lsp): properly handle static assets (#9476) 2021-02-12 22:49:42 +11:00
Kitson Kelly
54e53cc9ea
chore: Update to Rust 1.50.0 (#9479) 2021-02-12 21:08:36 +11:00
Yosi Pramajaya
146fb360c6
test(cli): improve test of deno cache (#9340) 2021-02-12 14:54:46 +09:00
Kitson Kelly
d6c05b09dd
feat(lsp): add deno cache code actions (#9471) 2021-02-12 15:17:48 +11:00
Bartek Iwańczuk
723c99de8a
chore: upgrade crates (#9474) 2021-02-11 17:05:42 +01:00
Erik Price
a097c4089b
fix(runtime/tls): handle invalid host for connectTls/startTls (#9453) 2021-02-11 12:45:10 +01:00
David DeSimone
61108935f1
fix(console): log function object properties / do not log non-enumerable props by default (#9363) 2021-02-10 20:52:54 +09:00
Kitson Kelly
6752be05cd
fix(lsp): handle type deps properly (#9436)
Fixes #9425
2021-02-10 09:46:12 +11:00
Trivikram Kamat
ffe12aa92d
chore: bump TypeScript to 4.1.4 (#9459) 2021-02-09 23:27:38 +01:00
Nayeem Rahman
900953a65a
fix(op_crates): Don't use Deno.inspect in op crates (#9332)
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2021-02-09 16:31:46 +01:00
Luca Casonato
a195c75033
chore: update dependencies (#9455) 2021-02-09 15:34:34 +01:00
Kitson Kelly
d95666cae0
fix(lsp): handle code lenses for non-documents (#9454) 2021-02-09 20:48:53 +11:00
Kitson Kelly
97d5ef2950
fix(cli): import maps handles data URLs (#9437)
Fixes #9420
2021-02-09 15:05:37 +11:00
Casper Beyer
36e9e53b37
refactor(cli/tools/repl): merge highlighter into helper (#9448) 2021-02-08 17:25:10 +01:00
Kitson Kelly
1f9e9002d5
fix(lsp): prepare diagnostics when the config changes (#9438) 2021-02-08 21:45:46 +11:00
Kitson Kelly
e368c5d0f9
feat(lsp): add implementations code lens (#9441) 2021-02-08 21:45:10 +11:00
Kitson Kelly
09b79463d7 feat(lsp): add asset cache regression test
When we migrated away from all the locks, there was a regression that
was not caught immediately. The tsc::get_asset() would attempt to modify
the snapshot, but the problem was that the snapshot was a .clone() of
the inner language server's assets, which meant that modifications to
that where lost. When we then attempted to do a hover on those assets,
the inner language servers assets didn't have the retrieved asset, and
therefore would throw an error.
2021-02-08 10:47:32 +01:00
Ben Noordhuis
ccbaedb138 fix(lsp): DRY asset cache lookup logic 2021-02-08 10:47:32 +01:00
Ben Noordhuis
e7a7bf8a79 fix(lsp): fix asset cache lookup regression
Commit 2828690fc ("fix(lsp): fix deadlocks, use one big mutex") from
last month introduced a regression in asset cache lookups where results
of lazy caching were lost due to operating on a copy of the asset cache.

This commit fixes that by copying the asset from the copy to the real
cache.
2021-02-08 10:47:32 +01:00
Ben Noordhuis
be10db10fd fix(lsp): remove Sources mutex
The mutex was used to hide the fact that the Sources object mutates
itself when it's queried. Be honest about that and mark everything that
directly or indirectly mutates it as `mut`.

This is a follow-up to commit 2828690fc7
from last month ("fix(lsp): fix deadlocks, use one big mutex (#9271)")
2021-02-08 10:47:32 +01:00
Nayeem Rahman
0cac243a83
fix(cli): check for inline source maps before external ones (#9394)
Fixes #6965
2021-02-08 10:14:05 +11:00
Kitson Kelly
b6353672f8
fix(lsp): support codeAction/resolve (#9405) 2021-02-06 07:10:53 +11:00
Bartek Iwańczuk
ae10219f59
v1.7.2 2021-02-05 19:37:27 +01:00
Bartek Iwańczuk
64f06be0eb
chore: release crates (#9410) 2021-02-05 15:08:18 +01:00
Casper Beyer
c83e261b42
fix(repl): prevent symbol completion panic (#9400) 2021-02-05 12:09:52 +01:00
Kitson Kelly
5b9376908a
fix(cli/lsp): fix using jsx/tsx when not emitting via tsc (#9407)
Closes #9308
Closes #9023
Closes #8993
2021-02-05 22:01:48 +11:00
Kitson Kelly
b77fcbc518
feat(lsp): add TS quick fix code actions (#9396) 2021-02-05 05:53:02 +11:00
Ryan Dahl
644a7ff2d7
fetch optimizations (#9402)
Release deno_fetch 0.20.2
2021-02-04 13:08:41 -05:00
Bartek Iwańczuk
79fa7e0e96
docs: update example for Deno.Process (#9390) 2021-02-04 13:09:00 +01:00
Bartek Iwańczuk
9069632216
chore: upgrade swc (#9374) 2021-02-03 11:54:53 +01:00
Ben Noordhuis
fb358380c0
fix: improve http client builder error message (#9380)
Include the lower-level error message in the generic error message.

No test because I can't actually make it fail by passing it bad PEM.
I checked and `reqwest::Certificate::from_pem()` always returns `Ok()`.

Fixes #9364.
2021-02-03 11:40:43 +01:00
Casper Beyer
6abf126c2a
chore: remove std directory (#9361)
This removes the std folder from the tree.

Various parts of the tests are pretty tightly dependent 
on std (47 direct imports and 75 indirect imports, not 
counting the cli tests that use them as fixtures) so I've 
added std as a submodule for now.
2021-02-02 12:05:46 +01:00
Bartek Iwańczuk
a2b5d44f1a
refactor: Reorganise integration tests (#9282)
This commit reorganises cli/tests/integration_tests.rs.

All integration tests had been moved into integration module,
which allows to run only integration tests by "cargo test integration".

Additionally some tests were further grouped under nested modules
like "inspector", "file_watcher" or "repl".
2021-02-01 19:09:25 +01:00
Yusuke Tanaka
84f8b87f1b
chore: make all tests annotated with #[cfg(test)] (#9347) 2021-02-01 10:55:23 -05:00
Yoshiya Hinosawa
23281be33a
fix(cli): fix handling of non-normalized specifier (#9357) 2021-02-01 17:02:02 +09:00
Kitson Kelly
534531e4dd
feat(lsp): add references code lens (#9316) 2021-02-01 14:30:41 +11:00
Yusuke Tanaka
ef46bc88bd
chore: upgrade tokio to 1.1.1 (#9327) 2021-01-29 21:18:31 -05:00
Casper Beyer
9965fc8cc3
fix(cli/coverage): display mapped instrumentation line counts (#9310) 2021-01-29 14:45:22 -05:00
hvithrafn
013b8fe606
Update lspower dependency (#9179) 2021-01-29 14:34:33 -05:00
Ryan Dahl
11dd6f2013
v1.7.1 2021-01-29 09:53:03 -05:00
Bartek Iwańczuk
4b92eef25e
test: fix lock_write_fetch test (#9318) 2021-01-29 14:23:02 +01:00
Nayeem Rahman
daad575825
fix(cli): Move WorkerOptions::deno types to unstable (#9163) 2021-01-29 08:15:59 -05:00
Nayeem Rahman
f3122442db
fix(op_crates/web): Add customInspect for Location (#9290) 2021-01-29 08:08:22 -05:00
Bert Belder
98878bd812
refactor: IO resource types, fix concurrent read/write and graceful close (#9118)
Fixes: 9032.
2021-01-29 01:35:07 -08:00
Bartek Iwańczuk
c8a5e3c1e4
chore: reenable watch tests (#9306) 2021-01-29 10:34:00 +01:00
Yoshiya Hinosawa
fc162162a1
fix(cli): fix panic in Deno.emit (#9302) 2021-01-29 10:33:58 +09:00
Luca Casonato
6ecc86cf2a
chore: add jsdoc to 26_fetch.js and enable some fetch tests (#9305) 2021-01-28 21:37:21 +01:00
Kitson Kelly
7bda0f567e
fix(cli): add lib dom.asynciterable (#9288)
Fixes #9218
2021-01-29 06:41:30 +11:00
Casper Beyer
5cf194380b
fix(coverage): use source maps when printing pretty reports (#9278)
This commits makes use of source maps and the original source 
when printing lacking line coverage in the pretty printer.

Only the executable lines are checked as before (as non-executable 
lines will always be ignored anyways). The lines then mapped to the 
appropriate source line when a source map is present.
2021-01-28 15:11:38 +01:00
William Perron
f858b653be
bench: remove custom error types (#9301)
Fixes #9253
2021-01-27 22:50:14 -05:00
Kitson Kelly
894ff6bb58
fix(cli): early abort before type checking on missing modules (#9285)
Fixes #9275
2021-01-28 06:54:20 +11:00
Luca Casonato
2638aa03a5
tests: new typescript WPT runner (#9269) 2021-01-27 15:06:18 +01:00
Kitson Kelly
ecfda65eff
fix(cli): correctly determine emit state with redirects (#9287)
Fixes #9129
2021-01-27 22:25:33 +11:00
Ikko Ashimine
798027a596
chore: fix typo in lint.rs (#9281) 2021-01-27 14:41:48 +11:00
Kitson Kelly
e7323002d9
feat(lsp): add performance measurements (#9209) 2021-01-27 11:32:49 +11:00
Kitson Kelly
ada43cc56a
fix(lsp): handle mbc properly when formatting (#9273) 2021-01-27 07:50:13 +11:00
akfm
43f4a23f89
fix(cli): fmt command help message (#9280) 2021-01-26 21:01:10 +01:00
Luca Casonato
40fc5f55ea
chore: update crates (#9251)
Updates SWC, dprint, deno_lint, deno_doc, serde, and Tokio (to 1.1.0).

Co-authored-by: Kitson Kelly <me@kitsonkelly.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2021-01-26 17:00:40 +01:00
Kitson Kelly
f9949a3170
fix(op_crates/fetch): fix ReadableStream.pipeThrough() (#9265)
Fixes #9252
2021-01-26 21:56:29 +11:00
Kitson Kelly
8b6893438a
fix(lsp): complete list of unused diagnostics (#9274) 2021-01-26 21:55:59 +11:00
Ben Noordhuis
2828690fc7
fix(lsp): fix deadlocks, use one big mutex (#9271)
The LSP code had numerous places where competing threads could take out
out locks in different orders, making it very prone to deadlocks.
This commit sidesteps the entire issue by switching to a single lock.

The above is a little white lie: the Sources struct still uses a mutex
internally to avoid having to boil the ocean (because being honest about
what it does involves changing all its methods to `&mut self` but that
ripples out extensively...) I'll save that one for another day.
2021-01-26 10:55:04 +01:00
Kitson Kelly
2b4e0be43c
fix(lsp): reduce deadlocks with in memory documents (#9259) 2021-01-26 10:47:12 +11:00
Luca Casonato
e0eb111e3e
Revert "tests: enable wpt for url (#9046)" (#9264)
This reverts commit 66e99d349b.
2021-01-25 16:02:03 +01:00
akfm
cf688cb408
docs(cli): fix return type in comment (#9248) 2021-01-25 15:14:25 +09:00
Luca Casonato
66e99d349b
tests: enable wpt for url (#9046) 2021-01-24 22:29:36 +01:00
ali ahmed
feff6361b1
feat(op_crates/web): adding gb18030 and GBK encodings (#9242) 2021-01-24 20:08:01 +01:00
Anonymous
ad60e750d7
fix(runtime/js): use DOMException in Performance#measure (#9142) 2021-01-24 16:05:18 +01:00
akfm
2ca637962f
docs(cli): fix typo stanalone -> standalone (#9246) 2021-01-24 14:25:18 +01:00
Nayeem Rahman
452df2f23a
fix(cli/flags): don't panic on invalid location scheme (#9202) 2021-01-24 02:18:19 +01:00
Liam Murphy
a61389a55e
fix(compile): fix panic when cross-compiling between windows and unix (#9203) 2021-01-24 02:40:13 +09:00
Kitson Kelly
1a9209d1e3
fix(lsp): handle mbc documents properly (#9151)
Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
2021-01-22 21:03:16 +11:00
Nayeem Rahman
bdb1ee6480
fix(core): Handle prepareStackTrace() throws (#9211)
Fixes #9206
2021-01-21 20:48:04 +11:00
Yoshiya Hinosawa
18ac7d40c8
fix(runtime): fix recursive dispatches of unload event (#9207) 2021-01-21 16:44:48 +09:00
Casper Beyer
413f79a494
fix(coverage): ignore comments (#8639)
This commit fixes coverage collection by ignoring
comments when tallying up line counts.
2021-01-20 15:51:36 +01:00
Yoshiya Hinosawa
0a159bea15
fix(ops/net): fix panic in op_dns_resolve (#9187) 2021-01-20 15:47:17 +01:00
Ryan Dahl
bfaa121cd2
v1.7.0 2021-01-19 23:17:20 -05:00
Bert Belder
b0132e8f90
fix(cli): actually stabilize Deno.shutdown() (#9181) 2021-01-19 20:11:08 -08:00
Kitson Kelly
02c6a88d8a
docs: improve manual around typescript (#8139)
Fixes #9054
2021-01-20 09:28:58 +11:00
ali ahmed
973c33c899
feat(web): add utf-16 and big5 to TextEncoder/TextDecoder (#8108) 2021-01-19 21:58:57 +01:00
Luca Casonato
0e8e6d7251
chore: add compile aarch64-apple-darwin target (#9174) 2021-01-19 20:03:50 +01:00
Satya Rohith
16036a8a51 feat: add markdown support to deno fmt (#8887)
This commit adds support for formatting markdown files with "deno fmt".

Additionally "--ext={js|jsx|ts|tsx|md}" flag was added to "deno fmt"
that allows to specify file type when providing contents over stdio.
2021-01-19 18:39:35 +01:00
Luca Casonato
4c223d0521
fix: panic during deno compile with no args (#9167) 2021-01-19 16:19:36 +01:00
Yusuke Tanaka
0ef8c915c0
feat(unstable): add Deno.resolveDns API (#8790) 2021-01-19 09:39:04 -05:00
Luca Casonato
cf3202644d
fix: full commit hash in canary compile download (#9166) 2021-01-19 13:53:23 +01:00
Freddy Fallon
867ce78fb6
fix(installer): pass cached-only to executable_args (#9169) 2021-01-19 13:46:08 +01:00
Liam Murphy
3505823e20
fix(cli/install): escape % symbols in windows batch files (#9133)
Fixes #9096.
2021-01-18 19:34:37 -08:00
Bartek Iwańczuk
9ff468df73
feat: Standalone lite binaries and cross compilation (#9141)
This commit adds --target and --lite flags to deno compile subcommand.

--target allows to cross-compile binary to different target architectures by
fetching appropriate binary from remote server on first run. All downloaded
binaries are stored in "$DENO_DIR/dl".

--lite allows to use lite version of the runtime (ie. the one that doesn't contain
built-in tooling like formatter or linter).
2021-01-19 03:40:22 +01:00
Nayeem Rahman
b12afdb89a
feat: Add WorkerOptions interface to type declarations (#9147) 2021-01-19 03:26:39 +01:00
Casper Beyer
f43855cead
fix(cli): print a newline after help and version (#9158) 2021-01-19 01:56:24 +01:00
Luca Casonato
7a30d1a3d8
fix: redirect in --location relative fetch (#9150) 2021-01-18 13:59:29 +01:00
William Perron
18150b3a78
bench: fix off-by-one error in thread_count (#9145) 2021-01-18 05:00:51 -05:00
Kitson Kelly
2077864a8d
fix(op_crate/fetch): add back ReadableStream.getIterator and deprecate (#9146) 2021-01-18 10:40:39 +11:00
Nayeem Rahman
81d73f2987
fix(cli): Check permissions for Deno.emit() (#9139) 2021-01-18 08:58:23 +11:00
William Perron
2b5b93158c
benchmark: cleanup serde_json values being passed around (#9115) 2021-01-17 11:40:29 -05:00
Vishal Pratap Singh
271fbe39e3
tests(wpt): enable working wasm tests (#9072) 2021-01-17 16:46:33 +01:00
Nayeem Rahman
7db0605d45
fix(op_crates/web): Use WorkerLocation for location in workers (#9084) 2021-01-17 16:28:54 +01:00
Bartek Iwańczuk
f4dbb267c6
fix: incremental build for deno declaration files (#9138) 2021-01-17 15:12:00 +01:00
Bartek Iwańczuk
b26dcbc69d
chore: Enforce ban-untagged-todo lint rule (#9135) 2021-01-17 00:32:59 +01:00
linbingquan
fc45a19801
docs(cli): correct example (#9136) 2021-01-17 10:31:29 +11:00
Bartek Iwańczuk
69fb2b31b3
upgrade: dlint in third_party/ (#9134) 2021-01-16 16:09:11 +01:00
Hirochika Matsumoto
4b2df87c54
refactor(lsp): don't duplicate fields present in DocumentSpan (#9131) 2021-01-16 13:00:42 +01:00
Bartek Iwańczuk
a3007de950
upgrade: deno_lint to 0.2.16 (#9127) 2021-01-15 19:20:01 +01:00
Kitson Kelly
b8303c7812
refactor(op_crate/fetch): align streams to spec (#9103)
Fixes #8814
2021-01-15 08:57:19 +11:00
Steven Guerrero
2d1208556a
fix: don't swallow customInspect exceptions (#9095) 2021-01-14 14:18:51 -05:00
Bert Belder
979d71c883 refactor: make Process#kill() throw sensible errors on Windows (#9111)
Previously, calling `Process#kill()` after the process had exited would
sometimes throw a `TypeError` on Windows. After this patch, it will
throw `NotFound` instead, just like other platforms.

This patch also fixes flakiness of the `runKillAfterStatus` test on
Windows.
2021-01-14 10:26:59 -08:00
Yoshiya Hinosawa
c75f92c4e2
fix: align DOMException API to the spec and add web platform testing of it. (#9106)
* fix: align DOMException API to the spec

* test: fix test case 070_location

* test(DOMException): disable "does not inherit from Error: class-side"
test of WPT

* test: remove test cases in deno codebase

* docs: add note about skipped test
2021-01-14 22:08:49 +09:00
Bert Belder
78c27e0923
Merge pull request #9107
Bump crate versions and publish crates.
2021-01-13 11:44:31 -08:00
Ryan Dahl
8fc29f224d release crates 2021-01-13 14:00:13 -05:00
Bert Belder
060bfe7df8
Fix race condition in file watcher (#9105) 2021-01-13 10:55:44 -08:00
Bert Belder
ca07bab594
Remove unnecessary boxing of tokio::time::Sleep (#9105) 2021-01-13 10:55:28 -08:00
Luca Casonato
18b3150401
build: disable cafile_* tests and use slow runners (#9089) 2021-01-13 16:48:33 +01:00
Luca Casonato
1728b3ba19
tests: disable logging of 'ok' web platform tests (#9087) 2021-01-12 17:14:17 -08:00
Bartek Iwańczuk
8142496c57
feat: stabilize Deno.shutdown() and Conn#closeWrite()
Closes: #9099
2021-01-12 16:17:31 -08:00
Hirochika Matsumoto
8d5af6ca52
feat(lsp): Add textDocument/implementation (#9071)
Ref #8643
2021-01-13 08:53:27 +11:00
Yacine Hmito
46a072c792
tests: enable .worker.js tests (#9065) 2021-01-12 14:02:13 +01:00
Bert Belder
de0ae3a12c
fix(installer): remove redundant clone (#9098) 2021-01-12 13:55:09 +01:00
Yoshiya Hinosawa
fd56fa89f3
fix(cli): dispatch unload on exit (#9088) 2021-01-12 05:32:58 -05:00
Yusuke Tanaka
5c6ab75de1
fix(watcher): keep working even when imported file has invalid syntax (#9091) 2021-01-11 23:53:58 -08:00
Bartek Iwańczuk
275a5c65a2
upgrade: tokio 1.0 (#8779)
Co-authored-by: Bert Belder <bertbelder@gmail.com>
2021-01-11 23:50:02 -08:00
Yusuke Tanaka
d8fd71afdf
chore: update copyright to 2021 (#9092) 2021-01-11 18:13:41 +01:00
Bartek Iwańczuk
d676b6c63a
upgrade: swc_bundler 0.19.2 (#9085) 2021-01-11 15:32:34 +01:00
gorogoroumaru
b0821fe9ce
fix(op_crate/web): fix atob to throw spec aligned DOMException (#8798) 2021-01-11 09:15:32 +11:00
Luca Casonato
1a6ce29f3d
feat(fetch): req streaming + 0-copy resp streaming (#9036)
* feat(fetch): req streaming + 0-copy resp streaming

* lint

* lint

* fix test

* rm test.js

* explicitly use CancelHandle::default()

* Apply review suggestions

Co-authored-by: Ben Noordhuis <info@bnoordhuis.nl>

* fix test

* Merge remote-tracking branch 'origin/master' into fetch_real_streaming

* fix test

* retrigger ci

Co-authored-by: Ben Noordhuis <info@bnoordhuis.nl>
2021-01-10 20:54:29 +01:00
Tarik Eshaq
9801858cb0
tests(wpt/console): Enables web platform tests for console (#9013) 2021-01-10 12:49:45 -05:00
Yacine Hmito
f7e09c6a55
Test crypto.getRandomValues() with wpt (#9016) 2021-01-10 11:27:15 -05:00
Ryan Dahl
ab5ecabe22
Add cargo_deps to benchmarks (#9075) 2021-01-10 08:13:38 -05:00
Luca Casonato
4361895476
fix: don't error on version and help flag (#9064) 2021-01-09 13:08:03 +01:00
Casper Beyer
6d7da6309e
tests: enable WPT for timers (#9047) 2021-01-09 07:32:04 +01:00
Yacine Hmito
9637209765
fix(web): implement DOMException#code (#9015)
Co-authored-by: Luca Casonato <lucacasonato@yahoo.com>
2021-01-09 07:27:46 +01:00
Bert Belder
f3ead9c6a7
refactor: Print cause chain when downcasting AnyError fails (#9059) 2021-01-09 01:57:37 +01:00
yonatan ben avraham
5f015eac9c
fix: Worker hangs when posting "undefined" as message (#8920)
This commit fixes hang in web workers occuring when sending
"undefined" as message value. It is a temporary band-aid
until proper structured close is implemented.

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2021-01-08 15:44:24 +01:00
Luca Casonato
a44349dfdf
feat: denort binary (#9041)
This commit adds new binary target called "denort".

It is a "lite" version of "deno" binary that can only execute
code embedded inside the binary itself.

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2021-01-08 03:08:51 +01:00
Nayeem Rahman
e61e81eb57
feat: add --location=<href> and globalThis.location (#7369) 2021-01-07 19:06:08 +01:00
Anonymous
b40d5e5e0b
ignore "use asm" (#9019)
Preventing V8 from logging erroneous line numbers. Use wasm.
2021-01-07 10:50:57 -05:00
Casper Beyer
9b3338fa2f
fix(coverage): report partial lines as uncovered (#9033) 2021-01-07 12:45:42 +01:00
Casper Beyer
f8df9938c5
fix(coverage): do not store source inline in raw reports (#9025)
When we were doing single process in-memory reports getting the source
from the runtime was practical, but now that we're writing to disk this
conflicts with the format tools taking raw v8 coverage dumps expect.
2021-01-07 05:53:57 -05:00
Nayeem Rahman
b5f1d257a3
fix: Use "none" instead of false to sandbox Workers (#9034) 2021-01-07 05:52:30 -05:00
Ryan Dahl
cb658f5ce5
Remove emoji from welcome script so it looks better on windows (#9031) 2021-01-07 05:51:15 -05:00
Steven Guerrero
adc2f08c17
feat: Add configurable permissions for Workers (#8215)
This commit adds new option to "Worker" Web API that allows to 
configure permissions.

New "Worker.deno.permissions" option can be used to define limited
permissions to the worker thread by either:
- inherit set of parent thread permissions
- use limited subset of parent thread permissions
- revoke all permissions (full sandbox)

In order to achieve this functionality "CliModuleLoader"
was modified to accept "initial permissions", which are used
for top module loading (ie. uses parent thread permission set
to load top level module of a worker).
2021-01-06 21:31:16 +01:00
Luca Casonato
2e18fcebcc
refactor: move WebSocket API to an op_crate (#9026) 2021-01-06 16:57:28 +01:00
Anonymous
3761d054d0
fix: stronger input checking for setTimeout; add function overload (#8957) 2021-01-06 08:53:30 -05:00
Kitson Kelly
54240c22af
feat(cli): support data urls (#8866)
Closes: #5059

Co-authored-by: Valentin Anger <syrupthinker@gryphno.de>
2021-01-06 13:22:38 +11:00
Luca Casonato
60c9c85758
fix: align performance API to spec using WPT (#9012) 2021-01-06 02:56:40 +01:00
Bartek Iwańczuk
bb88418221
refactor(cli): remove 'js' module, simplify compiler snapshot (#9020)
This commit removes "js" module from "cli".

It contained stuff related to TypeScript compiler (snapshot,
declaration files) and thus it was moved to "tsc" module.
2021-01-06 02:38:23 +01:00
Luca Casonato
39bbbbce70
fix: use inline source maps when present in js (#8995) 2021-01-06 00:10:36 +01:00
Bartek Iwańczuk
8d1ee3bfaf
upgrade: deno_doc, deno_lint, dprint, swc_ecmascript, swc_bundler (#9003) 2021-01-05 22:51:54 +01:00
Luca Casonato
7704839039
fix: align AbortSignal to spec using WPT (#9007) 2021-01-05 22:43:25 +01:00
Ryan Dahl
096e090576
Add rlib size benchmarks (#9005) 2021-01-05 16:28:51 -05:00
Bartek Iwańczuk
46c0cab763
refactor(core): simplify Deno.core initialisation, remove stale TODO (#8847)
This commit rewrites initialisation of the "shared queue" and
in effect prevents from double execution of "core/core.js" and
"core/error.js".

Previously both of these files were executed every time a "JsRuntime"
was created. That lead to a situation where one copy of each script
was included in the snapshot and then another copy would be
executed after loading the snapshot.

Effectively "JsRuntime::shared_init" was removed; instead execution
of those scripts and actual initialisation of shared queue
was split into two helper functions: "JsRuntime::js_init" and
"JsRuntime::share_queue_init".

Additionally stale TODO comments were removed.
2021-01-05 22:10:50 +01:00
Luca Casonato
0d41e21b0e
fix: align encoding APIs to spec using WPT (#9004) 2021-01-05 19:50:40 +01:00
Luca Casonato
a3099798c8
tests: add web platform test runner (#8990)
Co-authored-by: Kitson Kelly <me@kitsonkelly.com>
2021-01-05 12:07:27 +01:00
Nayeem Rahman
cbc2108525
feat(cli/standalone): support runtime flags for deno compile (#8738) 2021-01-05 00:15:52 +01:00
Valentin Anger
444eca80a9
fix(lsp): Respect client capabilities for config and dynamic registration (#8865) 2021-01-05 08:52:20 +11:00
Sylvain Cau
b478b06f9d
feat(installer): Add support for MSYS on Windows (#8932) 2021-01-04 08:52:43 -08:00
Casper Beyer
4ca77ad84c
fix(coverage): merge duplicate reports (#8942)
Merging multiple runs isn't quite right because we 
rely on a 0 count to signal that a block hasn't been called.

Other tools like c8 expect this to be true as-well so we 
need to do our best to merge coverage files rather 
than duplicating them.
2021-01-04 17:01:21 +01:00
Mo
3e5a3daf59
BREAKING(unstable): remove CreateHttpClientOptions.caFile (#8928) 2021-01-04 16:55:20 +01:00
Satya Rohith
1d4f8298a7
docs: meta updates to cli/tests/unit/README.md (#8969) 2021-01-04 15:55:57 +01:00
Ben Noordhuis
20babd9bfa
fix(inspector): kill child process after test (#8986)
The child process kept running and printing "hello" to stdout.

This commit also removes the dependency on reqwest and instead
switches to the re-export from the fetch crate.

Brings back commit 1a2e7741c3.
2021-01-04 15:52:22 +01:00
Bartek Iwańczuk
f4246ee1fc
chore: disable flaky test on Windows (#8987) 2021-01-04 14:27:29 +01:00
Luca Casonato
379eedc05c
Revert "fix(inspector): add back list endpoint (#8894)" (#8977)
This reverts commit 1a2e7741c3.
2021-01-04 12:19:23 +01:00
Maayan Hanin
1a6969bebb
fix: panic on invalid file:// module specifier (#8964) 2021-01-04 04:33:20 -05:00
Liam Perlaki
1a2e7741c3
fix(inspector): add back list endpoint (#8894)
This commit adds back "/json/list" endpoint to
inspector server which was erroneously removed
during server rewrite.
 
Co-authored-by: Ben Noordhuis <info@bnoordhuis.nl>
2021-01-03 21:31:52 +01:00
Bartek Iwańczuk
41a4a34aee
upgrade: Rust 1.49.0 (#8955) 2021-01-02 13:52:42 +01:00
Kitson Kelly
012f99bd9a
refactor(cli): runtime compiler APIs consolidated to Deno.emit() (#8799)
Closes: #4752
2021-01-01 08:43:54 +11:00
Kitson Kelly
587155f86d
feat(lsp): support specifying a tsconfig file (#8926) 2020-12-31 14:33:44 +11:00
Rich Trott
e568ddf996
fix(op_crates/fetch): correct regexp for fetch header (#8927)
Fix bug in regular expression and make the regular expression more
strict.

In a string passed to new RegExp(), '[\t\s]' is identical to '[ts]' and
not `/[\t\s]/`. For that, the backslash needs to be escaped in the
string. Futhermore, `\t` is the tab character and is included in the
special regexp value `\s` so is unnecessary.

That would reduce the RegExp to new RegExp(`^${value}\\s*;?`) but
there's no point in matching 0 or more space characters followed by 0 or
one semi-colons as that will match no matter what follows `value`.

To make it more strict, require one of space, semicolon, or
end-of-string after value.
2020-12-30 23:46:08 +01:00
Nayeem Rahman
22e0ee92a6
BREAKING(unstable): Use hosts for net allowlists (#8845)
Allowlist checking already uses hosts but for some reason 
requests, revokes and the runtime permissions API use URLs.

- BREAKING(lib.deno.unstable.d.ts): Change 
NetPermissionDescriptor::url to NetPermissionDescriptor::host

- fix(runtime/permissions): Don't add whole URLs to the 
allowlist on request

- fix(runtime/permissions): Harden strength semantics:
({ name: "net", host: "127.0.0.1" } is stronger than 
{ name: "net", host: "127.0.0.1:8000" }) for blocklisting

- refactor(runtime/permissions): Use tuples for hosts, make 
the host optional in Permissions::{query_net, request_net, revoke_net}()
2020-12-30 23:35:28 +01:00
Rich Trott
af222f7a7f
chore(cli/tests): fix typo in test failure message (#8935) 2020-12-30 11:00:55 -05:00
Bartek Iwańczuk
b07a0b640d
v1.6.3 2020-12-30 16:13:42 +01:00
Bartek Iwańczuk
4997f426c3
chore: release crates (#8931) 2020-12-30 15:29:17 +01:00
Kitson Kelly
b1230a85e8
fix(cli): info does not panic on missing modules (#8924)
Fixes #8918
2020-12-30 22:19:51 +11:00
Kitson Kelly
8011eced14
feat(lsp): add cache command (#8911) 2020-12-30 15:17:17 +11:00
Kitson Kelly
e8a81724bb
fix(lsp): handle ts debug errors better (#8914)
Fixes #8864
2020-12-30 12:46:58 +11:00
hrsh7th
57b0562957
feat(lsp): Implement textDocument/rename (#8910) 2020-12-30 11:58:20 +11:00
Yusuke Tanaka
d5f3a749eb
refactor(cli/flags): change allow_read/write/net types from bool to Option<Vec<T>> (#8896)
This PR refactors "cli/flags.rs" and "runtime/permissions.rs" so 
that "allow_read", "allow_write" and "allow_net" themselves
have allowlists, instead of storing them in additional fields.
2020-12-29 19:34:35 +01:00
Deepanshu Utkarsh
115de4c81a
fix(core): Fix incorrect index in Promise.all error reporting (#8913) 2020-12-29 15:24:19 +01:00
Bartek Iwańczuk
24844a0052
upgrade: dprint, swc_bundler, swc_common, swc_ecmascript (#8901) 2020-12-29 00:22:36 +01:00
Waldir Pimenta
b778f8bbff
docs(introduction): Improve wording and capitalization (#8848) 2020-12-29 10:05:29 +11:00
Casper Beyer
091059450e
feat(unstable): collect coverage from the run command (#8893)
This adds implicit coverage collection to the run command 
when a coverage collection directory is set (via an environment 
variable).
2020-12-28 16:51:26 +01:00
Luca Casonato
9419c06ab5
chore: move ProgressEvent type to deno.web lib (#8878) 2020-12-26 18:15:30 +01:00
Casper Beyer
e8587c86bf
test(cli): ensure await Promise.all does not race (#8868) 2020-12-26 08:29:46 -05:00
Yosi Pramajaya
c1fdb30394
fix: fetch bad URL will not panic (#8884) 2020-12-26 08:06:00 -05:00
Yosi Pramajaya
b15539587e
refactor(test_util): replace "warp" with "hyper" (#8846)
This commit rewrites "test_server" to use "hyper" 
instead of "warp" in an effort to reduce number of
dependencies.
2020-12-24 14:11:32 +01:00
Kitson Kelly
a4d557126e
fix(lsp): provide diagnostics for unresolved modules (#8872) 2020-12-24 21:53:03 +11:00
Bartek Iwańczuk
d199e45ad5
v1.6.2 2020-12-22 17:00:35 +01:00
Bartek Iwańczuk
6ce310fa27
chore: release crates (#8854) 2020-12-22 14:50:13 +01:00
Luca Casonato
ddda669a02
fix: implement ReadableStream fetch body handling (#8855) 2020-12-22 14:14:23 +01:00
Kitson Kelly
097c3379ba
feat(lsp): support the unstable setting (#8851) 2020-12-22 21:21:18 +11:00
Kitson Kelly
b091c6c8c9
fix(lsp): respect enable flag for requests (#8850) 2020-12-22 16:42:32 +11:00
Bartek Iwańczuk
1e144ec022
upgrade: deno_doc, deno_lint, dprint, swc (#8849) 2020-12-22 00:57:03 +01:00
Liam Murphy
4033b39036
refactor: rewrite chown_test.ts not to depend on python (#8843)
This commit rewrites "chown_test.ts" to use the GNU "id" command 
instead of python. This won't work on Windows, but these tests aren't
currently run on Windows anyway.
2020-12-21 16:30:59 +01:00
Luca Casonato
bd85d0ed42
refactor: rewrite lsp to be async (#8727)
Co-authored-by: Luca Casonato <lucacasonato@yahoo.com>
2020-12-21 08:44:26 -05:00
Casper Beyer
3078fcf55a
feat(unstable): record raw coverage into a directory (#8642) 2020-12-21 14:04:25 +01:00
Liam Murphy
d5ee168468
refactor: rewrite process_test.ts to use deno instead of python (#8841)
Rewrites all the subprocess python scripts to be Deno scripts.
2020-12-21 13:13:09 +01:00
Bartek Iwańczuk
3eec73ff90
Revert "fix: TLA in web worker (#8809)" (#8839)
This reverts commit e924bbdf36.
2020-12-20 15:14:19 +01:00
Bartek Iwańczuk
e924bbdf36
fix: TLA in web worker (#8809)
Implementors of `deno_core::JsRuntime` might want to do additional actions
during each turn of event loop, eg. `deno_runtime::Worker` polls inspector,
`deno_runtime::WebWorker` receives/dispatches messages from/to worker host.
Previously `JsRuntime::mod_evaluate` was implemented in such fashion that it 
only polled `JsRuntime`'s event loop. This behavior turned out to be wrong 
in the example of `WebWorker` which couldn't receive/dispatch messages because
its implementation of event loop was never called. 

This commit rewrites "mod_evaluate" to return a handle to receiver that resolves
when module's promise resolves. It is now implementors responsibility to poll
event loop after calling `mod_evaluate`.
2020-12-20 00:34:22 +01:00
Bartek Iwańczuk
660f75e066
upgrade: swc_ecmascript 0.15.1 (#8836) 2020-12-20 00:30:53 +01:00
yonatan ben avraham
afbd19ed9b
feat(unstable): support in memory certificate data for Deno.createHttpClient (#8739) 2020-12-19 23:13:48 +01:00
Bartek Iwańczuk
4ab1aa8877
upgrade: rustyline 7.1.0 (#8829) 2020-12-19 16:20:36 +01:00
Luca Casonato
b9165e9482
fix: atomically write files to $DENO_DIR (#8822) 2020-12-18 19:30:49 +01:00
Nayeem Rahman
ffb5f7a4e1
refactor: Rename runtime/rt to runtime/js (#8806) 2020-12-17 17:37:57 +01:00
Casper Beyer
55dc467b41
test(cli): ensure await all on stdout does not deadlock (#8802) 2020-12-17 15:01:47 +01:00
Trivikram Kamat
63e0ab99a1
upgrade TypeScript to 4.1.3 (#8785) 2020-12-16 11:46:32 -05:00
Bartek Iwańczuk
6984b63f2f
refactor: rewrite ops to use ResourceTable2 (#8512)
This commit migrates all ops to use new resource table
and "AsyncRefCell".

Old implementation of resource table was completely 
removed and all code referencing it was updated to use
new system.
2020-12-16 17:14:12 +01:00
Bartek Iwańczuk
9fe26f8ca1
refactor: remove dead code (#8781) 2020-12-15 21:45:29 +01:00
Kitson Kelly
892d6cc997
refactor(lsp): optimise static assets (#8771)
Fixes #8158
2020-12-16 06:34:39 +11:00
Kitson Kelly
63a821b78b
fix(cli): make dynamic import errors catchable (#8750)
Fixes #6259
2020-12-15 16:52:55 +11:00
Bartek Iwańczuk
b6d5ae1ecd
v1.6.1 2020-12-14 21:25:05 +01:00
Bartek Iwańczuk
025c0a1d37
chore: release crates (#8765) 2020-12-14 19:47:28 +01:00
Bartek Iwańczuk
a19fea918f
Revert "build: Factor out common code into core/build_util.rs (#8756)" (#8763)
This reverts commit 502c77aad9.
2020-12-14 18:42:40 +01:00
Casper Beyer
ce6b738ac0
fix(repl): recover from invalid input (#8759) 2020-12-14 11:37:08 -05:00
Bartek Iwańczuk
8f8749095c
chore: release crates (#8760) 2020-12-14 17:11:17 +01:00
Bartek Iwańczuk
3476d5434f
chore: release deno_runtime 0.2.0 (#8758) 2020-12-14 15:47:20 +01:00
Ryan Dahl
a38b6b8acc
fix: docs.rs detection (#8755) 2020-12-14 15:15:16 +01:00
Ryan Dahl
502c77aad9
build: Factor out common code into core/build_util.rs (#8756) 2020-12-14 14:28:56 +01:00
crowlKats
b2bda57073
fix(cli): show canary string in long version (#8675) 2020-12-14 13:55:07 +01:00
Bartek Iwańczuk
389f492551
chore: release crates (#8744) 2020-12-13 22:34:54 +01:00
Bartek Iwańczuk
2e74f164b6
refactor: deno_runtime crate (#8640)
This commit moves Deno JS runtime, ops, permissions and
inspector implementation to new "deno_runtime" crate located
in "runtime/" directory.

Details in "runtime/README.md".

Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
2020-12-13 19:45:53 +01:00
Yosi Pramajaya
84ef9bd21f
fix(cli/compile): error when the output path already exists (#8681) 2020-12-12 20:41:43 +01:00
Bartek Iwańczuk
623bc22ad0
Revert "chore(test): increase file watcher timeout duration on macOS (#8733)" (#8737)
This reverts commit f4cf1b4538.
2020-12-12 16:54:00 +01:00
Yusuke Tanaka
f4cf1b4538
chore(test): increase file watcher timeout duration on macOS (#8733) 2020-12-12 14:32:46 +01:00
Tatsuya Yamamoto
93cd9ab0b8
docs: fix doc to remove annotation about removed function Deno.dir (#8732) 2020-12-12 13:16:52 +01:00
Andrew Mitchell
c05615d670
docs: Remove a deprecated function from docstring for Deno.permissions (#8729) 2020-12-12 13:15:50 +01:00
Bartek Iwańczuk
31935c6b8d
refactor(cli): more options on Worker (#8724) 2020-12-12 00:36:18 +01:00
Bartek Iwańczuk
65e72b68ac
refactor(cli): decouple ops from ProgramState and Flags (#8659)
This commit does major refactor of "Worker" and "WebWorker",
in order to decouple them from "ProgramState" and "Flags".
The main points of interest are "create_main_worker()" and
"create_web_worker_callback()" functions which are responsible
for creating "Worker" and "WebWorker" in CLI context.
As a result it is now possible to factor out common "runtime"
functionality into a separate crate.
2020-12-11 18:49:26 +01:00
crowlKats
71d468bec0
fix(cli): zsh completions (#8718) 2020-12-11 13:18:30 +01:00
Anh Hong
b8bc24d167
chore: fixed various misspellings and other typos (#8691) 2020-12-11 06:45:45 +11:00
Bartek Iwańczuk
f91fa16661
refactor(core): stack trace mapping (#8660)
This commit adds "Deno.core.createPrepareStackTrace". This function
was moved from "cli/rt/40_error_stack.js" to unify handling of stack frames in core
(before this PR there was implicit dependency on logic in "core/error.rs::JsError").
Unfortunately formatting logic must still be duplicated in "cli/error.js::PrettyJsError"
to provide coloring, but currently there's no solution to this problem.
"createPrepareStackTrace" can accept a single argument; a function that takes
a location and provides source mapped location back.
2020-12-10 14:45:41 +01:00
Kitson Kelly
1a72c9ba23
fix(lsp): only resolve sources with supported schemas (#8696)
Fixes #8695
2020-12-10 11:12:46 +11:00
Luca Casonato
de65312b7f
chore: update swc_ecmascript to 0.15.0 (#8688) 2020-12-09 23:09:10 +01:00
Kitson Kelly
95a6698cac
feat(lsp): support import maps (#8683) 2020-12-10 06:50:47 +11:00
Jae-Heon Ji
d492fb0eac
fix(op_crates/fetch): support non-ascii response headers value (#8600) 2020-12-09 16:48:06 +01:00