summaryrefslogtreecommitdiff
path: root/cli/tsc.rs
AgeCommit message (Collapse)Author
2020-09-08feat(unstable): enable isolatedModules by default (#7327)Luca Casonato
2020-09-07feat(info): Dependency count and sizes (#6786)KrisChambers
This commit changes "deno info" subcommand logic. - Modules are no longer loaded into V8 isolate - analysis is done using ModuleGraph. - Removed deno_core::Deps structure. - Modules are no longer type-checked and transpiled - "compiled" file is shown only if it is already available. - Added number of unique dependencies for root module. - Changed tree output: - file size is shown next to the dependency - repeated dependencies are marked with "*" - used less spaces in prefix to save terminal width
2020-09-06refactor(core): rename CoreIsolate to JsRuntime (#7373)Bartek Iwańczuk
deno_core/ - rename core_isolate.rs to runtime.rs - rename CoreIsolate to JsRuntime - rename JSError to JsError - rename JSStackFrame to JsStackFrame cli/ - update references from deno_core::CoreIsolate to deno_core::JsRuntime - rename deno_core::JSError to deno_core::JsError - rename fmt_errors::JSError to fmt_errors::JsError
2020-09-06Move JSON ops to deno_core (#7336)Bert Belder
2020-09-04fix: regex for TS refereces and deno-types (#7333)Bartek Iwańczuk
2020-09-03refactor: use dependency analyzer from SWC (#7334)Bartek Iwańczuk
2020-09-02fix: support missing features in --no-check (#7289)Bartek Iwańczuk
This commit adds "EmitTranspileOptions" to "transpile()" function, that allows to configure transpilation process based on the currently loaded "tsconfig.json".
2020-08-31refactor: Compiler config in Rust (#7228)Bartek Iwańczuk
* port tsc_config.rs * cleanup options * bring back allowNonTsExtension * try * fix test * fix test2 * move config for bundling * remove Transpile compile request * remove dead code * remove more dead code * remove checkJs regex * fix * handle config str for runtime APIs * lint * runtimeCompile config in Rust * runtimeCompile and runtimeTranspile config in Rust * fix * remove lint supression * upgrade: jsonc-parser 0.13.0 * remove unneeded to_string() * upgrade: jsonc-parser 0.14.0 * remove AsRef<str>
2020-08-26refactor: remove OpError, use ErrBox everywhere (#7187)Bert Belder
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2020-08-19refactor: move cli/doc/ to separate crate (#7103)Bartek Iwańczuk
2020-08-19Make Rc/Arc wrapper around State/GlobalState visible (#7104)Bert Belder
2020-08-03fix(cli): add support for non-UTF8 source files (#6789)Maayan Hanin
Fixes: #5542
2020-07-31upgrade: deno_lint, dprint, swc (#6928)Bartek Iwańczuk
This commit upgrades: deno_lint 0.1.20 dprint-plugin-typescript 0.25.0 swc_ecmascript 0.1.0 SWC is no longer reexported from dprint nor deno_lint.
2020-07-28refactor: Use SWC to strip types for "--no-check" flag (#6895)Bartek Iwańczuk
2020-07-28fix: downcast from SwcDiagnosticBuffer to OpError (#6909)Bartek Iwańczuk
2020-07-28chore: use matches macro for bool matches (#6904)Kitson Kelly
2020-07-23refactor: remove more compiler runtime code (#6841)Bartek Iwańczuk
2020-07-15fix: panic for runtime error in TS compiler (#6758)Bartek Iwańczuk
2020-07-11fix: harden pragma and reference parsing in module analysis (#6702)Bartek Iwańczuk
2020-07-11chore: upgrade deno_lint, remove direct dprint dep (#6679)Bartek Iwańczuk
This PR removes direct dependency on dprint-plugin-typescript and swc_ecma_visit. Both of these dependencies have been pushed out to deno_lint crate. This should make it a bit easier to do the upgrades and prevent having conflicting crate requirements.
2020-07-08feat: add --no-check option (#6456)Kitson Kelly
This commit adds a "--no-check" option to following subcommands: - "deno cache" - "deno info" - "deno run" - "deno test" The "--no-check" options allows to skip type checking step and instead directly transpiles TS sources to JS sources. This solution uses `ts.transpileModule()` API and is just an interim solution before implementing it fully in Rust.
2020-07-07feat: add lockfile support to bundle (#6624)Takahiko Inayama
2020-06-30refactor: Improvements to TsCompiler and its tests (#6576)Kitson Kelly
2020-06-29refactor: util functions take slices instead of heap values (#6547)Valentin Anger
2020-06-26'Compile' messages changed to 'Check' messages (#6504)Ryan Dahl
2020-06-26fix: Omit buildinfo when --reload passed (#6489)Kitson Kelly
2020-06-24Incremental compilation for TypeScript (#6428)Bartek Iwańczuk
This commit adds incremental compilation capabilities to internal TS compiler. Instead of using "ts.createProgram()" API for compilation step (during deno startup), "ts.createIncrementalProgram()" API is used instead. Thanks to TS' ".tsbuildinfo" file that already stores all necessary metadata for compilation I was able to remove our own invention that is ".graph" file. ".tsbuildinfo" file is stored alongside compiled source and is used to cache-bust outdated dependencies, facilitated by the "version" field. The value for "version" field is computed in Rust during loading of module graph and is basically a hash of the file contents. Please keep in mind that incremental compilation is only used for initial compilation (or dynamic imports compilation) - bundling and runtime compiler APIs haven't been changed at all. Due to problems with source map I changed compilation settings to inline source map (inlineSourceMap instead of sourceMap).
2020-06-24Add ability to output compiler performance information (#6434)Kitson Kelly
2020-06-19refactor(compiler): split code paths for compile and bundle (#6304)Bartek Iwańczuk
* refactor "compile" and "runtimeCompile" in "compiler.ts" and factor out separate methods for "compile" and "bundle" operations * remove noisy debug output from "compiler.ts" * provide "Serialize" implementations for enums in "msg.rs" * rename "analyze_dependencies_and_references" to "pre_process_file" and move it to "tsc.rs" * refactor ModuleGraph to use more concrete types and properly annotate locations where errors occur * remove dead code from "file_fetcher.rs" - "SourceFile.types_url" is no longer needed, as type reference parsing is done in "ModuleGraph" * remove unneeded field "source_path" from ".meta" files stored for compiled source file (towards #6080)
2020-06-10fix: several regressions in TS compiler (#6177)Bartek Iwańczuk
This commit fixes several regressions in TS compiler: * double compilation of same module during same process run * compilation of JavaScript entry point with non-JS imports * unexpected skip of emit during compilation Additional checks were added to ensure "allowJs" setting is used in TS compiler if JavaScript has non-JS dependencies.
2020-06-05ci: upgrade to Rust 1.44.0 (#6113)Bert Belder
2020-05-29refactor: TS compiler and module graph (#5817)Bartek Iwańczuk
This PR addresses many problems with module graph loading introduced in #5029, as well as many long standing issues. "ModuleGraphLoader" has been wired to "ModuleLoader" implemented on "State" - that means that dependency analysis and fetching is done before spinning up TS compiler worker. Basic dependency tracking for TS compilation has been implemented. Errors caused by import statements are now annotated with import location. Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
2020-05-22fix: SWC lexer settings and silent errors (#5752)Bartek Iwańczuk
This commit changes how error occurring in SWC are handled. Changed lexer settings to properly handle TS decorators. Changed output of SWC error to annotate with position in file.
2020-05-22fix: ts type imports (#5733)Bartek Iwańczuk
2020-05-20refactor: reorganize TS compiler (#5603)Bartek Iwańczuk
2020-05-18refactor: rewrite TS dependency analysis in Rust (#5029)Bartek Iwańczuk
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-17Return error if more than one listener calls `WorkerHandle::get_event()` (#5461)Yiyu Lin
2020-05-16tsc: use serde to (de)serialize CompiledFileMetadata (#5481)Yiyu Lin
Co-authored-by: Bert Belder <bertbelder@gmail.com>
2020-05-16Fix a bunch of spelling errors (#5314)Bert Belder
2020-05-13Make --inspect-brk pause on the first line of _user_ code (#5250)Bert Belder
2020-05-12fix: source maps in inspector for local files (#5245)Bartek Iwańczuk
This commit changes handling of source maps by setting proper file URLs for "file" and "sources" fields in the source map.
2020-05-11fix: source maps in inspector (#5223)Bartek Iwańczuk
This commit fixes problems with source maps in Chrome Devtools by substituting source map URL generated by TS compiler with actual file URL pointing to DENO_DIR. Dummy value of "source_map_url" has been removed from "ScriptOrigin". Also fixes lock file which used compiled source code to generate lock hash; it now uses source code of the file that is being compiled.
2020-05-11refactor: check permissions in SourceFileFetcher (#5011)Bartek Iwańczuk
This PR hot-fixes permission escapes in dynamic imports, workers and runtime compiler APIs. "permissions" parameter was added to public APIs of SourceFileFetcher and appropriate permission checks are performed during loading of local and remote files.
2020-05-08refactor: Remove cli::compilers module (#5138)Bartek Iwańczuk
This PR removes "cli/compilers/" directory. "cli/compilers/ts.rs" has been renamed to "cli/tsc.rs"