0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-10-30 09:08:00 -04:00
denoland-deno/cli
Bartek Iwańczuk 9d63772fe5
refactor: rewrite TS dependency analysis in Rust (#5029)
This commit completely overhauls how module analysis is 
performed in TS compiler by moving the logic to Rust.

In the current setup module analysis is performed using 
"ts.preProcessFile" API in a special TS compiler worker 
running on a separate thread.

"ts.preProcessFile" allowed us to build a lot of functionality
in CLI including X-TypeScript-Types header support 
and @deno-types directive support. Unfortunately at the 
same time complexity of the ops required to perform 
supporting tasks exploded and caused some hidden 
permission escapes.

This PR introduces "ModuleGraphLoader" which can parse
source and load recursively all dependent source files; as 
well as declaration files. All dependencies used in TS 
compiler and now fetched and collected upfront in Rust 
before spinning up TS compiler.

To achieve feature parity with existing APIs this commit 
includes a lot of changes:

* add "ModuleGraphLoader"
  - can fetch local and remote sources
  - parses source code using SWC and extracts imports, exports, file references, special 
     headers
  - this struct inherited all of the hidden complexity and cruft from TS version and requires 
     several follow up PRs
* rewrite cli/tsc.rs to perform module analysis upfront and send all required source code to 
  TS worker in one message
* remove op_resolve_modules and op_fetch_source_files from cli/ops/compiler.rs
* run TS worker on the same thread
2020-05-18 12:59:29 +02:00
..
doc Update to dprint 0.18.3 and the latest version of swc (#5509) 2020-05-17 18:56:22 +02:00
js refactor: rewrite TS dependency analysis in Rust (#5029) 2020-05-18 12:59:29 +02:00
ops refactor: rewrite TS dependency analysis in Rust (#5029) 2020-05-18 12:59:29 +02:00
tests refactor: rewrite TS dependency analysis in Rust (#5029) 2020-05-18 12:59:29 +02:00
build.rs Unstable methods should not appear in runtime or d.ts (#4957) 2020-04-30 11:23:40 -04:00
Cargo.toml Update to dprint 0.18.3 and the latest version of swc (#5509) 2020-05-17 18:56:22 +02:00
checksum.rs fix: source maps in inspector (#5223) 2020-05-11 23:48:36 +02:00
colors.rs feat: Added colors to doc output (#4518) 2020-03-28 17:35:31 -04:00
deno_dir.rs fix: panic if $DENO_DIR is a relative path (#5375) 2020-05-15 16:32:52 +02:00
diagnostics.rs fix some unwrap() in Rust (#5485) 2020-05-16 09:41:32 -04:00
disk_cache.rs fix: panic if $DENO_DIR is a relative path (#5375) 2020-05-15 16:32:52 +02:00
file_fetcher.rs refactor: rewrite TS dependency analysis in Rust (#5029) 2020-05-18 12:59:29 +02:00
flags.rs Miscellaneous documentation and spelling improvements (#5527) 2020-05-17 19:24:39 +02:00
fmt.rs feat: format deno bundle output (#5139) 2020-05-07 14:39:00 -04:00
fmt_errors.rs refactor(cli): unify display of errors from Rust and JS (#5183) 2020-05-09 21:09:46 +02:00
fs.rs refactor: move code from fs.rs into ops/fs.rs (#4428) 2020-03-20 09:46:26 -04:00
global_state.rs refactor: rewrite TS dependency analysis in Rust (#5029) 2020-05-18 12:59:29 +02:00
global_timer.rs clippy (#4618) 2020-04-03 22:41:16 -04:00
http_cache.rs fix: panic if $DENO_DIR is a relative path (#5375) 2020-05-15 16:32:52 +02:00
http_util.rs Add support for X-Deno-Warning header (#5161) 2020-05-09 12:43:24 -04:00
import_map.rs update references to testing/mod.ts in manual (#3973) 2020-02-11 21:50:20 +01:00
inspector.rs Make --inspect-brk pause on the first line of _user_ code (#5250) 2020-05-13 00:12:46 +02:00
installer.rs fix(cli/installer): Fix concurrent env handling in tests (#5182) 2020-05-09 19:14:56 +02:00
js.rs BREAKING: Remove support for .wasm imports (#5135) 2020-05-07 20:43:27 +02:00
lockfile.rs fix: source maps in inspector (#5223) 2020-05-11 23:48:36 +02:00
main.rs refactor: rewrite TS dependency analysis in Rust (#5029) 2020-05-18 12:59:29 +02:00
metrics.rs feat: update metrics to track different op types (#4221) 2020-03-02 19:13:36 +01:00
module_graph.rs refactor: rewrite TS dependency analysis in Rust (#5029) 2020-05-18 12:59:29 +02:00
msg.rs refactor: rewrite TS dependency analysis in Rust (#5029) 2020-05-18 12:59:29 +02:00
op_error.rs Make writeSync, readSync, seekSync, openSync, isatty proper synchronous syscalls (#4762) 2020-04-15 20:43:19 -04:00
permissions.rs refactor: check permissions in SourceFileFetcher (#5011) 2020-05-11 13:13:27 +02:00
README.md update readmes (#3765) 2020-01-23 22:32:52 +01:00
repl.rs Remove REPL/Windows hack (#5136) 2020-05-07 12:01:27 -04:00
resolve_addr.rs remove calls to futures::executor::block_on (#4760) 2020-04-15 23:14:28 -04:00
signal.rs Implement Deno.kill for windows (#5347) 2020-05-17 19:11:24 +02:00
source_maps.rs refactor(core/js_error): Align JSStackFrame with CallSite (#4715) 2020-04-13 10:54:16 -04:00
startup_data.rs Upgrade to rusty_v8 v0.4.0 (#4856) 2020-04-23 03:35:52 +02:00
state.rs refactor: rewrite TS dependency analysis in Rust (#5029) 2020-05-18 12:59:29 +02:00
swc_util.rs refactor: rewrite TS dependency analysis in Rust (#5029) 2020-05-18 12:59:29 +02:00
test_runner.rs BREAKING(std): reorganization (#5087) 2020-05-09 08:34:47 -04:00
test_util.rs BREAKING: There is no public Rust API for the CLI (#5226) 2020-05-11 17:33:36 -04:00
tokio_util.rs workers: basic event loop (#3828) 2020-02-11 10:04:59 +01:00
tsc.rs refactor: rewrite TS dependency analysis in Rust (#5029) 2020-05-18 12:59:29 +02:00
upgrade.rs feat(upgrade): allow specifying a version (#5156) 2020-05-09 06:31:15 -04:00
version.rs Rename crates: 'deno' to 'deno_core' and 'deno_cli' to 'deno' (#3600) 2020-01-05 11:56:18 -05:00
web_worker.rs Return error if more than one listener calls WorkerHandle::get_event() (#5461) 2020-05-17 06:50:38 +02:00
worker.rs Return error if more than one listener calls WorkerHandle::get_event() (#5461) 2020-05-17 06:50:38 +02:00

Deno CLI Crate

crates docs

This provides the actual deno executable and the user-facing APIs.

The deno crate uses the deno_core and deno_typescript to provide the executable.