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

Add a Tauri/WASM filesystem #104

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

Add a Tauri/WASM filesystem #104

wants to merge 26 commits into from

Conversation

PythonCoderAS
Copy link
Collaborator

(This is basically what I've been working on the entire semester, getting a filesystem implementation working).

Filesystem support

  • Works on both Tauri and WASM
  • Supports opening/saving projects

The filesystem does not actually work with the editor yet, although that's a future plan.

PythonCoderAS and others added 23 commits June 4, 2024 17:21
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:
#	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.
Copy link
Collaborator

@AleksBekker AleksBekker left a 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

Copy link
Collaborator

@AleksBekker AleksBekker left a 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

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