summaryrefslogtreecommitdiff
path: root/cli/module_graph.rs
AgeCommit message (Collapse)Author
2020-11-10fix(cli): allow root modules be .mjs/.cjs (#8310)Kitson Kelly
Fixes #6176
2020-11-10fix(cli): allow declaration emits for Deno.compile() (#8303)Kitson Kelly
Fixes #8289
2020-11-09fix(cli): do not write tsbuildinfo when diagnostics are emitted (#8311)Kitson Kelly
Fixes #8309
2020-11-08upgrade: deno_doc, deno_lint, dprint, swc (#8292)Bartek Iwańczuk
2020-11-08fix(cli): ensure that transitory dependencies are emitted (#8275)Kitson Kelly
Fixes #8111
2020-11-07fix(cli): allow remapping to locals for import map (#8262)Kitson Kelly
Fixes #7723
2020-11-07fix(cli): properly handle type checking root modules with type defini… (#8263)Kitson Kelly
2020-11-06fix(cli): correct libs sent to tsc for unstable worker (#8260)Kitson Kelly
Fixes #8257
2020-11-03refactor(cli): cleanup compiler snapshot and tsc/module_graph (#8220)Kitson Kelly
2020-11-02refactor(cli): migrate runtime compile/bundle to new infrastructure (#8192)Kitson Kelly
Fixes #8060
2020-10-14refactor(cli): add tsc2 (#7942)Kitson Kelly
Ref #7225
2020-10-13refactor(cli): rename GlobalState to ProgramState (#7914)Bartek Iwańczuk
2020-10-12chore(cli): remove dead code (#7941)Kitson Kelly
2020-10-07refactor(cli): remove TextDocument (#7850)Kitson Kelly
2020-09-21refactor: use futures and serde_json from deno_core (#7614)Bartek Iwańczuk
2020-09-15cli/msg.rs -> cli/media_type.rsRyan Dahl
2020-09-15refactor: use the 'anyhow' crate instead of 'ErrBox' (#7476)Bert Belder
2020-09-14refactor: use ParsedModule and improve MediaTypes enum (#7456)Kitson Kelly
2020-09-12Revert "feat(unstable): Support data: urls (#5157)" (#7432)Bartek Iwańczuk
This reverts commit e3319f34a6ece36eab3138eae83c8d0e18fcc07c.
2020-09-11feat(unstable): Support data: urls (#5157)Valentin Anger
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-06Move JSON ops to deno_core (#7336)Bert Belder
2020-08-26Remove some more unnecessary 'to_string()' calls (#7190)Bert Belder
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-10Remove unnecessary drop calls (#7007)Ryan Dahl
2020-08-03fix(cli): add support for non-UTF8 source files (#6789)Maayan Hanin
Fixes: #5542
2020-06-29refactor: util functions take slices instead of heap values (#6547)Valentin Anger
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-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-18chore(test): move testing utilities to test_util crate (#6360)Bartek Iwańczuk
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-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-26fix: parsing of JSX and TSX in SWC (#5870)Bartek Iwańczuk
2020-05-23fix: TSX analysis in module graph loader (#5785)Bartek Iwańczuk
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: redirects handling in module analysis (#5726)Bartek Iwańczuk
This commit fixes a bug introduced in #5029 that caused bad handling of redirects during module analysis. Also ensured that duplicate modules are not downloaded.
2020-05-21fix: disallow http imports for modules loaded over https (#5680)Bartek Iwańczuk
2020-05-20refactor: reorganize TS compiler (#5603)Bartek Iwańczuk
2020-05-18fix: disable test using 019_media_types (#5589)Bartek Iwańczuk
This commit disabled flaky test in cli/module_graph.rs. The test uses 019_media_types.ts which was known to be flaky for some time. Test should be reenabled once test HTTP server is rewritten to Rust.
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