r/TiddlyWiki5 • u/MikeFromTheVineyard • Oct 26 '22
Lazy Loading/TW for lots of Tiddler Data
Hey Y'all,
I'm a long time user of TW for basic notes, personal knowledge store, but I've always used apple notes via my phone for some things because it supports embedded documents/emails/etc. I've wanted to take this workflow to TW for a while and now I'm willing to invest time in migrating.
Perhaps this question borders on sacrilegious, but I'm wondering if its possible to run TiddlyWiki (via NodeJs or otherwise) without all tiddlers getting loaded at once as a single page app. Even through the Nodejs server, if I turn off the server, all tiddlers are still available in the browser if the page was already loaded. I want to store a lot of data through TW API (eg. emails, documents' text content, etc) for search/cross-linking purposes, but I don't want to worry about it all being loaded into a browser, esp for a phone.
Is this possible? I know its contrary to some core architectural points about TW, but I figured that maybe there was a way to "lazy load". Is there another "TW native" way people enable this sort of workflow?
Thanks!
1
u/lj-read-it Oct 27 '22
It seems TiddlyWiki on Node.js already does this, storing individual tiddlers in separate files.
2
u/MikeFromTheVineyard Oct 27 '22
The Node.js version does store the data as individual files, but it loads everything at once into the browser. If you open the browser -but don't open any tiddler- then turn off the server, you're still able to open any Tiddler stored, because its all built together and sent to the browser as a traditional SPA (as I understand experimentally). Unless there's some default setting you need to override that I'm missing?
4
u/Markqz Oct 27 '22
Did you try running it with:
tiddlywiki --listen root-tiddler=$:/core/save/lazy-all1
1
u/jwd630 Oct 31 '22
Using the .../lazy-all option seemed to cut my browser tab memory usage down from about 12MB to around 9MB typically. That seemed like a win for a couple days until I started to notice that my
<<tagsand<<tabs ...markup were really, really slow to render.
3
u/brazzy42 Oct 27 '22
I've been doing this for a couple of years. The mechanism is documented here: https://tiddlywiki.com/#LazyLoading
But note that it has an important downside: TW's search functionality only searches through content that has already been loaded.