summaryrefslogtreecommitdiff
path: root/cli/file_fetcher.rs
AgeCommit message (Collapse)Author
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-06Move JSON ops to deno_core (#7336)Bert Belder
2020-08-26refactor: remove OpError, use ErrBox everywhere (#7187)Bert Belder
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
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-07-23Rename cli/js2 to cli/rt (#6857)Ryan Dahl
2020-07-19Port internal TS code to JS (#6793)Bartek Iwańczuk
Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
2020-06-29refactor: util functions take slices instead of heap values (#6547)Valentin Anger
2020-06-24Clean up some fetch_remote_source tets (#6446)Ryan Dahl
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-15fix(cache): apply redirection limit for cached files (#6308)Bartek Iwańczuk
2020-06-13Move to allowlist and blocklist (#6282)Luca Casonato
2020-06-10fix: handle @deno-types in export {} (#6202)Bartek Iwańczuk
* fix: handle @deno-types in export {} * lint * fix tests * fmt * fix test
2020-05-31fix: media type for .cjs and application/node (#6005)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-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-07fix(imports): fix panic on unsupported scheme (#5131)Bartek Iwańczuk
2020-05-07fix(deno_dir): better error message (#5120)Yoshiya Hinosawa
Add better error messages when a cache subdirectory in `DENO_DIR` cannot be created.
2020-04-15remove calls to futures::executor::block_on (#4760)Bartek Iwańczuk
2020-04-03clippy (#4618)Kitson Kelly
2020-03-10Add global "quiet" flag (#4135)Florian Häglsperger
2020-03-06Add content type for wasm, fix encoding in wasm test fixture (#4269)Aurélien Bertron
2020-02-28http_cache: change .headers.json to .metadata.json (#4175)Ryan Dahl
Add original URL to metadata. This is so the VS Code Plugin can reverse look up the URL for cache entries. Ref #4069.
2020-02-28Support TypeScript eval through `deno eval -T` flag (#4141)Kevin (Kun) "Kassimo" Qian
2020-02-28fetch_cached_remote_source support redirect URL without base (#4099)Kevin (Kun) "Kassimo" Qian
2020-02-25Remove _async from method names since _sync are gone (#4128)Ryan Dahl
2020-02-23refactor: use OpError instead of ErrBox for errors in ops (#4058)Bartek Iwańczuk
To better reflect changes in error types in JS from #3662 this PR changes default error type used in ops from "ErrBox" to "OpError". "OpError" is a type that can be sent over to JSON; it has all information needed to construct error in JavaScript. That made "GetErrorKind" trait useless and so it was removed altogether. To provide compatibility with previous use of "ErrBox" an implementation of "From<ErrBox> for OpError" was added, however, it is an escape hatch and ops implementors should strive to use "OpError" directly.
2020-02-21refactor: remove unneeded ErrorKinds (#3936)Bartek Iwańczuk
2020-02-19refactor: rewrite file_fetcher to use async fns, lift blocking call (#4037)Bartek Iwańczuk
2020-02-19refactor: rewrite HTTP cache for file fetcher (#4030)Bartek Iwańczuk
2020-02-19Support loading additional TS lib files (#3863)Kitson Kelly
Fixes #3726 This PR provides support for referencing other lib files (like lib.dom.d.ts that are not used by default in Deno.
2020-02-18refactor: cleanup cli/lib.rs (#4006)Bartek Iwańczuk
* rename methods on Worker related to module loading * reorganize cli/lib.rs * remove cli/progress.rs and cli/shell.rs
2020-02-17feat: add --cert flag for http client (#3972)geoFlux
2020-02-12fix: Correctly determine a --cached-only error (#3979)Nayeem Rahman
2020-02-04Do not encode files loaded from network as utf8 (#3856)Tilman Roeder
2020-02-03Use tokio::test for some of cli's unit tests (#3868)Ryan Dahl
2020-02-02Remove //tests symlink (#3849)Luka Hartwig
2020-01-26Improve support of type definitions (#3755)Kitson Kelly
2020-01-26fix clippy warnings (#3798)Ben Noordhuis
2020-01-24Do not panic and improve error message on cache failure (#3784)Kevin (Kun) "Kassimo" Qian
2020-01-20refactor: reduce number of ErrorKind variants (#3662)Bartek Iwańczuk
2020-01-16perf: share http client in file fetcher (#3683)Bartek Iwańczuk
2020-01-11Add gzip, brotli and ETag support for file fetcher (#3597)EnokMan
2020-01-05Rename crates: 'deno' to 'deno_core' and 'deno_cli' to 'deno' (#3600)Ry Dahl