-
-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat!: generic fs cache type Resolver = ResolverGeneric<FsCache<FileSystemOs>>
#358
Conversation
CodSpeed Performance ReportMerging #358 will not alter performanceComparing Summary
|
I can start integrating with Oxc and Rolldown once test passes. |
What do you think about making |
Btw, I've come pretty far implementing a cache for Biome based on this PR, but it looks like I do need |
253a58c
to
590ff5f
Compare
A package.json + tsconfig.json trait is inevitable, let's do it! |
I've successfully tested this change in oxc and Rolldown, let's merge after CI passes! |
Pushed a fix that I think will turn the Windows build green. |
type Resolver = ResolverGeneric<FsCache<FileSystemOs>>
Thank you so much for working on this! |
## 🤖 New release * `oxc_resolver`: 3.0.3 -> 4.0.0 (⚠️ API breaking changes) ###⚠️ `oxc_resolver` breaking changes ``` --- failure inherent_method_missing: pub method removed or renamed --- Description: A publicly-visible method or associated fn is no longer available under its prior name. It may have been renamed or removed entirely. ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.37.0/src/lints/inherent_method_missing.ron Failed in: ResolverGeneric::new_with_file_system, previously in file /tmp/.tmpKVx03E/oxc_resolver/src/lib.rs:138 --- failure struct_missing: pub struct removed or renamed --- Description: A publicly-visible struct cannot be imported by its prior path. A `pub use` may have been removed, or the struct itself may have been renamed or removed entirely. ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.37.0/src/lints/struct_missing.ron Failed in: struct oxc_resolver::PackageJson, previously in file /tmp/.tmpKVx03E/oxc_resolver/src/package_json.rs:14 ``` <details><summary><i><b>Changelog</b></i></summary><p> <blockquote> ## [4.0.0](oxc_resolver-v3.0.3...oxc_resolver-v4.0.0) - 2025-01-20 ### <!-- 0 -->Features - [**breaking**] generic fs cache `type Resolver = ResolverGeneric<FsCache<FileSystemOs>>` (#358) ### <!-- 2 -->Performance - use papaya instead of dashmap (#356) </blockquote> </p></details> --- This PR was generated with [release-plz](https://github.com/release-plz/release-plz/).
This PR makes the cache fully generic by introducing a
Cache
trait, and renaming the existingCache
toFsCache
.The
FileSystem
trait still exists, but is only relevant still for users ofFsCache
. 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 becomeResolverGeneric::new_with_cache(Arc::new(FsCache::new(fs)), ...)
.Both
FsCache
andFileSystem
are now behind afs_cache
feature flag, which is enabled by default.I am actually considering to make both the
PackageJson
andTsConfig
types generic as well (Biome already has its own, which ideally we would use directly for our customCache
implementation). This should be achievable by introducing traits for them and adding them as associated types to theCache
trait. But before going too deep, I was hoping to first get feedback on the work so far :)