[TW5] Plugins within Plugins, Shadows within Shadows

104 views
Skip to first unread message

Scott Simmons (Secret-HQ)

unread,
Feb 18, 2016, 7:08:02 PM2/18/16
to tiddl...@googlegroups.com
Anyone have any experience with turning plugins into shadow tiddlers within other plugins?

I'm considering binding all my essential customized system tiddlers up into a "personal core" that I can deploy easily to new TiddlyWikis — including a couple of plugins.  I may include a couple of plugins from other authors, as well (with appropriate notes for anyone who comes across my "core" that third-party plugins may be out of date and should be checked against the appropriate repositories for updates).

I'm curious if anyone else has done this.  Any pitfalls to watch out for when it comes to executing JavaScript plugins?  Any conflicts populating the TiddlyWiki with all those shadows within shadows?

Jed Carty

unread,
Feb 19, 2016, 3:53:29 AM2/19/16
to TiddlyWiki
I have never seen this done. I am not sure how plugins inside plugins would work. This is one thing you could do with tiddler bundles but I don't have any of the nice features from the core import mechanism yet so if you want to go that way be careful.
Do you think it is important to have it be a single thing you import? It may be easier to have a tiddlyspot where you have an empty wiki populated with your desired plugins and then just download a copy of it when you want a new one. That way other people can do the same thing easily and if we get the plugin libraries and twederation set up the way we would like updating the plugins on your blank wiki would be easy.

Tobias Beer

unread,
Feb 19, 2016, 10:05:10 AM2/19/16
to TiddlyWiki
Hi Jed, Scott,
 
Do you think it is important to have it be a single thing you import?

I very much think so. Some things are more like "apps", i.e. plugin bundles + templates  + demo content, etc....
As for node, we can work it in a granular fashion using a tiddlywiki.info.
For standalone, you'd have to handle individual bits, manually, for every wiki.

Best wishes,

Tobias.

Scott Simmons (Secret-HQ)

unread,
Feb 19, 2016, 12:22:10 PM2/19/16
to TiddlyWiki
The way my TW5 use is shaping up, I think this is the best fit for me:
  • plugins composed of tiddlers designed for specific purposes (e.g., a "to do" plugin containing my macros, buttons, lists, images, stylesheets, and skeletons related to task management; a "bug reporting" plugin with its own set of stylesheets, images, macros, skeletons, and buttons)
  • a "personal core" comprising the settings I apply in every new TiddlyWiki and customizations I made to a handful of core shadows, as well as universal macros, buttons, and skeletons I'd like to make available everywhere
    • within this personal core, I'd like to include a couple of plugins:
      • plugins I've created for specific purposes that I'd like to make available everywhere (for example, plugins that other items in my personal core depend on)
      • setvars — you knew I was talking about setvars, didn't you, Tobias? ;)  — on which so many of my buttons depend
I haven't sat down and tested this yet.  I'm wary of running into potential conflicts, but, off-hand, I think it will actually work.

I think I'd prefer to reserve bundles — which, as an aside, I am going to personally insist on calling "schools"! :P — for content tiddlers rather than system/operational/functional tiddlers.

Scott Simmons (Secret-HQ)

unread,
Feb 21, 2016, 8:10:42 PM2/21/16
to tiddl...@googlegroups.com
In case anyone's curious, the short answer is:

Plugins within plugins are problematic.  A plugin embedded in another won't be loaded as a plugin and won't function as intended.  (Unless, of course, you open and save it after installing the parent plugin, "upgrading" the child plugin from shadow tiddler to a full-fledged tiddler.)

Also of note:

Tiddlers from the core are loaded before any user-created tiddlers (including those loaded from plugins), so you could indeed create a personal core of settings and core tiddler modifications or replacements that would override the default behaviors of a vanilla TiddlyWiki — as long as none of the tiddlers within that personal core were plugins themselves.

The $:/core itself has a plugin-priority field with a value set to 0.  At a glance, it looks like plugins with this value set are evaluated first, in ascending order of value, then plugins without a plugin-priority are evaluated.  So if you wanted to create a personal core to overwrite the TW core's functions without impacting any other plugins you might install, you should be able to do that by giving it a plugin-priority of 1.

A better solution than a personal core may be a personal plugin library — akin to what Jed and Tobias have created for their plugins.  In my case, I'd put the library online, and anyone who wanted to pull from it would be welcome to, but the real intent would be to make my customizations, settings and plugins available to me.  I'd create a small plugin pointing to my online plugin library; drag that into a new, empty TiddlyWiki; and then use it to import my collection of personal plugins (and other assorted, sundry tiddlers) from my online "TiddlyWarehouse."



Jeremy devoted some time to this notion (and the bigger, related notions of bundles and TWederation) in Hangout #98.

You can catch the relevant bits here:


... starting at 1:35:17 and continuing to 1:52:05.
Reply all
Reply to author
Forward
0 new messages