felixhayashi / TW5-TiddlyMap

Map drawing and topic visualization for your wiki
http://tiddlymap.org
BSD 2-Clause "Simplified" License
862 stars 132 forks source link

Tiddlymap makes lazy loading not work #300

Open guillefix opened 6 years ago

guillefix commented 6 years ago

I tried installing tiddlywiki as mentioned here because I had issues with static building before, but now lazy loading does not work. I tried twice, and also removing all the plugins except tiddlymap and vis, and it did the same thing. Node.js sends all the tiddlers even with $:/core/save/lazy-all, and the wiki takes ages to finish loading. Removing the tiddlymap plugin makes it work again. This happened with Tiddlywiki 5.1.16 and 5.1.17

felixhayashi commented 4 years ago

Hi @guillefix thanks for reporting. I am sorry for this but I don't think this will be fixed since I do not use static building and Tiddlymap also relies on accessing tiddler contents even if they are not loaded yet, so this may conflict with the concept of lazy loading or results in the whole wiki being loaded one by one :disappointed:

danielo515 commented 4 years ago

This is indeed a big problem. However, if the tiddlers that are "key" are a fixed set they can be embedded on the index.html or pre-loaded before tiddlymap Which are the exact limitations?

felixhayashi commented 4 years ago

Hi @danielo515 , hope you are doing well! :slightly_smiling_face: Since I am not using lazy loading, I can only make assumptions: I think it is the general mechanism of TiddlyMap that tries to access tiddler contents using js (via TiddlyWiki's provided methods such as $tw.wiki.getTiddler). The problem is that those methods are not written in an async style which means that TiddlyMap assumes access is direct and instant when in fact the tiddlers are not ready and loaded lazy. This may confuse TiddlyMap when it tries to visualize a map etc. :man_shrugging: but to be honest, I am lost here.

danielo515 commented 4 years ago

Do you use the text field? That's the only field that is not available on lazy loaded tiddlers @felixhayashi

felixhayashi commented 4 years ago

Good point, I may be using it indirectly by calling getTiddlerLinks on nodes in the map, also if a node contains an image stored in another tiddler I try to access the text field... other situations may exist. :thinking: