zardoy/prismarine-web-client

Do you want to work on this issue?

You can request for a bounty in order to promote it!

BrowserFS → ZenFS #113

dr-vortex posted onGitHub

Hey @zardoy, I've been going through the dependents of browserfs and found this repository.

As you already know, browserfs is deprecated and I am working on ZenFS.

Would you be interested in updating migrating to ZenFS?


I was already experimenting with ZenFS in a separate project since I was running some issues: eg IOS crashing the page when trying to load big files (~400 MB zips). Also need to update internal patching so I can track all read / write operations, redirect or disable them as needed.

Would you be interested in updating and migrating to ZenFS?

Yes, of course!

posted by zardoy 10 months ago

Also need to update internal patching so I can track all read / write operations

I plan on adding some event system to the ZenFS internals as part of the FS watch features, though it wouldn't allow for changing the operations.

If you want to change operations it may be better to write a class that extends ZipFS and then intercept the operations using that.

posted by dr-vortex 10 months ago

If you want to change operations it may be better to write a class that extends ZipFS and then intercept the operations using that.

Thanks, will try it, though I also plan to use remote HTTP and WebAccess backends (already using the last one for writing files back to the user's selected folder). Currently, I'm just overwriting FS methods so it was easy to patch for me the internals...

posted by zardoy 10 months ago

Sorry, the suggestion to migrate to newer versions is great, but I've just realized I'll not have any time to work on it :( (just because everything works fine with the old version), but I'm definitely looking into migration for smaller codebase

posted by zardoy 10 months ago

@zardoy,

Thanks for the update.

Adding events and the FS watch features is currently my top priority, though I've been busy with classes IRL.

I'll see if I can make some time this week and get this done. Sorry for taking so long.

posted by james-pre 7 months ago

Adding events and the FS watch features is currently my top priority, though I've been busy with classes IRL.

I'll see if I can make some time this week and get this done. Sorry for taking so long.

Hey, @james-pre how are doing, still have a hope you work on the project 🙌

posted by zardoy 4 months ago

@zardoy, it's all implemented, though events and watch features are handled entirely in the emulation layer. 1.0 has been out for almost a whole month now, and a ton of features have been added.

posted by james-pre 4 months ago

it's all implemented, though events and watch features are handled entirely in the emulation layer

That's all is very interesting, though as I said earlier I don't need events, but interceptors (like spy-fs) so I can extend the functionality of fs. Also looking forward to ZipFS update!

posted by zardoy 4 months ago

Actually, if my project used ZenFS, I think it would significantly boost your visibility!

posted by zardoy 4 months ago

I don't need events, but interceptors (like spy-fs) so I can extend the functionality of fs.

It will be much easier to create your own backend, or to reuse an exiting one. For example, you could implement RPC.Port:


class MyPort implements RPC.Port {
    _listener;

    constructor(public postMessage: (typeof RPC.Port)['postMessage']) {}

    public emit(value) {
        this._listener?.(value);
    }
    public on(_event, listener) {
        this._listener = listener;
    }
    public off() {
        this._listener = null;
    }
}


const back = new MyPort((value) => front._listener(value));

const front = new MyPort((value) => {
    if (!RPC.isMessage(value)) return;

    // Do something

    const newValue = value; // pretend something got changed

    back._listener(newValue);
});

const interceptedFS = InMemory.create({ name: 'example' });

attachFS(back, interceptedFS);

await configure({
    mounts: {
        '/': { backend: Port, port: front },
    },
});

Also looking forward to ZipFS update!

Could you please clarify what exactly you're talking about? A lot of stuff has happened over the past few months...

posted by james-pre 4 months ago

Fund this Issue

$0.00
Funded
Only logged in users can fund an issue

Pull requests