1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-21 15:04:11 -05:00
denoland-deno/cli/ops
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
..
compiler.rs refactor: rewrite TS dependency analysis in Rust (#5029) 2020-05-18 12:59:29 +02:00
dispatch_json.rs Rename deno_core::Isolate to deno_core::CoreIsolate (#4851) 2020-04-23 11:51:07 +02:00
dispatch_minimal.rs Rename deno_core::Isolate to deno_core::CoreIsolate (#4851) 2020-04-23 11:51:07 +02:00
errors.rs refactor(ts): remove op_cache (#5071) 2020-05-05 18:23:15 +02:00
fetch.rs Rename deno_core::Isolate to deno_core::CoreIsolate (#4851) 2020-04-23 11:51:07 +02:00
fs.rs fix some clippy warning (#5462) 2020-05-15 15:26:16 -04:00
fs_events.rs Rename deno_core::Isolate to deno_core::CoreIsolate (#4851) 2020-04-23 11:51:07 +02:00
io.rs Rename deno_core::Isolate to deno_core::CoreIsolate (#4851) 2020-04-23 11:51:07 +02:00
mod.rs Change plugin interface to prevent segfaults when unloading plugin (#5210) 2020-05-11 22:39:13 +02:00
net.rs refactor: factor out datagram from Deno.listen(), make it unstable (#4968) 2020-04-28 21:46:39 +02:00
net_unix.rs BREAKING: address renamed to path in UnixAddr UnixConnectOptions UnixListenOptions (#4959) 2020-04-28 12:37:59 -04:00
os.rs BREAKING: make Deno.hostname unstable (#5108) 2020-05-09 12:44:35 -04:00
permissions.rs Rename deno_core::Isolate to deno_core::CoreIsolate (#4851) 2020-04-23 11:51:07 +02:00
plugin.rs Change plugin interface to prevent segfaults when unloading plugin (#5210) 2020-05-11 22:39:13 +02:00
process.rs Make Deno.kill unstable (#4950) 2020-04-27 23:36:43 -04:00
random.rs Rename deno_core::Isolate to deno_core::CoreIsolate (#4851) 2020-04-23 11:51:07 +02:00
repl.rs Rename deno_core::Isolate to deno_core::CoreIsolate (#4851) 2020-04-23 11:51:07 +02:00
resources.rs cli: don't panic on Deno.close invalid argument (#5320) 2020-05-14 06:59:56 -04:00
runtime.rs BREAKING: remove window.location and self.location (#5034) 2020-05-01 20:15:28 +02:00
runtime_compiler.rs refactor: check permissions in SourceFileFetcher (#5011) 2020-05-11 13:13:27 +02:00
signal.rs signal APIs should require --unstable (#4926) 2020-04-27 13:38:23 -04:00
timers.rs Rename deno_core::Isolate to deno_core::CoreIsolate (#4851) 2020-04-23 11:51:07 +02:00
tls.rs fix some unwrap() in Rust (#5485) 2020-05-16 09:41:32 -04:00
tty.rs Make Deno.isatty stable (#4937) 2020-04-29 12:43:34 +02:00
web_worker.rs Rename deno_core::Isolate to deno_core::CoreIsolate (#4851) 2020-04-23 11:51:07 +02:00
worker_host.rs Return error if more than one listener calls WorkerHandle::get_event() (#5461) 2020-05-17 06:50:38 +02:00