summaryrefslogtreecommitdiff
path: root/js/compiler.ts
AgeCommit message (Collapse)Author
2019-10-04Merge deno_cli_snapshots into deno_cli (#3064)Ryan Dahl
2019-10-03Async compiler processing (#3043)Kitson Kelly
Basically this does pre-processing of TypeScript files and gathers all the dependencies asynchronously. Only then after all the dependencies are gathered, does it do a compile, which at that point all the dependencies are cached in memory in the compiler, so with the exception of the hard coded assets, there are no ops during the compilation. Because op_fetch_source_files is now handled asynchronously in the runtime, we can eliminate the tokio_util::block_on() which was causing the increase in threads. Benchmarking on my machine has shown about a 5% improvement in speed when dealing with compiling TypeScript. Still a long way to go, but an improvement. In theory the module name resolution and the fetching of the source files could be broken out as two different ops. This would prevent situations of sending the full source file all the time when actually the module is the same module referenced by multiple modules, but that could be done subsequently to this.
2019-10-02feat: JSX Support (#3038)Yusuke Sakurai
2019-09-30Support top-level-await in TypeScript (#3024)Ryan Dahl
2019-09-14feat: parallelize downloads from TS compiler (#2949)Bartek Iwańczuk
2019-09-12deno_typescript cleanup/improvements (#2901)Kitson Kelly
2019-09-07Update @typescript-eslint/* to v2.1.0 (#2878)Yoshiya Hinosawa
2019-09-02Refactor snapshot build (#2825)Ryan Dahl
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-08-30Remove ts_library_builder, maintain lib.deno_runtime.d.ts by hand (#2827)Ryan Dahl
2019-08-26Remove flatbuffers (#2818)Ryan Dahl
2019-08-26Port readSync/writeSync ops to minimalRyan Dahl
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-26bring back json ops (#2815)Bartek Iwańczuk
2019-08-24Revert json ops (#2814)Ryan Dahl
* Revert "port more ops to JSON (#2809)" This reverts commit 137f33733d365026903d40e7cde6e34ac6c36dcf. * Revert "port ops to JSON: compiler, errors, fetch, files (#2804)" This reverts commit 79f82cf10ed1dbf91346994250d7311a4d74377a. * Revert "Port rest of os ops to JSON (#2802)" This reverts commit 5b2baa5c990fbeae747e952c5dcd7a5369e950b1.
2019-08-24port ops to JSON: compiler, errors, fetch, files (#2804)Bartek Iwańczuk
2019-08-22Support .d.ts files (#2746)Kitson Kelly
Fixes #1432
2019-08-21Organize dispatch a bit (#2796)Ryan Dahl
Just some clean up reorganization around flatbuffer/minimal dispatch code. This is prep for adding a JSON dispatcher.
2019-08-05Provide option to delete Deno namespace in worker (#2717)Kevin (Kun) "Kassimo" Qian
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-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-06-08Add 'bundle' subcommand. (#2467)Kitson Kelly
2019-06-04Handle compiler diagnostics in Rust (#2445)Kitson Kelly
2019-06-03Compiler exit before emit if preEmitDiagnostics found (#2441)Ryan Dahl
2019-06-01Upgrade TypeScript to 3.5.1 (#2437)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-21Fix eslint warnings (#2151)Ryan Dahl
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com> Co-authored-by: LE GOFF Vincent <g_n_s@hotmail.fr>
2019-04-08Merge Worker and Isolate types (#2078)Ryan Dahl
Reduces generics.
2019-04-04Non-fatal compile_sync failures (#2039)andy finch
And model worker resources as Stream
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-30Move //libdeno to //core/libdeno (#2015)Ryan Dahl
Fixes some sed errors introduced in c43cfe. Unfortunately moving libdeno required splitting build.rs into two parts, one for cli and one for core. I've also removed the arm64 build - it's complicating things at this re-org and we're not even testing it. I need to swing back to it and get tools/test.py running for it.
2019-03-26namespace reorg: libdeno and DenoCore to Deno.core (#1998)Kitson Kelly
2019-03-09Migrate from tslint to eslint for linting (#1905)Kitson Kelly
2019-03-07Remove 'deno' builtin module (#1895)Kitson Kelly
2019-02-19remove global_eval.ts (#1813)Yoshiya Hinosawa
2019-02-18Rationalise compiler ops (#1740)Kitson Kelly
2019-02-15Fix behavior for extensionless files with .mime file (#1779)Kevin (Kun) "Kassimo" Qian
2019-02-10Rationalise startup for compiler/main (#1737)Kitson Kelly
2019-02-10Respect NO_COLOR in TypeScript output (#1736)Bartek Iwańczuk
2019-02-10Set globals on compiler startup (#1735)Bartek Iwańczuk
2019-02-02Compiler cleanups and minor improvements (#1656)Kitson Kelly
2019-01-28Split out compiler snapshot (#1566)Kitson Kelly
Speeds up startup time, reduces runtime heap size.
2019-01-14Fix JSON Modules (#1514)Kitson Kelly
2019-01-13Cleanup compiler and re-enable tests (#1512)Kitson Kelly
2019-01-09Native ES modules (#1460)Ryan Dahl
* Native ES modules This is a major refactor of internal compiler. Before: JS and TS both were sent through the typescript compiler where their imports were parsed and handled. Both compiled to AMD JS and finally sent to V8 Now: JS is sent directly into V8. TS is sent through the typescript compiler, but tsc generates ES modules now instead of AMD. This generated JS is then dumped into V8. This should much faster for pure JS code. It may improve TS compilation speed. In the future this allows us to separate TS out of the runtime heap and into its own dedicated snapshot. This will result in a smaller runtime heap, and thus should be faster. Some tests were unfortunately disabled to ease landing this patch: 1. compiler_tests.ts which I intend to bring back in later commits. 2. Some text_encoding_test.ts tests which made the file invalid utf8. See PR for a discussion. Also worth noting that this is necessary to support WASM
2019-01-06Revert "Split Runner from Compiler" (#1462)Ryan Dahl
This reverts commit 3d03f5b0cb3c513e449f3aaa5d35c493b72f47b4.
2019-01-03Revert "use byte array instead of string for code fetch (#1307)" (#1455)Ryan Dahl
This reverts commit e976b3e0414dc768624b77e431ee7f55b03b76a4. There is nothing technically wrong with this commit, but it's adding complexity to a big refactor (native ES modules #975). Since it's not necessary and simply a philosophical preference, I will revert for now and try to bring it back later.
2019-01-03Remove assertion for empty modules (#1450)Satya Rohith
2019-01-02Happy new year!Ryan Dahl
2018-12-12use byte array instead of string for code fetch (#1307)F001