-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
refactor: use sys_traits #27480
base: main
Are you sure you want to change the base?
refactor: use sys_traits #27480
Conversation
@@ -91,8 +92,9 @@ impl CliLockfile { | |||
// do an atomic write to reduce the chance of multiple deno | |||
// processes corrupting the file | |||
atomic_write_file_with_retries( | |||
&FsSysTraitsAdapter::new_real(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This FsSysTraitsAdapter
is an adapter for the traits in sys_traits
and deno_fs::FileSystem
. It's temporary though. After this PR, I'll decouple the CLI crate's code from deno_fs
as that makes extracting code from the CLI crate a lot easier.
@@ -8,62 +8,6 @@ use deno_semver::jsr::JsrDepPackageReq; | |||
use deno_semver::jsr::JsrPackageReqReference; | |||
use deno_semver::npm::NpmPackageReqReference; | |||
|
|||
#[cfg(test)] // happens to only be used by the tests at the moment | |||
pub struct DenoConfigFsAdapter<'a>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The benefit of sys_traits
is that we can remove all these adapter and fs implementation structs. It makes setup code a lot easier for people using our crates.
Is there an impact on binary size? |
Doubt it. Maybe a very tiny reduction. |
@@ -1274,7 +1275,7 @@ dependencies = [ | |||
"deno_npm", | |||
"deno_npm_cache", | |||
"deno_package_json", | |||
"deno_path_util", | |||
"deno_path_util 0.3.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But I think this is ok to land without because this is a really small dependency -- Will update this pr with that in a bit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was actually too big of a change in deno_doc for me to do the upgrade. We'll have to do that later.
A follow-up to this will be decoupling the CLI from ext/fs's FileSystem trait.