I’m experimenting with the idea of using a local indexeddb syncadaptor and the GitHub/cloud saver handler in parallel. To that end, I’ve created a demo for you all to play with. There may be bugs as this is an early build so don’t do anything I wouldn’t do:
What do all think? Do you think this is a useful way of using TiddlyWiki? You get the benefit of fast local saves which are automatic and manual cloud sync (which can take slightly longer to persist using the inbuilt savers) when you click the save button. Do let me know if you see anything break. Already noted some small issues that I will iron out over the coming days.
IMO “browser stores” are emerging as increasingly important because of the LOSS of easy access to the OS following the “apocalypse / clampdown” all browsers went through for security reasons.
My one worry is only you can get “locked-in” to a specific browser instance.
But, overall, it is interesting and potentially very useful.
That is mitigated by the ability to sync to your cloud account via one of the inbuilt savers. You may basically transfer your work to different browsers via this. Since they still work in parallel to the syncadaptor, wouldn’t that be enough? That’s the question.
Is this different from the Browser Storage plugin? Is there an upper storage limit? Are there any security concerns re local file addresses as there are (mildly) with the browser storage plugin?
I must confess, I haven’t tried the browser storage plugin so I must say IDK here. Concerning the upper limit, it really depends on your device and browser. So yeah, there might be. However, those limits are quite generous and you will be asked by your browser if you’d like to raise the limit when you’re close to hitting them I believe.
We’re working on a some way for a user to authenticate access to data and encrypting them at rest wherever they’re persisted (cloud or local) to mitigate some of these concerns. The early public build may not have that but that’s a goal we aspire to before we hit v1.0.0. The ultimate objective is to persist single tid files to any cloud provider of your choosing instead of a big html file.
Hi, TW has an official plugin, that seems to do the same thing: https://tiddlywiki.com/#BrowserStorage%20Plugin It allows you to host a wiki at eg: GitHub and if you don’t save it, it uses the browser local storage to save changed tiddlers. …
It is an opt-in mechanism. So you have to activate the right filter setting, if you want to save every tiddler to the browser storage.
Our solution uses PouchDB, which in turn uses IndexedDB, whose limit is calculated based on the hard disk space available (usually 50%). LocalStorage (which is what BrowserStorage uses) is hardcapped at 5mb.
Functionally they do the same thing. But ours has more wiggle room in terms of storage. I wish more browsers supported the File system API. That would be neat!
@abesamma I think this is an important step in the use of tiddlywiki, the former noteself did something similar but rather than github uses a hosted CouchDB.
When using such a DB locally it has the advantage of being able to maintain versions of tiddlers even if you do not write them back to the host.
I am not sure how your solution may help the two key issues that remain in my view with saving tiddlers/tiddlywikis.
How does it work If I access the same wiki from more than one tab/browser/device with the write credentials?
How can we have users have their own version of the wiki + their changes independent of the master wiki (This should be close with your solution and others)
How to we publish something on the internet such that more than one user can contribute to the master wiki without data loss. Bob does this on Node but securely publishing online is not simple and I am unsure how secure.
One problem with Note Self, which also used Pouchdb, was that it didn’t seem to be able to cleanly purge itself from memory. It had a configuration to remove itself, but when you went back to reinstall, the reinstall failed because it could detect something there. So, anyway, is it possible to purge your local stored objects?
I found on your demosite in Chrome “developer tools” the following;
Page layout may be unexpected due to Quirks Mode
One or more documents in this page is in Quirks Mode, which will render the affected document(s) with quirks incompatible with the current HTML and CSS specifications.
Quirks Mode exists mostly due to historical reasons. If this is not intentional, you can add or modify the DOCTYPE to be <!DOCTYPE html> to render the page in No Quirks Mode.
Very good questions to consider @TW_Tones. I don’t have all the answers now but I am sure we can work progressively towards answering most of them. Especially that last one.
Yes indeed, but we don’t bother to take advantage of that at least in this working version. We’re staying KISS for now and simply want to achieve reliable and robust CRUD operations and achieving the goal of persisting tiddlers as individual files to any service, local or cloud, such that it is compatible with TW for nodesjs tiddler folder setup using the usual HTML 5 file setup.
However, that is something I would like to experiment in the future.
@abesamma it would also be nice to access to a list of tiddler titles that are stored in the local IndexDB. This would allow a user to backup changes or send the changed tiddlers in a JSON package or generate a free standing wiki from the hosted wiki plus changes (Eg if access to the host is lost)
Just mentioning it now since you may have recently coded the part that you use to retrieve tiddler titles in the IndexDB.