Skip to content
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

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

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(),
Copy link
Member Author

@dsherret dsherret Dec 27, 2024

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>(
Copy link
Member Author

@dsherret dsherret Dec 27, 2024

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.

@ry
Copy link
Member

ry commented Dec 27, 2024

Is there an impact on binary size?

@dsherret
Copy link
Member Author

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",
Copy link
Member Author

@dsherret dsherret Dec 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

denoland/deno_doc#684

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.

Copy link
Member Author

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.

@dsherret dsherret requested a review from bartlomieju December 27, 2024 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants