What's the point of JSON tiddlers?

110 views
Skip to first unread message

si

unread,
May 12, 2021, 11:11:29 AM5/12/21
to TiddlyWiki
This question stems from a post I made here, but I'm also curious about the more general question so I thought I'd make a separate post.

Specific case:

My specific case that triggered this question was that I created a button to store "history" for particular tiddlers. The button essentially creates a clone of the current tiddler with the title <currentTiddler>/history/<timestamp>. Since I anticipate creating a lot of "history-tiddlers", it occurred to me that another approach would be to just store all the history data for a particular tiddler in a single JSON tiddler.

This feels a little neater, but more specifically I wondered if there were any clear advantages to either approach? Will storing all history for a tiddler in a single JSON tiddler be less of a drain on performance than using lots of individual tiddlers?

General question:

I can't think of anything that you can do with JSON tiddlers that you can't do with normal tiddlers, so I'm curious where it would make more sense to use JSON?

Actually I can think of one thing: tiddler fields have character restrictions. But this doesn't seem like a big deal. It seems outweighed by the fact that we have much better tools for manipulating normal tiddlers.


TW Tones

unread,
May 12, 2021, 8:09:22 PM5/12/21
to TiddlyWiki
Si,

First, a tiddler incode inside in a JSON tiddler does not have a searchable title, this can be helpful sometimes. 

On your first questions it all depends on the application/content or data, for example I expect you are saving modified fields as a whole, if you have large text fields and added a period the whole text field would be stored again.

On your general Question.
  • I can  think of many things that you can do with JSON tiddlers that you can't do with normal tiddlers
  • Tiddler field names have character limitations, not much in the content.
On closing I think in your propose history tiddlers it would make sense to move them to JSON. Note this is exactly what Monhamads trash plugin does.
  • Lest a search bring up historical tiddler when you done want them.
  • You can then easily export/reimport the history tiddlers as one JSON file and more.
Tones

Mohammad Rahmani

unread,
May 13, 2021, 12:06:00 AM5/13/21
to tiddl...@googlegroups.com
On Wed, May 12, 2021 at 5:20 PM si <matthew...@gmail.com> wrote:
This question stems from a post I made here, but I'm also curious about the more general question so I thought I'd make a separate post.

General question:

I can't think of anything that you can do with JSON tiddlers that you can't do with normal tiddlers, so I'm curious where it would make more sense to use JSON?

I think this is pretty correct! I even think the vice versa!

 

Actually I can think of one thing: tiddler fields have character restrictions. But this doesn't seem like a big deal. It seems outweighed by the fact that we have much better tools for manipulating normal tiddlers.

Specific case:

My specific case that triggered this question was that I created a button to store "history" for particular tiddlers. The button essentially creates a clone of the current tiddler with the title <currentTiddler>/history/<timestamp>. Since I anticipate creating a lot of "history-tiddlers", it occurred to me that another approach would be to just store all the history data for a particular tiddler in a single JSON tiddler.

This feels a little neater, but more specifically I wondered if there were any clear advantages to either approach? Will storing all history for a tiddler in a single JSON tiddler be less of a drain on performance than using lots of individual tiddlers?

I cannot judge about performance! but non-dataTiddler has many more supports from the core while comparing with dataTiddler.
But as you said, sometimes I store data like a yes/no or definitions of words or things one line  task/todo, in such cases I do not like to have one tiddler per item and mess the Tiddlywiki!
Then when you do everything you see those tiddlers (I know you can use $:/ namespace...)
I use dataTiddler as a permanent object with many variables quite a lot and they share the same namespace and this is quite handy and useful for debugging...

So, in my opinion each has its own use case!


 

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/5b2d5326-b0ef-4723-8a33-8597f92a8c99n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages