mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 19:08:15 +00:00
refactor(cli): remove ProcState - add CliFactory (#18900)
This removes `ProcState` and replaces it with a new `CliFactory` which initializes our "service structs" on demand. This isn't a performance improvement at the moment for `deno run`, but might unlock performance improvements in the future.
This commit is contained in:
parent
30628288ce
commit
9efed4c7a3
32 changed files with 1140 additions and 725 deletions
|
@ -19,7 +19,6 @@ use crate::args::TsConfigType;
|
|||
use crate::args::TsTypeLib;
|
||||
use crate::args::TypeCheckMode;
|
||||
use crate::cache::Caches;
|
||||
use crate::cache::DenoDir;
|
||||
use crate::cache::FastInsecureHasher;
|
||||
use crate::cache::TypeCheckCache;
|
||||
use crate::npm::CliNpmResolver;
|
||||
|
@ -39,7 +38,6 @@ pub struct CheckOptions {
|
|||
}
|
||||
|
||||
pub struct TypeChecker {
|
||||
deno_dir: DenoDir,
|
||||
caches: Arc<Caches>,
|
||||
cli_options: Arc<CliOptions>,
|
||||
node_resolver: Arc<NodeResolver>,
|
||||
|
@ -48,14 +46,12 @@ pub struct TypeChecker {
|
|||
|
||||
impl TypeChecker {
|
||||
pub fn new(
|
||||
deno_dir: DenoDir,
|
||||
caches: Arc<Caches>,
|
||||
cli_options: Arc<CliOptions>,
|
||||
node_resolver: Arc<NodeResolver>,
|
||||
npm_resolver: Arc<CliNpmResolver>,
|
||||
) -> Self {
|
||||
Self {
|
||||
deno_dir,
|
||||
caches,
|
||||
cli_options,
|
||||
node_resolver,
|
||||
|
@ -95,8 +91,7 @@ impl TypeChecker {
|
|||
let ts_config = ts_config_result.ts_config;
|
||||
let type_check_mode = self.cli_options.type_check_mode();
|
||||
let debug = self.cli_options.log_level() == Some(log::Level::Debug);
|
||||
let cache =
|
||||
TypeCheckCache::new(self.caches.type_checking_cache_db(&self.deno_dir));
|
||||
let cache = TypeCheckCache::new(self.caches.type_checking_cache_db());
|
||||
let check_js = ts_config.get_check_js();
|
||||
let check_hash = match get_check_hash(&graph, type_check_mode, &ts_config) {
|
||||
CheckHashResult::NoFiles => return Ok(()),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue