Open LeaVerou opened 4 years ago
This would tremendously expand the range of mavos that can be made. Can the plugin use reflection to determine the different storage plugins that are available so it can let the user choose among them? What information needs to come from each storage plugin so that the storage-chooser UI can be appropriately customized to gather the information the user needs to provide to make use of that plugin?
@karger
Can the plugin use reflection to determine the different storage plugins that are available so it can let the user choose among them?
Definitely, though I see utility in an attribute to customize which ones will actually be selectable (if the attribute is not specified, all loaded backends would be selectable, or all that expose the required information).
What information needs to come from each storage plugin so that the storage-chooser UI can be appropriately customized to gather the information the user needs to provide to make use of that plugin?
That depends on the plugin. E.g. Github requires a username and optionally a repo & file name. Google Drive or Dropbox require one shareable link. It would be nice if this plugin could also create the shareable link in these cases (like the Github backend can), instead of having to create an empty file first. This is a simple matter of programming, the reason these backends don't do it in the first place is that the URL is not predictable, and since you needed to include it in your HTML, there was no point. UI-wise, icons would be quite nice, but not necessary. Perhaps the plugin can fetch the favicon from the corresponding site.
Some more thoughts on this:
create([url])
method that creates a file and returns its storage URLlocalStorage
so that we don't need to carry it around in the URL (and non-carefully constructed links could break it). If there is no URL parameter for storage, it is added from the locally stored one (so that we can still share links with the right data store).It's still an open problem how logging in to the same account on a different device opens the same data file you used on that app last (without having to carry the data URL in the URL).
Some apps are basically readers of certain "document" types, and it doesn't make sense for them to be tied to one data source, but each user may want to load their own data source. E.g. any tracker, the pros and cons app, the svg path demo. It would be nice to have a plugin that, when visited with no params it offers UI to select storage location, and then redirects to a URL that includes that storage location. This will also enable non-technical users to use many Mavo apps that right now require fiddling of the URL params to get to use your own storage.