summaryrefslogtreecommitdiff
path: root/cli/compiler.rs
AgeCommit message (Collapse)Author
2019-07-31refactor: cleanup compiler pipeline (#2686)Bartek Iwańczuk
* 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-31factor out FileFetcher to separate module (#2683)Bartek Iwańczuk
* 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-22save headers for all intermediate redirects (#2677)Bartek Iwańczuk
2019-07-17Refactor DenoDir (#2636)Bartek Iwańczuk
* 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-11Refactor error to use dynamic dispatch and traitsBert Belder
This is in preperation for dynamic import (#1789), which is more easily implemented when errors are dynamic.
2019-07-08cli: refactor deno_dir to use Url instead of StringBartek Iwańczuk
2019-07-08core: clearly define when module lookup is path-based vs URL-basedBert Belder
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-06-25Port code from Cargo and use for progressRyan Dahl
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. https://github.com/rust-lang/cargo/blob/4c1fa54d10f58d69ac9ff55be68e1b1c25ecb816/src/cargo/util/progress.rs
2019-06-24refactor: use Path/PathBuf in deno dir (#2559)Bartek Iwańczuk
2019-06-19Combine CLI Errors (#2487)Kitson Kelly
2019-06-12Move ModuleSpecifier to //core (#2509)Bartek Iwańczuk
2019-06-12Refactor module resolving (#2493)Bartek Iwańczuk
Adds ModuleSpecifier, which wraps a URL. This is now passed around instead of specifier and resolver strings.
2019-06-08Add 'bundle' subcommand. (#2467)Kitson Kelly
2019-06-08Remove tokio_util::block_on dep in compile_async and other cleanupgurv-s
2019-06-06Cleanup compiler API (#2466)Kitson Kelly
2019-06-04Handle compiler diagnostics in Rust (#2445)Kitson Kelly
2019-05-29TS compiler refactorRyan Dahl
* 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-11Add progress bar (#2309)Ryan Dahl
2019-04-29Add support for custom tsconfig.json (#2089)Kitson Kelly
Use `--config`
2019-04-23Use tokio_threadpool's new panic_handler (#2188)Ryan Dahl
2019-04-14Fix silent error, add custom panic handler (#2098)Ryan Dahl
This is to work around Tokio's panic recovery feature. Ref https://github.com/tokio-rs/tokio/issues/495 Ref https://github.com/tokio-rs/tokio/issues/209 Ref https://github.com/denoland/deno/issues/1311 Fixes #2097
2019-04-11Improve op dispatch (#2088)andy finch
2019-04-09Silence clippy warnings and format source codeBert Belder
2019-04-09core: Rename Behavior to Dispatch (#2082)Ryan Dahl
And rename IsolateState to ThreadSafeState. Also make ThreadSafeState directly implement Dispatch. This is simpler.
2019-04-08Merge Worker and Isolate types (#2078)Ryan Dahl
Reduces generics.
2019-04-08core: snapshot improvements (#2052)Ryan Dahl
* Moves how snapshots are supplied to the Isolate. Previously they were given by Behavior::startup_data() but it was only called once at startup. It makes more sense (and simplifies Behavior) to pass it to the constructor of Isolate. * Adds new libdeno type deno_snapshot instead of overloading deno_buf. * Adds new libdeno method to delete snapshot deno_snapshot_delete(). * Renames deno_get_snapshot() to deno_snapshot_new(). * Makes StartupData hold references to snapshots. This was implicit when it previously held a deno_buf but is made explicit now. Note that include_bytes!() returns a &'static [u8] and we want to avoid copying that.
2019-04-05add compile_async (#2053)andy finch
2019-04-04Non-fatal compile_sync failures (#2039)andy finch
And model worker resources as Stream
2019-04-02cli: refactor compile_sync() for readabilityBert Belder
2019-04-02Clippy fixesBert Belder
2019-04-01Follow redirect location as new referrers for nested module imports (#2031)Kevin (Kun) "Kassimo" Qian
Fixes #1742 Fixes #2021
2019-04-01Add web worker JS API (#1993)andy finch
* Refactored the way worker polling is scheduled and errors are handled. * Share the worker future as a Shared
2019-03-30Rename crate deno_core to deno (#2022)Ryan Dahl
2019-03-28Merge the --recompile and --reload flags (#2003)Ryan Dahl
2019-03-28Clippy fixes (#2009)Bert Belder
2019-03-25Resolve callback moved from Behavior to mod_instantiate() (#1999)Ryan Dahl
This simplifies the Behavior trait and makes it more explicit where the resolve callback is being made. Also s/StartupScript/Script
2019-03-20Fix clippy errors and upgrade Rust to 1.33.0 in CI (#1945)Ryan Dahl
2019-03-19Separate behavior for the compiler isolate (#1973)andy finch
2019-03-19Remove old Buf definition in cli.rs (#1971)andy finch
2019-03-19Rename //src/ to //cli/ (#1962)Ryan Dahl
To better distinguish the deno_core crate from the executable deno, which will now be called "the cli" internally.