-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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: do not use deno_fs::FileSystem
everywhere
#27508
Conversation
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 is so verbose because we don't have conditional compilation for denort (see the todo on line 3). We can improve this over time.
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.
sys_traits offers an in-memory system, so we can just delete this now.
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.
I'd like to switch the FileSystem trait back to a type parameter, but first we should split up deno and denort so they're compiled separately.
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.
Let's discuss this offline
@@ -1,12 +1,13 @@ | |||
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. | |||
|
|||
use crate::sys::CliSys; |
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.
Shouldn't this one be under all the other imports? 😏
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.
Let's merge that other fmt pr 😅
I'll rebase it in a few minutes.
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.
Let's discuss this offline
// todo(dsherret): this is temporary. Instead of using the `FileSystem` trait implementation | ||
// in the CLI, the CLI should instead create it's own file system using `sys_traits` traits | ||
// then that can implement the `FileSystem` trait. Then this `FileSystem` trait can stay here | ||
// for use only for `ext/fs` and not the entire CLI. | ||
#[derive(Debug, Clone)] | ||
pub struct FsSysTraitsAdapter(pub FileSystemRc); |
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.
Looks like deno_core
is not upgraded in this PR, not needed anymore?
This changes the cli to mostly use
std::fs
viasys_traits
instead of the implemention ofdeno_fs::FileSystem
.This has two benefits:
deno_fs
crate.deno_fs
file system abstraction anymore, which does a lot of extra work for things like stat and reading directories.Closes #27464