-
Notifications
You must be signed in to change notification settings - Fork 48
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
Native File System API #28
Comments
Aha! Yes, I'm super excited about this. The current blocker is currently File handles cannot be serialized. This means they can't be sent to a Worker thread via As soon as Chrome lands support for serializing them, I'm going to revive that branch and finish it. The other nice thing we'll be able to do is save the file handles in IndexedDb so you won't have to prompt the user with a permissions UX every time they re-open the page. |
I am currently working on a project https://github.com/0xGG/vscode-pwa and I implemented two file system providers for the vscode running on the web: One uses lightning-fs for constructing the memfs; the other one was handwritten using the native file system api. https://github.com/0xGG/vscode-pwa also uses isomorphic-git for managing git repos. It would be great if lighting-fs can support native file system so I could better refactor my code 👍 Thanks for the awesome project! |
@wmhilton any updates/progress on the native branch? |
As a rudimentary solution, you can load the files manually via the File System API into LightingFS with a simple function like this one: async function loadFiles(fs, folder, path = "/") {
for await (const entry of folder.values()) {
if (entry.kind === "file") {
// Create the file
await fs.promises.writeFile(path + entry.name, await entry.getFile());
}
if (entry.kind === "directory") {
// Create the folder, then run on all files within
await fs.promises.mkdir(path + entry.name)
await convertFolder(entry, setRows, path + entry.name + "/");
}
} |
Hey. I see that some work was already done in https://github.com/isomorphic-git/lightning-fs/tree/feat/native. What is the timeline for this and what are the current blockers?
For reference: https://www.chromestatus.com/feature/6284708426022912.
The text was updated successfully, but these errors were encountered: