Commit graph

2293 commits

Author SHA1 Message Date
Satya Rohith 89b61b5d05
fix(cli): give context when failed to load import map (#10478) 2021-05-04 14:27:20 +02:00
Casper Beyer 17118c41e4
docs(cli/ftruncateSync): use openSync in example (#10485) 2021-05-04 16:47:11 +09:00
Anonymous 688557e226
fix(op_crates/fetch): check fetch() argument length (#10474) 2021-05-03 09:05:42 +02:00
Aaron O'Mullan ea917384fe
refactor(core): convert core.print() to a builtin op (#10436) 2021-05-02 19:30:03 -04:00
Aaron O'Mullan c9ac851b90
cleanup(bench/deno_http_native): don't use Deno.core funcs (#10460)
`Deno.core.*` is unstable and not fit for public consumption, although this is a somewhat internal bench some people may use it as reference code and start using `Deno.core.encode()` in their own code
2021-05-02 19:23:19 -04:00
Casper Beyer 40961cda58
fix(test): change inflection depending on number of pending tests (#10466) 2021-05-02 08:30:30 -04:00
Aaron O'Mullan 89057529bc
clean(cli): prefix all op functions with op_ (#10463)
Makes the codebase more searchable and helps distinguish op functions from helper functions

Besides tests/examples/benches this pattern appears to be used everywhere else in the codebase
2021-05-02 08:29:19 -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
Liam Murphy be287ff6a1
fix(console): Remove console.timeStamp from types (#10455)
Fixes #10444
2021-05-01 06:41:38 -04: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
Casper Beyer f31ee8d1bf
fix(test): default to num cpus when no value is given (#10443) 2021-04-30 08:57:42 -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
Kitson Kelly 0ac2a17a0f
chore: remove unused keys from TsConfigJson (#10417) 2021-04-29 22:26:37 +10:00
Casper Beyer ec0d3b6128
refactor(cli): move test reporting into trait (#10408) 2021-04-29 13:42:35 +02:00
Satya Rohith f60373e0d1
chore(lsp): remove dead code (#10409) 2021-04-28 14:36:23 -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
Yoshiya Hinosawa 8c6f977192
docs: document how to stop file watcher (#10403) 2021-04-28 21:37:16 +09: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
Bartek Iwańczuk baf7092ea2
remove --unstable flag from CLI features (#10190) 2021-04-27 12:44:36 +02:00
Aaron O'Mullan 83770e898e
fix(console): circular customInspect (#10338) 2021-04-27 11:54:47 +02:00
Yoshiya Hinosawa 4fa0e9c652
docs: fix ftruncateSync example (#10393) 2021-04-27 11:23:18 +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
David Sherret 791513d608
feat: Support deno-fmt-ignore-file for markdown formatting (#10191) 2021-04-26 17:43:32 +02:00
Carter Snook 0d3b22a53a
fix: invalid types for asynchronous and synchronous File#truncate (#10353) 2021-04-26 16:56:22 +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
Carter Snook 0897bd51a0
fix(#10360): clarify JSDoc for Deno.noColor (#10373)
Fixes #10360 

Co-authored-by: Luca Casonato <lucacasonato@yahoo.com>
2021-04-26 13:59:22 +10: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
Satya Rohith 7063e449f1
fix(#10362): include range for export statements (#10369)
Fixes #10362
2021-04-26 06:59:18 +10:00
Nayeem Rahman fb1ccc3d88
refactor(cli): rename Deno.emit() bundle options to "module" and "classic" (#10332) 2021-04-26 06:54:57 +10:00
Aaron O'Mullan 83bece56b0
refactor(core): move op cache sync responsibility to rust space (#10340)
Even if bootstrapping the JS runtime is low level, it's an abstraction leak of 
core to require users to call `Deno.core.ops()` in JS space.

So instead we're introducing a `JsRuntime::sync_ops_cache()` method, 
once we have runtime extensions a new runtime will ensure the ops 
cache is setup (for the provided extensions) and then loading/unloading 
plugins should be the only operations that require op cache syncs
2021-04-25 22:00:05 +02:00
Aaron O'Mullan 201185f9fb
fix(cli/dts): sleepSync doesn't return a Promise (#10358)
Per its name its synchronous for the current thread
2021-04-25 00:48:43 +02:00
crowlKats fd3b961126
feat(cli/upgrade): add download progress (#10343) 2021-04-24 13:37:43 -04:00
Satya Rohith 13f7592b8a
refactor: use 'data-url' crate to process data URLs in lsp & file_fetcher (#10196)
Closes: #10118
2021-04-23 20:43:13 +02: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
Ryan Dahl 2400ecbe16
Use ubuntu-latest-xl on more CI jobs (#10322) 2021-04-23 12:11:23 -04: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 8074d8bcf3
1.9.2 2021-04-23 16:08:06 +02:00
Luca Casonato 52d316f143
chore: release crates (#10327)
Release crates for the cli 1.9.2 release.
2021-04-23 15:05:12 +02: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
Aaron O'Mullan 2d722832c4
fix(cli): standalone bin corruption on M1 (#10311) 2021-04-23 12:33:45 +02:00
Ryan Dahl 21ab4d94c0
fix(#10292): Don't gray-out internal frames (#10293) 2021-04-22 08:30:03 -04:00
Ryan Dahl b837fc300d
fix(#10302): flaky worker test (#10303) 2021-04-21 22:02:11 -04:00
Aaron O'Mullan ff9ff4a377
refactor(core): simplify error handling (#10297)
- register builtin v8 errors in core.js so consumers don't have to
- remove complexity of error args handling (consumers must provide a 
  constructor with custom args, core simply provides msg arg)
2021-04-21 20:50:50 -04:00