-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add a Tauri/WASM filesystem #104
base: main
Are you sure you want to change the base?
Conversation
Vite does not type check in dev mode, only in build mode.
I implemented a file system API for Tauri that lets us access and modify arbitrary parts of the file system, instead of the limited scope that the `tauri.fs` provides us. This involved exposing much of Rust's `std::io` via the `tauri::command` proc macro, and then reading these functions into the TS side. Also, I created the function definitions for the WASM side's filesystem, but I haven't implemented it yet because I don't totally understand browser local storage works in WASM.
Currently, our file system function to read a directory fails to inform the front-end whether a path leads to a file or a directory. As such, I have added a boolean to each output with this information. Also, renamed copy to copy_file for consistency, clarity, and compatibility with the initial interface.
# Conflicts: # src/components/Code.jsx
# Conflicts: # package.json # src/components/Code.jsx # src/rust_functions.ts # tailwind.config.js # tsconfig.json
It turns out you can use multiple handler invokers, so I combined them into one big handler.
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.
After file_system.ts
was renamed to tauri_file_system.ts
, it is now the case that the WASM file system depends on a Tauri file system module. Please create an issue to move the FileSystem
interface into a file_system.ts
file and commit the changes
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 don't understand much of the front end React stuff, but the "back end" stuff looks good
(This is basically what I've been working on the entire semester, getting a filesystem implementation working).
Filesystem support
The filesystem does not actually work with the editor yet, although that's a future plan.