1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-01 09:24:20 -04:00
Commit graph

414 commits

Author SHA1 Message Date
Bartek Iwańczuk
2a83327a21 fix: replace bad rid panics with errors (#2870) 2019-09-10 00:59:40 -04:00
Ryan Dahl
35e3c06aed
Revert "feat: use trust-dns-resolver in HTTP client"
It caused the final executable to grow by 1.5 mb, and is not having any
other benefit.

This reverts commit 2b40fa065c.
2019-09-09 20:35:48 -04:00
Nayeem Rahman
718c8c4360 Fix path normalization in resolve_from_cwd() (#2875) 2019-09-07 14:13:09 -04:00
Bartek Iwańczuk
2b40fa065c feat: use trust-dns-resolver in HTTP client (#2847) 2019-09-07 13:16:36 -04:00
Nayeem Rahman
8e3c879d13 Add default-run (+ clean up old references) (#2876) 2019-09-06 22:31:56 -04:00
Ryan Dahl
acaff6d056
Remove tools/build.py (#2865)
Testing regression: ASAN build removed.
2019-09-06 20:32:58 -04:00
Yoshiya Hinosawa
595b4daa77 Remove replacements hack in deno_typescript (#2864) 2019-09-06 12:57:15 -04:00
Ryan Dahl
9d62d77cfa
Run tests after "cargo build" on travis (#2854) 2019-09-04 17:16:46 -04:00
Ryan Dahl
82588ec09c v0.17.0 2019-09-04 17:15:32 -04:00
Yoshiya Hinosawa
249db0f7d9 Handle typescript version in rust (#2855) 2019-09-03 22:12:21 -04:00
Ryan Dahl
d43b43ca78
Refactor snapshot build (#2825)
Instead of using core/snapshot_creator.rs, instead two crates are
introduced which allow building the snapshot during build.rs.

Rollup is removed and replaced with our own bundler. This removes
the Node build dependency. Modules in //js now use Deno-style imports
with file extensions, rather than Node style extensionless imports.

This improves incremental build time when changes are made to //js files
by about 40 seconds.
2019-09-02 17:07:11 -04:00
Yoshiya Hinosawa
56508f113d ops/fetch: add statusText (#2851) 2019-09-02 12:30:14 -04:00
Nayeem Rahman
0ce15f08c7 Remove DenoSubcommand::Install (#2846) 2019-09-01 14:20:23 -04:00
Bartek Iwańczuk
723284fd20
Use 'reqwest' to implement HTTP client (#2822)
Closes #2720
2019-08-30 14:49:03 -07:00
Bert Belder
840c4aa2b2
third_party: add 'reqwest' crate and dependencies 2019-08-30 14:47:48 -07:00
Ryan Dahl
c370f749b2
Remove ts_library_builder, maintain lib.deno_runtime.d.ts by hand (#2827) 2019-08-30 11:11:33 -04:00
Bert Belder
e939ec0f21
third_party: upgrade 'rustls' and related crates 2019-08-29 10:45:09 -07:00
Bert Belder
177727d730
third_party: downgrade 'url' crate to version 1.7.2 2019-08-29 10:45:09 -07:00
Bert Belder
89794d5d34
build: make it possible to pass arbitrary env vars to rustc 2019-08-29 10:45:00 -07:00
Ryan Dahl
2b79552dd1 Internalize base64-js, convert to TypeScript 2019-08-28 18:25:15 -04:00
Ryan Dahl
45ddff14b2 Remove unused GN action 2019-08-28 18:25:15 -04:00
Bartek Iwańczuk
20739a8111 feat: implement Addr interface (#2821) 2019-08-27 11:35:32 -04:00
Ryan Dahl
725eb98105
Clean up various flatbuffer references (#2819) 2019-08-26 22:29:51 -04:00
Ryan Dahl
f94900406d
Remove flatbuffers (#2818) 2019-08-26 17:02:34 -04:00
Ryan Dahl
d8ada4d3fc Port readSync/writeSync ops to minimal
This removes dispatch_flatbuffers as it is now unused. There are still a
few places where msg_generated is used: ErrorKind and MediaType. These
will be dealt with later.
2019-08-26 14:56:42 -04:00
Bartek Iwańczuk
a6f6209f52 port fs ops to JSON (#2812) 2019-08-26 10:18:42 -04:00
Bartek Iwańczuk
520f9631e0 bring back json ops (#2815) 2019-08-26 08:50:21 -04:00
Bartek Iwańczuk
017f88ee99 fix: shared queue requires aligned buffer (#2816) 2019-08-26 07:48:40 -04:00
Ryan Dahl
2235dd795d
Revert json ops (#2814)
* Revert "port more ops to JSON (#2809)"

This reverts commit 137f33733d.

* Revert "port ops to JSON: compiler, errors, fetch, files (#2804)"

This reverts commit 79f82cf10e.

* Revert "Port rest of os ops to JSON (#2802)"

This reverts commit 5b2baa5c99.
2019-08-24 13:20:48 -07:00
Bartek Iwańczuk
137f33733d port more ops to JSON (#2809) 2019-08-24 08:31:14 -07:00
Bartek Iwańczuk
79f82cf10e port ops to JSON: compiler, errors, fetch, files (#2804) 2019-08-24 06:02:42 -07:00
Ryan Dahl
5b2baa5c99
Port rest of os ops to JSON (#2802) 2019-08-24 05:13:50 -07:00
Ryan Dahl
bc467b265f
introduce JSON serialization for ops (#2799)
Converts env(), exit(), execPath(), utime() and utimeSync() to use JSON
instead of flatbuffers.
2019-08-22 22:30:14 -07:00
Bert Belder
47c216317f
build: enable 'derive' feature of 'serde' crate 2019-08-22 17:27:51 -07:00
Ryan Dahl
0809b06a39 v0.16.0 2019-08-22 15:11:22 -07:00
Bert Belder
7f9c6decc8
third_party: upgrade rust crates 2019-08-22 14:22:25 -07:00
Kitson Kelly
6c7d337960 Support .d.ts files (#2746)
Fixes #1432
2019-08-22 12:05:01 -04:00
Ryan Dahl
bdc97b3976
Organize dispatch a bit (#2796)
Just some clean up reorganization around flatbuffer/minimal dispatch
code. This is prep for adding a JSON dispatcher.
2019-08-21 20:42:48 -04:00
Bartek Iwańczuk
389763c04e bump test runner revision (#2800) 2019-08-21 13:49:48 -04:00
Bartek Iwańczuk
4faab6a74b fix: handle tsconfig.json with comments (#2773) 2019-08-17 12:53:34 -04:00
Ryan Dahl
de713e42c8
Upgrade to rust 1.37.0 (#2786) 2019-08-16 20:49:00 -04:00
Bartek Iwańczuk
1978358328 chore: bump test runner version (#2784) 2019-08-16 18:20:36 -04:00
Ryan Dahl
81f809f2a6 Revert "Remove dead code: legacy read/write ops"
This is causing a segfault for unknown reasons - see #2787.

This reverts commit 498f6ad431.
2019-08-16 14:41:08 -04:00
Nayeem Rahman
52a66c2796 Fix import map panics, use import map's location as its base URL (#2770) 2019-08-15 13:58:04 -04:00
Bartek Iwańczuk
d2d3afaf2d add deno test subcommand (#2783) 2019-08-15 10:11:52 -04:00
Ryan Dahl
498f6ad431
Remove dead code: legacy read/write ops (#2776)
readSync and writeSync use dispatch_minimal now.
2019-08-14 19:54:35 -04:00
Bartek Iwańczuk
e6c349af9f split up ops.rs (#2753)
Note cli/dispatch_minimal.rs ops are not yet included in cli/ops.

This is part of work towards #2730
2019-08-14 11:03:02 -04:00
Ryan Dahl
58f0e9b9b1 v0.15.0 2019-08-13 18:35:04 -04:00
Ryan Dahl
1f8b1a587c
Dynamic import should respect permissions (#2764) 2019-08-13 14:51:15 -04:00
Nayeem Rahman
1947f572d7 Fix permission requirements for Deno.rename() and Deno.link() (#2737) 2019-08-13 09:39:01 -04:00
Bert Belder
c3afa55751
Propagate Url::to_file_path() errors instead of panicking (#2771)
* Propagate Url::to_file_path() errors instead of panicking
2019-08-13 03:52:03 +02:00
Bartek Iwańczuk
9bd473d8ac feat: print cache location when no arg in deno info (#2752) 2019-08-11 18:43:01 -06:00
Bartek Iwańczuk
54982e948e fix: cache paths on Windows are broken (#2760) 2019-08-12 01:12:09 +02:00
Kevin (Kun) "Kassimo" Qian
286ee1d8b6 Fix dynamic import base path problem for REPL and eval (#2757) 2019-08-09 16:33:59 -07:00
Bert Belder
83d5362f1d
v0.14.0 2019-08-09 03:03:27 +02:00
Bert Belder
6fbf2e9624
Dynamic import (#2516) 2019-08-09 01:19:45 +02:00
andy finch
56a82e72d9 Resolve worker specifiers relative to main module of host. (#2751) 2019-08-08 14:38:53 -07:00
Daniel Buckmaster
520bdb6c31 Fix repl crash when deno dir doesn't exist (#2727) 2019-08-08 07:25:39 -04:00
Ryan Dahl
e438ac2c74
Add op_id throughout op API (#2734)
Removes the magic number hack to switch between flatbuffers and the
minimal dispatcher.

Adds machinery to pass the op_id through the shared_queue.
2019-08-07 14:02:29 -04:00
Kevin (Kun) "Kassimo" Qian
4519f9a50d Make Deno.execPath a function (#2743)
And throws without allow-env
2019-08-06 17:05:47 -04:00
Kevin (Kun) "Kassimo" Qian
ccee2f01ba Implement Blob url support for worker (#2729) 2019-08-06 09:22:11 -04:00
Nayeem Rahman
11c850af42 Enforce permissions on kill(), homeDir() and execPath (#2723) 2019-08-06 01:45:36 -04:00
Ryan Dahl
a517513182
Remove Deno.build.args feature (#2728)
This is a minor feature which complicates the build signifigantly.
Removing to ease refactoring the build system:
https://github.com/denoland/deno/issues/2608
2019-08-05 18:00:45 -04:00
Kevin (Kun) "Kassimo" Qian
ddee2dff14 Provide option to delete Deno namespace in worker (#2717) 2019-08-05 07:23:41 -04:00
Bartek Iwańczuk
aaa7a3eac4 use BTreeMap for ResourceTable (#2721) 2019-08-04 09:35:03 -04:00
Kevin (Kun) "Kassimo" Qian
52c13fb3ed Enforce env permission on homeDir() and execPath (#2714) 2019-08-03 21:34:13 -04:00
Bert Belder
c6861b537e
third_party: upgrade rust crates 2019-08-02 18:59:54 +02:00
Ryan Dahl
3971dcfe10
Use system rustfmt instead of fixed binary (#2701) 2019-07-31 17:11:37 -04:00
Ryan Dahl
b3541c38f5 v0.13.0 2019-07-31 15:09:06 -04:00
Bartek Iwańczuk
2e1ab82321 refactor: cleanup compiler pipeline (#2686)
* remove fetch_source_file_and_maybe_compile_async and 
  replace it with State.fetch_compiled_module

* remove SourceFile.js_source()

* introduce CompiledModule which is basically the same as
  deno::SourceInfo and represents arbitrary file that has been 
  compiled to JS module

* introduce //cli/compilers module containing all compilers

* introduce JsCompiler which is a no-op compiler
  - output is the same as input, no compilation takes place
  - it is used for MediaType::JavaScript and MediaType::Unknown

* introduce JsonCompiler that wraps JSON in default export

* support JS-to-JS compilation using checkJs
2019-07-31 13:16:03 -04:00
Bartek Iwańczuk
e7cee29c84 Add --current-thread flag (#2702) 2019-07-31 11:02:20 -04:00
Bartek Iwańczuk
421cbd39b4 factor out FileFetcher to separate module (#2683)
* merge SourceFileFetcher trait and FileFetcher struct

* move logic related to source file fetching to //cli/file_fetcher.rs

* use Result when creating new ThreadSafeState
2019-07-31 11:58:41 +00:00
Bartek Iwańczuk
ac269beabe feat: add debug info to ModuleResolutionError (#2697) 2019-07-30 14:34:57 +00:00
Kitson Kelly
5083f5fd90 Remap stack traces of unthrown errors. (#2693) 2019-07-29 09:11:08 +00:00
Bartek Iwańczuk
729c4e9377 make importmap flag global (#2687) 2019-07-27 14:37:03 +00:00
Bartek Iwańczuk
89e6792203 cli: handle deno -v and deno --version (#2684) 2019-07-27 09:20:40 +00:00
Bartek Iwańczuk
3ae808986d cli: unify deno -h options (#2682) 2019-07-26 07:36:56 +00:00
Bartek Iwańczuk
70de8dd51d save headers for all intermediate redirects (#2677) 2019-07-22 18:52:40 -04:00
andy finch
c98d9bf709 removed unnecessary implementation from SourceFileFetcher (#2670) 2019-07-20 11:02:54 -04:00
Bartek Iwańczuk
34f212f257 fix: bring back --no-fetch flag (#2671) 2019-07-20 09:19:06 -04:00
Ryan Dahl
a37bc0088f
Remove hacky normalize_path (#2660) 2019-07-18 15:01:44 -04:00
Ryan Dahl
55ca0f09cb
REPL shouldn't panic when it gets SIGINT (#2662) 2019-07-18 15:01:15 -04:00
Bartek Iwańczuk
8214b686ce Refactor DenoDir (#2636)
* rename `ModuleMetaData` to `SourceFile` and remove TS specific
  functionality

* add `TsCompiler` struct encapsulating processing of TypeScript files

* move `SourceMapGetter` trait implementation to `//cli/compiler.rs`

* add low-level `DiskCache` API for general purpose caches and use it in
  `DenoDir` and `TsCompiler` for filesystem access

* don't use hash-like filenames for compiled modules, instead use
  metadata file for storing compilation hash

* add `SourceFileCache` for in-process caching of loaded files for fast
  subsequent access

* define `SourceFileFetcher` trait encapsulating loading of local and
  remote files and implement it for `DenoDir`

* define `use_cache` and `no_fetch` flags on `DenoDir` instead of using
  in fetch methods
2019-07-17 18:15:30 -04:00
Ryan Dahl
4e248ecda9 v0.12.0 2019-07-16 16:08:50 -04:00
Yoshiya Hinosawa
9c45499864 Support window.onload (#2643) 2019-07-16 00:19:26 -04:00
Ryan Dahl
1fde15c0bc
Fix REPL when it receives EOF (#2638) 2019-07-12 10:23:08 -04:00
Bert Belder
abe8a113ad Refactor error to use dynamic dispatch and traits
This is in preperation for dynamic import (#1789), which is more easily
implemented when errors are dynamic.
2019-07-11 14:37:00 -04:00
Bartek Iwańczuk
963d56fc5e fix for '-' arg after script name (#2631) 2019-07-10 20:26:01 -04:00
Ryan Dahl
d7fa8c3207
Update deno.land links v0.11 (#2628) 2019-07-09 18:59:13 -04:00
Bartek Iwańczuk
d641782c82 Rewrite snapshot_creator in Rust 2019-07-08 18:18:28 -04:00
Bert Belder
afd66bb010
cli: generate default file name for bundle when URL ends in a slash 2019-07-08 23:05:00 +02:00
Bert Belder
f4c9b31405
core: replace ModuleSpecifier::to_url() by as_url() 2019-07-08 23:04:07 +02:00
Bartek Iwańczuk
72d9045528
cli: refactor deno_dir to use Url instead of String 2019-07-08 13:07:32 +02:00
Bert Belder
9b1997b8b6
core: clearly define when module lookup is path-based vs URL-based
The rules are now as follows:

* In `import` statements, as mandated by the WHATWG specification,
  the import specifier is always treated as a URL.
  If it is a relative URL, it must start with either / or ./ or ../

* A script name passed to deno as a command line argument may be either
  an absolute URL or a local path.
  - If the name starts with a valid URI scheme followed by a colon, e.g.
    'http:', 'https:', 'file:', 'foo+bar:', it always interpreted as a
    URL (even if Deno doesn't support the indicated protocol).
  - Otherwise, the script name is interpreted as a local path. The local
    path may be relative, and operating system semantics determine how
    it is resolved. Prefixing a relative path with ./ is not required.
2019-07-08 13:07:32 +02:00
Ryan Dahl
92ac616708 v0.11.0 2019-07-07 12:17:46 -04:00
Bert Belder
32cde32e54 core: return useful error when import path has no prefix like ./ 2019-06-30 19:46:32 +02:00
Bartek Iwańczuk
9d18f97327 fix: normalize Deno.execPath (#2598) 2019-06-30 13:32:24 -04:00
Bartek Iwańczuk
5a4bebb770 fix: test output for completions (#2597) 2019-06-29 18:35:56 -04:00
Bartek Iwańczuk
38cf346d5c feat: parse flags after script name (#2596) 2019-06-29 18:32:54 -04:00
Gurwinder Singh
d7d3e9f9de Fix multiple error messages for a missing file (#2587) 2019-06-27 09:34:12 -04:00
Jimmy Cao
fb6d57a281 fix: run blocking function on a different task (#2570)
This avoids freezing the current task if the fn blocks indefinitely
2019-06-26 19:12:11 -04:00
Bartek Iwańczuk
6906a2f75e feat: deno completions command (#2577) 2019-06-26 03:02:13 -07:00
Evgeniy Karagodin
d089f97978 Add homeDir to Deno namespace (#2578) 2019-06-25 09:05:41 -07:00
Ryan Dahl
c56df45355 v0.10.0 2019-06-25 07:09:46 -07:00
Ryan Dahl
3a4d88475b Port code from Cargo and use for progress
A lot of its functionality is unused still, but the goal it to slowly
migrate logging functionality to it. There is also a useful progress bar
which can be ported over later - it depends on this module.

4c1fa54d10/src/cargo/util/progress.rs
2019-06-25 06:32:28 -07:00
Bert Belder
89216c7baa third_party: add rust crate 'termcolor' 2019-06-25 06:32:28 -07:00
Ryan Dahl
046cbef4f0 simplify check_net test 2019-06-25 06:32:28 -07:00
Bartek Iwańczuk
70a9859adc refactor: use Path/PathBuf in deno dir (#2559) 2019-06-24 10:10:21 -07:00
Bartek Iwańczuk
3c81cca037 fix: prevent multiple downloads of modules (#2477) 2019-06-24 09:04:06 -07:00
Gurwinder Singh
6fa6828e5f Minor tweaks (#2569)
1. Separate Snapshot and Script StartupData functions based on cfg "no-snapshot-init"
2. Replace deprecated Once::ONCE_INIT with Once::new (https://github.com/rust-lang/rust/pull/61757)
3. Elide lifetime
4. Fix typos
2019-06-23 04:49:49 -07:00
Bartek Iwańczuk
b9fbd55214 feat: log permission access (#2518)
Replaces -D/--log-debug flag with --log-level=debug

--log-level=info displays permission access
2019-06-22 09:02:51 -07:00
Bartek Iwańczuk
642eaf97c6 feat: redirect process stdio to file (#2554) 2019-06-21 16:00:14 -07:00
Matt Harrison
20f41e719d Fix comment (#2555) 2019-06-21 08:21:13 -07:00
Bartek Iwańczuk
77a00aef4c feat: upgrade installer and add docs (#2551) 2019-06-20 11:25:13 -07:00
Kitson Kelly
425df50484 Combine CLI Errors (#2487) 2019-06-19 19:07:01 -07:00
Bartek Iwańczuk
01858f115a fix: use Loader::resolve in op_fetch_module_meta_data (#2519) 2019-06-18 07:23:06 -07:00
Kitson Kelly
ed390a51ca Add dyn to be rust nightly compatible (#2538) 2019-06-18 06:28:56 -07:00
andy finch
76d51b0f9a refactor dispatch take 2 (#2533) 2019-06-17 18:02:08 -07:00
Ryan Dahl
7b06aa3734 v0.9.0 2019-06-15 09:04:57 -07:00
Ryan Dahl
9142a7df46
Upgrade INSTALLER_URL to include fixes (#2532)
denoland/deno_std#492
2019-06-15 07:50:36 -07:00
Bartek Iwańczuk
061f6dd483 fix deno install (#2529) 2019-06-15 07:08:11 -07:00
Bert Belder
77737707e4
third_party: upgrade rust crates 2019-06-15 15:20:02 +02:00
Ryan Dahl
1361e30223 Revert "Refactor dispatch handling (#2452)"
Due to performance regression:
dc60fe9f30 (commitcomment-33943711)

This reverts commit dc60fe9f30.
2019-06-14 13:56:36 -07:00
Bartek Iwańczuk
3dff147d0c feat: add deno install command (#2522) 2019-06-14 10:05:06 -07:00
andy finch
dc60fe9f30 Refactor dispatch handling (#2452)
Promise id is now created in core and passed back to JS.
2019-06-13 20:43:54 -07:00
Bartek Iwańczuk
bca5cc5041 Move ModuleSpecifier to //core (#2509) 2019-06-12 16:55:59 -07:00
Bartek Iwańczuk
b3c4307d02 Refactor module resolving (#2493)
Adds ModuleSpecifier, which wraps a URL. This is now passed around instead of
specifier and resolver strings.
2019-06-12 12:00:08 -07:00
Ryan Dahl
2a5138a516
Remove Config struct from core (#2502)
It's unnecessary indirection and is preventing the ability to easily
pass isolate references into the dispatch and dyn_import closures.

Note: this changes how StartupData::Script is executed. It's no longer done
during Isolate::new() but rather lazily on first poll or execution.
2019-06-12 10:53:24 -07:00
Gurwinder S
7fc3d5ed8b Removed unused method and update docs (#2499) 2019-06-11 16:09:31 -04:00
Ryan Dahl
912e4f7177
feat: default output filename for deno bundle (#2484)
And improve bundle docs
2019-06-11 14:38:19 -04:00
Ryan Dahl
de8c85f8f2
Move Modules to ThreadSafeState (#2498) 2019-06-11 14:35:03 -04:00
Matt Harrison
d82c1991cf Add --seed for setting RNG seed (#2483) 2019-06-11 10:34:39 -04:00
Ryan Dahl
523ab6a929
Upgrade V8 to 7.7.37 (#2492) 2019-06-10 18:49:30 -04:00
Neil Richter
163d60bf16 typo (#2489) 2019-06-10 09:20:19 -04:00
Bartek Iwańczuk
a115340288 feat: Import maps (#2360) 2019-06-09 09:08:20 -04:00
Ryan Dahl
d60bdb6350 v0.8.0 2019-06-08 15:16:34 -04:00
Kitson Kelly
307e092753 Add 'bundle' subcommand. (#2467) 2019-06-08 14:42:28 -04:00
gurv-s
35f879ad32 Remove tokio_util::block_on dep in compile_async and other cleanup 2019-06-08 10:59:20 -04:00
gurv-s
95eac608a6 Make print_file_info async 2019-06-08 10:59:20 -04:00
gurv-s
564222bc10 make op_create_worker async internally 2019-06-08 10:59:20 -04:00
gurv-s
c0b28dc224 Use static dispatch 2019-06-08 10:59:20 -04:00
Kitson Kelly
e3b2205eba Cleanup compiler API (#2466) 2019-06-06 20:37:26 -04:00
Ryan Dahl
e152dae006
RecursiveLoad shouldn't own the Isolate (#2453)
This patch makes it so that RecursiveLoad doesn't own the Isolate, so
Worker::execute_mod_async does not consume itself.

Previously Worker implemented Loader, but now ThreadSafeState does.

This is necessary preparation work for dynamic import (#1789) and import
maps (#1921)
2019-06-05 16:35:38 -04:00
Bartek Iwańczuk
6fa4d2e759 feat: bring back deno <script> (#2451) 2019-06-05 13:44:46 -04:00
Kitson Kelly
a71305b4fe Handle compiler diagnostics in Rust (#2445) 2019-06-04 09:03:56 -04:00
Gurwinder S
bbc8de0c7a Fix typo (#2443) 2019-06-02 14:23:36 -04:00
Yoshiya Hinosawa
79f770b178 fmt: add --stdout option (#2439) 2019-06-01 08:54:32 -04:00
Bert Belder
1540b36ce7
third_party: upgrade rust crates 2019-05-30 11:28:05 -07:00
Axetroy
4c80394f54 bump std/prettier@0.5.0 to std/prettier@0.7.0 (#2425) 2019-05-30 08:35:42 -04:00
Ryan Dahl
5265bd7cb1 v0.7.0 2019-05-29 18:42:49 -04:00
Ryan Dahl
856c44213b TS compiler refactor
* Compiler no longer has its own Tokio runtime. Compiler handles one
  message and then exits.

* Uses the simpler ts.CompilerHost interface instead of
  ts.LanguageServiceHost.

* avoids recompiling the same module by introducing a hacky but simple
  `hashset<string>` that stores the module names that have been already
  compiled.

* Removes the CompilerConfig op.

* Removes a lot of the mocking stuff in compiler.ts like `this._ts`. It
  is not useful as we don't even have tests.

* Turns off checkJs because it causes fmt_test to die with OOM.
2019-05-29 07:53:39 -04:00
Ryan Dahl
53b6356ec5 Correct tokio_util::block_on() and op_fetch_module_meta_data
op_fetch_module_meta_data is an op that is used by the TypeScript
compiler. TypeScript requires this op to be sync. However the
implementation of the op does things on the event loop (like fetching
HTTP resources).

In certain situations this can lead to deadlocks. The runtime's thread
pool can be filled with ops waiting on the result of
op_fetch_module_meta_data. The runtime has a maximum number of
threads it can use (the number of logical CPUs on the system).

This patch changes tokio_util::block_on to launch a new Tokio runtime
for evaluating the future, thus bipassing the max-thread problem.

This is only an issue in op_fetch_module_meta_data. Other synchronous
ops are truly synchornous, not interacting with the event loop.  TODO
comments are added to direct future development.
2019-05-29 07:53:39 -04:00
Adam Conrad
9fd4096235 add EventTarget implementation (#2377) 2019-05-27 09:20:34 -04:00
Bartek Iwańczuk
73ac5f89f0 add module and line no for Rust logger (#2409) 2019-05-25 19:23:47 +03:00
ztplz
86684799c4 typo (#2366) 2019-05-24 14:36:50 +03:00
Bartek Iwańczuk
1105982586 re-fix permissions for dial and listen (#2400)
Closes #2397
2019-05-23 23:47:55 +03:00
Ryan Dahl
f92af3576a
Improve CLI help (#2388) 2019-05-23 21:57:44 +03:00
Ryan Dahl
583a646be7
Fix concurrent accepts (#2403) 2019-05-23 21:22:52 +03:00
Ryan Dahl
2952fb5405
Rename --allow-high-precision to --allow-hrtime (#2398) 2019-05-23 19:28:29 +03:00
Bert Belder
7d03a63ded
Revert "Fix permissions for dial and listen (#2373)"
This reverts commit 7219787894.
2019-05-22 19:47:15 -07:00
Bartek Iwańczuk
880265275f Use tagged version of prettier in CLI (#2387) 2019-05-21 15:39:50 -04:00
Ryan Dahl
22feb74ba1 v0.6.0 2019-05-20 15:22:08 -04:00
Bartek Iwańczuk
7219787894 Fix permissions for dial and listen (#2373) 2019-05-17 14:50:53 -04:00
chiefbiiko
00f6fa46b3 Add crypto.getRandomValues() (#2327) 2019-05-17 14:03:01 -04:00
Bartek Iwańczuk
7f6549532c Don't print new line if progress bar was not used (#2374) 2019-05-17 12:35:29 -04:00
Bert Belder
3ff240b963
third_party: add rust crate 'serde_derive' 2019-05-16 20:51:47 -07:00
Bert Belder
e9c9d71633
third_party: upgrade rust crates 2019-05-16 20:43:23 -07:00
Bert Belder
3d6f0a85af
build: add support for rust proc-macro crates 2019-05-16 20:33:25 -07:00
Bert Belder
6e7ccf0b49
tools: format .gn files in the 'cli' directory 2019-05-16 19:57:31 -07:00
Daiki Ihara
9c9c58c84d Add permission whitelist docs (#2365) 2019-05-16 10:39:19 -04:00
Yoshiya Hinosawa
6a5893a269 fmt: use --write option of prettier/main.ts (#2363)
This is step 1 of the plan outlined here:
https://github.com/denoland/deno/issues/2090#issuecomment-492897028
2019-05-16 10:11:35 -04:00
Ryan Dahl
e02d8bcf18 Remove FileInfo.path 2019-05-15 21:14:17 -04:00
diskkid
2508480465 Add error handling to dispatch_minimal::ops::read/write (#2349) 2019-05-15 14:50:54 -04:00
Ryan Dahl
a00fa7056b
Fix command in docs (#2353) 2019-05-14 15:23:56 -04:00
Ryan Dahl
23aca36d52 v0.5.0 2019-05-11 17:19:21 -04:00
Ryan Dahl
aba952397a
Add progress bar (#2309) 2019-05-11 10:23:19 -04:00
Bert Belder
c0341cb1af
third_party: upgrade rust crates 2019-05-11 05:03:03 +02:00
Bartek Iwańczuk
1fc61f3b6a core: Privatize ModuleNameMap SymbolicModule deno_buf (#2324) 2019-05-09 16:44:30 -04:00
Kevin (Kun) "Kassimo" Qian
d9cdc6788b fix: support relative path for whitelisting (#2317)
Using `std::fs::canonicalize` to expand path to full existing path, such that
later attempt to loop-pop and compare path segment would work.
2019-05-09 12:20:34 -04:00
andy finch
2edee3367d First pass at permissions whitelist (#2129) 2019-05-08 19:20:30 -04:00
Yingbo (Max) Wang
ec9080f34c Add Deno.chown (#2292) 2019-05-07 21:58:57 -04:00
Bartek Iwańczuk
1f7ad17152 fix: Add all permissions to deno xeval (#2290) 2019-05-06 10:48:19 -04:00
Ryan Dahl
2aae09c2b8 v0.4.0 2019-05-03 19:33:50 -04:00
Bartek Iwańczuk
5824e55efa fix: deno version panic (#2286) 2019-05-03 18:48:50 -04:00
Ryan Dahl
3b1e2f1ad4 v0.3.11 2019-05-03 18:05:41 -04:00
Bartek Iwańczuk
f6a9d7d717 add "deno run" subcommand (#2215) 2019-05-03 17:15:16 -04:00
Kevin (Kun) "Kassimo" Qian
3608117132 feat(cli cmd): deno xeval (#2260) 2019-05-03 16:24:09 -04:00
Kevin (Kun) "Kassimo" Qian
401a5c0211 feat: support .mjs extension resolution (#2283)
Removed `extmap` and added .mjs entry in `map_file_extension`.
The assert in the compiler does not need to be updated, since it is
resolving from the compiled cache instead of elsewhere (notice the .map
is asserted next to it)
2019-05-03 15:03:10 -04:00
Bartek Iwańczuk
459162fc6e add --no-fetch CLI flag to prevent remote downloads (#2213) 2019-05-03 11:09:51 -04:00
Bartek Iwańczuk
bf9b0c8231 Fix: deno --v8-options does not print v8 options (#2277) 2019-05-03 08:59:52 -04:00
Ryan Dahl
00ac871607
Optimize read and write ops (#2259) 2019-05-03 00:06:43 -04:00
Bert Belder
8999517421
core,cli: fix clippy warnings 2019-05-03 03:29:42 +02:00
Kurt Mackey
c05cbc8eac Add Request global constructor (#2253) 2019-05-01 23:56:42 -04:00
Kevin (Kun) "Kassimo" Qian
1dd30f658f doc: add long about messages for subcommands (#2264)
Type deno <subcommand> -h to view descriptions.
2019-05-01 19:15:36 -04:00
Ryan Dahl
c171813e89
core: express op as enum (#2255) 2019-05-01 18:22:32 -04:00
Bert Belder
41c7e96f1a
Refactor zero-copy buffers for performance and to prevent memory leaks
* In order to prevent ArrayBuffers from getting garbage collected by V8,
  we used to store a v8::Persistent<ArrayBuffer> in a map. This patch
  introduces a custom ArrayBuffer allocator which doesn't use Persistent
  handles, but instead stores a pointer to the actual ArrayBuffer data
  alongside with a reference count. Since creating Persistent handles
  has quite a bit of overhead, this change significantly increases
  performance. Various HTTP server benchmarks report about 5-10% more
  requests per second than before.

* Previously the Persistent handle that prevented garbage collection had
  to be released manually, and this wasn't always done, which was
  causing memory leaks. This has been resolved by introducing a new
  `PinnedBuf` type in both Rust and C++ that automatically re-enables
  garbage collection when it goes out of scope.

* Zero-copy buffers are now correctly wrapped in an Option if there is a
  possibility that they're not present. This clears up a correctness
  issue where we were creating zero-length slices from a null pointer,
  which is against the rules.
2019-05-01 21:11:09 +02:00
Bartek Iwańczuk
8978870808 Rename test targets (#2262) 2019-05-01 09:48:56 -04:00
Kevin (Kun) "Kassimo" Qian
7237e9d34a fs: add Deno.utime/Deno.utimeSync (#2241) 2019-05-01 05:08:11 -04:00
Ryan Dahl
6c137342d7
flags: fix merge error (#2244) 2019-04-29 18:35:25 -07:00
Bartek Iwańczuk
636827a1d5 Rewrite flags.rs::parse_flags (#2237) 2019-04-29 16:43:06 -07:00