Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: generic fs cache `type Resolver = ResolverGeneric<FsCache<File…
…SystemOs>>` (#358) This PR makes the cache fully generic by introducing a `Cache` trait, and renaming the existing `Cache` to `FsCache`. The `FileSystem` trait still exists, but is only relevant still for users of `FsCache`. By keeping the trait, I hope to minimize the amount of breaking changes, even though some still remain. The most notable breaking change is that `ResolverGeneric::new_with_file_system(fs, ...)` has become `ResolverGeneric::new_with_cache(Arc::new(FsCache::new(fs)), ...)`. Both `FsCache` and `FileSystem` are now behind a `fs_cache` feature flag, which is enabled by default. I am actually considering to make both the `PackageJson` and `TsConfig` types generic as well (Biome already has its own, which ideally we would use directly for our custom `Cache` implementation). This should be achievable by introducing traits for them and adding them as associated types to the `Cache` trait. But before going too deep, I was hoping to first get feedback on the work so far :)
- Loading branch information