I made a sample app to see what it’s like to integrate with Fission.
In sharing my observations here, I don’t mean to be overly critical: this is just the delta between what is normal for me with remoteStorage and the ‘extra’ that webnative requires. I tested on the latest Chrome and Firefox via macOS.
- Using the app offline appears to have some quirks.
- If I turn off Wi-Fi, sometimes data doesn’t store locally even after waiting a few seconds before reloading.
- On some occasions it seems like no data loads (waiting for
wn.initialiseI think) until the internet comes back.
- I replicate these issues [inconsistently] by creating a bunch of documents quickly, waiting, and then reloading.
- Seems like there are no change events for files yet?
- I need to keep track of ‘did push the fission button’ in multiple places within the app (on startup, on create, on update, on delete). Would be better for
fsto wrap local storage APIs and handle the transition from anonymous to account via the library.
- I am forced to use localhost because of ‘insecure-context’ errors. I almost never use localhost and have custom local domains for each project.
- Probably related to the last point. Opening the app on localhost in Firefox Private Mode breaks with the error
Uncaught (in promise) UNSUPPORTED_BROWSER. Opening the app on localhost in Chrome Private Mode breaks with the error
Uncaught (in promise) DOMException: Failed to register a ServiceWorker for scope ('https://auth.fission.codes/') with script ('https://auth.fission.codes/service-worker.js'): The user denied permission to use Service Worker.. I understand that some cryptography features are unavailable in certain contexts but it would be nice for the app to function (or at least fake it) because private tabs are an important clean slate for testing.
- Safari 12 is unfortunately my main browser and I am not able to use it for this… I can authenticate now but when I return to the app it breaks with the error
Unhandled Promise Rejection: Error: No available storage method found..
- remoteStorage is more ‘JSON-dominant’ than a replication of the filesystem. A path is more like a string and I don’t need to create directories before writing: storing an object is essentially a single API call. It creates and deletes ‘directories’ automatically as the files within them are written or cleared. There are separate read/write APIs for objects vs files (even though the ultimate destination is like a ‘file’) to make it easier to deal with JSON.
My code is kind of messy but it’s on GitHub GitHub - rosano/fission-proof