-
Greetings from the great beyond, I've been playing with the idea of using TW5 as a front end to aggregate tiddlers from remote sources, some of which might also be writable. After doing some research, I've concluded that I might be Doing It Completely Wrong™, perhaps even reinventing the wheel - so despite being familiar with the TW universe from the olden days, I ended up with a bunch of (mostly basic) questions. Here's the flow I imagine:
So much for the passive part. When a tiddler is edited, it should be saved back to the respective source, individually. Thus the TiddlyWiki document is only ever a snapshot with an in-memory store instead of being persisted as a whole. Constructing the respective HTTP requests for remote sources is the easy part. What I'm unsure about is how to properly integrate that data with TW5. I'm aware of the TiddlyWeb adaptor, PUT saver as well as the discussion in #5269 - but it seems to me that the flow described above doesn't quite fit into existing patterns? (Happy to be proven wrong.) Here's a set of tangible questions I've identified:
Apologies for imposing a wall of text on y'all; the context seems relevant from my current perspective, but I'm happy to excise questions into separate discussions if that's preferred. ¹ ideally this would be a minimal build, e.g. keeping only those modules required for the main story, timeline and search - though that's an optimization we should probably discuss separately ² I currently use a custom script to extend |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 5 replies
-
@inmysocks - maybe you have any thoughts on this? :-) |
Beta Was this translation helpful? Give feedback.
-
Bob has ways to do a lot of this, at least for the server part. A lot of it is only the pieces implemented without the full setup because I get distracted easily, but most of it is there. And TWederation covers a lot of the components in the interface wiki. It is a generalisation of the mechanism Jeremy made for the plugin library that allows a wiki to fetch tiddlers from other wikis, and I have extended it a bit to allow it to also interact with a Bob server in a very similar way to what you are describing, but once again while the pieces are mostly there they are not put together completely. As an alternative back-end I made a WikiDB which is a document database that uses tiddlywiki-style filters as the query language and the document storage model is based on tiddlers, but before I got enough time to polish all of this and release it my day job picked up and work has slowed down a lot. So yes, I have lots of thoughts on this, unfortunately less time to work on it than I would like. If you want to look at existing things to see if they are useful to you there is twederbob https://github.com/OokTech/TW5-TWederBob and the mechanism Jeremy is using for the links aggregator is something like twederation so that may help. |
Beta Was this translation helpful? Give feedback.
-
Hi! And apologies for the late response.
That all makes sense.
The TiddlyWeb syncadapator works with the core syncer engine to synchronise individual tiddlers at startup and as they change on the server. The PUT Saver saves the entire HTML file to a single location. What you want could plausibly be done as a syncadaptor integrating with the core syncer engine, or you could bypass the syncer and make it work independently.
TW5 uses it's own CommonJS compatible loader that loads modules from tiddlers, falling back to the Node "require()" method on the server. Cargo culting should serve you well.
The core sticks to really old ES5 JavaScript for backwards compatibility. It's callbacks all the way. Of course you can write modules that do use fancy new stuff (and I do all the time), but you just need to watch your interfaces with the core.
As I say, savers are for saving the entire wiki, and so are probably not relevant here.
That would be a syncadaptor.
Yes, displaying a tiddler should kick off the automatic loading.
No, there's no direct way to restrict editing on particular tiddlers, although it's easy enough to hide the editing controls for tiddlers that don't meet criteria.
If you do write a syncadaptor, the syncer does indeed know that there is outstanding request and will wait for it to complete before initiating a new one.
The saver handler and the syncer each handle the dirty flag slightly differently, essentially listening to change events on the wiki store and tracking changes themselves.
If you want to hold up the UI until things have been loaded, you may want to load your tiddlers in a preload phase, before TiddlyWiki loads.
A lot of the techniques you are describing can be seen in the work I've done on an AWS-based serverless TiddlyWiki. For example, this is the editing front end of my blog which is at https://jermolene.com/ https://xememex.com/jermolene/ If you poke around in devtools you'll see that:
I never quite got around to open sourcing all of that stuff, but happy to help you pull out anything useful. |
Beta Was this translation helpful? Give feedback.
-
Hi @FND. Almost feels like its 2008 again. I was just reminded yesterday of some of our work on related matters back in the TW 2.x days. As it happens, I am currently contemplating a project that may share some of your described workflow. I haven't had the time to flesh it out properly yet, let alone write it up. Skimming this thread may provide a general idea: https://groups.google.com/g/tiddlywiki/c/SJkmnGVQVjI |
Beta Was this translation helpful? Give feedback.
Hi! And apologies for the late response.