summaryrefslogtreecommitdiff
path: root/js/compiler.ts
AgeCommit message (Collapse)Author
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
2018-12-06Process source maps in Rust instead of JS (#1280)Ryan Dahl
- Improves speed and binary size significantly. - Makes deno_last_exception() output a JSON structure. - Isolate::execute and Isolate::event_loop now return structured, mapped JSError objects on errors. - Removes libdeno functions: libdeno.setGlobalErrorHandler() libdeno.setPromiseRejectHandler() libdeno.setPromiseErrorExaminer() In collaboration with Ryan Dahl.
2018-11-30Upgrade Prettier to support BigInt syntax in TSRyan Dahl
2018-11-20Split Runner from CompilerKitson Kelly
2018-11-09Ensure global type instances are available.Kitson Kelly
2018-11-06Improve preparing stack tracesKitson Kelly
2018-11-05Decode main.js.map during snapshotting.Ryan Dahl
Pro: time ./out/debug/deno tests/error_001.ts 3.0s -> 0.4s Con: time ./tool/build.py snapshot 33s -> 1m52s out/debug/gen/snapshot_deno.bin 39M -> 121M
2018-11-01Fix performance regression with JSON ModulesKitson Kelly
2018-10-30Add ability to load JSON as modules (#1065)Kitson Kelly
2018-10-29Separate source map from output code.Kitson Kelly
2018-10-24Support CheckJSKitson Kelly
2018-10-23Revert "Support CheckJS"Ryan Dahl
Broken in master. This reverts commit dd230d520b5599c0e51cf30245a567f07b3cfb28.
2018-10-23Support CheckJSKitson Kelly
2018-10-23Enforce media typesKitson Kelly
2018-10-14Align JSDoc to style guide.Kitson Kelly
2018-10-11Replace globals.d.ts with lib.deno_runtime.d.tsKitson Kelly
2018-10-05Hide compiler module (#909)Kitson Kelly
Fixes #876