On Thursday, December 18, 2014 6:52:41 AM UTC-8, whatever wrote:
>
> If you're talking about TWC: the storeArea reflects the state as it was at
> last save. So if you add or delete tiddlers but don't save, the actual file
> doesn't reflect those changes until you actually save it. The changes are
> only in the memory till then.
>
Actually, to be more precise, in TWC the storeArea element in the HTML
source is *NOT* updated after the document is loaded into the browser. At
startup, the contents of storeArea are copied into the TW core 'store'
JavaScript object. All changes to tiddlers are made to the data in that
object. Then, when saving, a text string using HTML syntax is generated
from the store data. Next, the entire source of the TWC document is read
in from the original file on disk (or reconstructed from the
document.innerHTML if file I/O is not permitted) and
the HTML-formatted text string containing the revised store data is
inserted in place of the previously saved storeArea definition. The file
is then written back to the filesystem (or a "download/save" is triggered
if file I/O is not permitted).
Given the above handling, it seems that the storeArea HTML element that is
loaded at startup is not actually needed once the data has been copied into
the 'store' object. Thus, it *may* be useful to clear the storeArea
element after startup to save some run-time memory... but it might not be
all that much of a difference compared to the total run-time "footprint" of
the browser (which my TaskManager window shows to be around 30-50Mb for
each open browser window/tab). Even if
you are running a particularly large TWC document (i.e., with several
megabytes of tiddlers in the storeArea), trimming a few Mb of space off
that total is unlikely to make much of a performance difference.
In any case, you can experiment with this (in TWC) without needing any core
changes. Just create a tiddler, tagged with 'systemConfig', containing the
following line of code:
removeChildren(document.getElementById('storeArea'));
At start up, this code will be invoked, and will remove the storeArea
contents. Note that it leaves behind an empty storeArea *element*, so that
if some core code that looks for that element, it will not crash, even
though the storeArea is now empty.
---------
THERE ARE LESS THAN 30 DAYS REMAINING IN THE "InsideTiddlyWiki" FUNDRAISER!
YOUR DONATIONS ARE VERY IMPORTANT!
HELP ME TO HELP YOU - MAKE A GENEROUS CONTRIBUTION TODAY:
"Inside TiddlyWiki: The Missing Manual"
https://www.indiegogo.com/projects/inside-tiddlywiki-the-missing-manual/x/8816263
---------
enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios
Professional TiddlyWiki Consulting Services... Analysis, Design, and Custom
Solutions:
http://www.TiddlyTools.com/#Contact
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywikidev.
For more options, visit https://groups.google.com/d/optout.