[TW5] Should I load all TiddlerFields (only without text field) of all tiddlers for getSkinnyTiddlers() in sync adaptor?

64 views
Skip to first unread message

LinOnetwo

unread,
May 4, 2019, 8:09:38 AM5/4/19
to TiddlyWikiDev
Sorry I've just found that this forum is based on email, so I update it here:

---

We are quite not sure about this


Guessed from the doc:

If an adaptor does implement it, then every 60s (this function get called, by default)
if there are any changes from other devices to TiddlyWiki store,
then the modified field will change.
So TiddlyWiki on this device will know it's changed...then trigger loadTiddler() for it.


I'll need to keep an index file storing a list of all tiddler's tiddlerfields (only without their text field), and each time getSkinnyTiddlers() get called, I GET this file and return it. This is expensive on SoLiD backend.

So if i've guessed right, I can only return a list of title field and modified field, then TiddlyWiki will have enough information to decide whether to trigger loadTiddler().
Am I right?

Jeremy Ruston

unread,
May 4, 2019, 8:15:21 AM5/4/19
to TiddlyWikiDev
Hi LinOneTwo


> So if i've guessed right, I can only return a list of title field and modified field, then TiddlyWiki will have enough information to decide whether to trigger loadTiddler().

The syncer uses the absence of a text field to determine whether a tiddler is skinny or not. When it loads a skinny tiddler, there's no limitation on the additional fields that can be returned (ie you can return other fields besides the expected text field).

Am I right?

I think so, it's definitely worth trying :)

Best wishes

Jeremy
 

LinOnetwo

unread,
May 4, 2019, 8:59:43 PM5/4/19
to TiddlyWikiDev
Thank you, Jeremy,

I decide to use the following strategy to speed up the initial load speed:

  1. only load title from the container on the startup.
  2. load all metadata (maybe a little expensive) on the second getSkinnyTiddlers(), maybe these metadata will be used in searching? (I'm not sure about this!)
  3. only load title and modified from the container on subsequent getSkinnyTiddlers(), only for TW to determine whether to trigger loadTiddler(). (In case you have changes from other devices or other people in your collaboration team.)

Best wishes

LinOneTwo

LinOnetwo

unread,
May 10, 2019, 11:31:06 PM5/10/19
to TiddlyWikiDev

As @bourgeoa  said,

when I load the skinnytiddlers without the tags these are not loaded through the load tiddler function.

It was in the specific test where I used an index file containing only the title. I do not change anything to the toddler they remained with all there fields.
The skinnytiddlers loaded the list of tiddlers as having no tags. Quite normal. Then I manually select and load a tiddler that has tags.
These tags did not show in the tiddlywiki, neither in the tiddler nor in the tag list.

I did not further explore and decided that skinnytiddlers needed all tiddlerfields except the text field.
As I do not load all tiddlers at startup but only on demand, I keep an index file for performance.


在 2019年5月4日星期六 UTC+8下午8:09:38,LinOnetwo写道:

Jeremy Ruston

unread,
May 11, 2019, 10:43:08 AM5/11/19
to TiddlyWikiDev
Hi LinOneTwo

I experimented by modifying the core’s lazy loading to only load the title fields with the following steps:

* Copy TW5 repo
* Modify core/modules/server/routes/get-tiddlers-json.js to change the condition (name !== "text”) to (name === "title”)
* Execute the command:

tiddlywiki editions/tw5.com-server/ --listen root-tiddler=$:/core/save/lazy-all

Visiting http://127.0.0.1:8080/ in a browser shows a working TiddlyWiki. The problem is that because the skinny tiddlers lack tags and modified fields they don’t get listed in the sidebar tabs.

But if you visit $:/AdvancedSearch “filters” tab and search for [is[tiddler]] you’ll see a list of all tiddlers. You can force any of them to be loaded by navigating to them.

So, that’s the challenge: you need enough metadata to be able to present the skinny tiddlers to the user so that they can navigate to them, and thus trigger loading them.

Best wishes

Jeremy


-- 
You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywikide...@googlegroups.com.
To post to this group, send email to tiddly...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/d28c1e37-d302-49cf-b1e5-2c68656309f6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages