Coming in v5.1.22: dynamic loading of plugins

285 views
Skip to first unread message

Jeremy Ruston

unread,
Sep 11, 2019, 4:43:52 PM9/11/19
to TiddlyWiki
I’m pretty excited to announce that if all goes well, one of the new features for v5.1.22 will be the ability to dynamically load/unload plugins without needing to refresh the page.

The catch is that this only works for plugins that do not contain any JavaScript modules. For plugins that do contain JS modules, the behaviour is the same as at present, with a warning message advising the user to reload the page. The reason for this restriction is to avoid corruption due to attempting to swap a module that is already running. Nonetheless, there’s a huge and useful set of plugins that do not contain JS modules, including all themes and languages.

It’s a work in progress, and not yet merged into the prerelease:

https://github.com/Jermolene/TiddlyWiki5/pull/4259

Just to be clear, this means that with the proviso above, users will be able to:

* Add new plugins from the plugin library without reloading
* Add new plugins via drag and drop without reloading
* Delete unneeded plugins without reloading
* Eventually, to use tools like Tinka to package plugins without requiring a reload to test

There’s still a fair bit to do:

* Indicate in the plugin library which plugins will require a reload
* More testing
* Documentation

Questions and comments welcome.

Best wishes

Jeremy.

TonyM

unread,
Sep 11, 2019, 8:13:22 PM9/11/19
to TiddlyWiki
Jeremy,

Thanks for looking at this innovation, and I look forward to it. 

I have quickly looked at the "Browser-based local storage" plugin and see two .js tiddlers are included thus I expect I can assume then this plugin can not be dynamically loaded?

The reason I ask this is, as I have raised this previously, all readonly wikis that exist out there especially tiddlywiki.com, will continue not to permit the use of temporary user tiddlers for visitors. Such temporary local storage based tiddlers allow the story, recent, and settings like the more icon to be added to the page buttons which makes tiddlywiki.com more usable as a reference. 

What are your thoughts on the alternatives?
  • Include a disabled "Browser-based local storage" plugin in empty (Thus can be enabled)
  • Install "Browser-based local storage" plugin specifically on Tiddlywiki.com
  • Refactor (if possible) "Browser-based local storage" plugin to be able to be dynamically installed (not recommended)
  • Make this use of "Browser-based local storage" plugin more prominent in documentation so more people install it in their own published wikis and thus promoting a higher level of interaction and customisation with online read only wikis.
  • This could include a note to delete the plugin if this behaviour is not desired (An argument for not refactoring the plugin)
To me unless the "Browser-based local storage" plugin is available on read only sites the advantages conferred by the dynamic loading of plugins is further reduced as one would have to reinstall them every time one visits the site.

Any way, perhaps in a separate thread, or location nominated by you, I do have some other suggested enhancements to the "Browser-based local storage" plugin to makes its use more obvious. Eg options partially Hide the standard save mechanism and have an indicator local storage is in use or available.

Regards
Tony

TonyM

unread,
Sep 11, 2019, 9:47:23 PM9/11/19
to TiddlyWiki
Jeremy,

You mention Indicate in the plugin library which plugins will require a reload

Is it not possible to determine which plugins would require this automatically and allow it to be overridden either way with a flag on the plugin?

There may be cases where a Plugin need not be reloaded but the publisher wants to trigger a reload to achieve some goal like test the ability to save, and recall. There could be others that only become active on next load but need not force a reload at install time. An example may be a login method.

I think it important to keep in mind there are an increasing number of macro solutions out there that need never pe published as Plugins of the traditional kind. What you are proposing here should make the plugin mechanism more flexible encouraging such macro only solutions to also be packaged as plugins (That can be dynamically loaded). Perhaps we need to indicate in the plugins if they need reload or not before install.

Also the local browser storage can facilitate a reload on top of read only sites (If installed) - not withstanding its other limitations.

Regards
Tony


On Thursday, September 12, 2019 at 6:43:52 AM UTC+10, Jeremy Ruston wrote:

Arlen Beiler

unread,
Sep 11, 2019, 9:59:22 PM9/11/19
to TiddlyWiki
Unfortunately I don't think it would be possible for a LocalStorage plugin to not use Javascript. However, it could be possible to make a Chrome extension that would load this functionality for all wikis if the user desired to install such an extension. It would also be possible to enable this using a Bookmarklet which the user would click each time they load a wiki, but this would be easier to forget. The best idea is still for wikis to include this functionality for sites where it seems appropriate, assuming it has a clear way to delete tiddlers stored locally. 

--
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/7b2cd683-8ee1-45d4-bd08-0591284313e9%40googlegroups.com.

Mohammad

unread,
Sep 11, 2019, 10:48:56 PM9/11/19
to TiddlyWiki
Jeremy
This is amazing! One use case as discussed in another thread could be to dynamically create a selection of tiddlers as plugin, work with them (sandbox) and then delete all modified tiddlers (restore original) This will let us implement kind of sandboxing!

In this way there is no need to have shadow tiddlers start with $:/plugins they can be ordinary tiddlers have been packed using a tool like Tinka!

--Mohammad

Jeremy Ruston

unread,
Sep 12, 2019, 5:35:01 AM9/12/19
to tiddl...@googlegroups.com
Hi Mohammad


On 12 Sep 2019, at 03:48, Mohammad <mohammad...@gmail.com> wrote:

In this way there is no need to have shadow tiddlers start with $:/plugins they can be ordinary tiddlers have been packed using a tool like Tinka!

Is that a restriction of Tinka? The core doesn’t restrict the titles of shadow tiddlers; using $:/plugin/foo/bar/ is only a convention.

Best wishes

Jeremy

Mohammad Rahmani

unread,
Sep 12, 2019, 6:37:54 AM9/12/19
to tiddl...@googlegroups.com
Hi Jeremy!

 No it is not Tinka restriction!

Best wishes
Mohammad


--
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.

Mat

unread,
Sep 13, 2019, 2:38:07 PM9/13/19
to TiddlyWiki
Jeremy Ruston wrote:
Just to be clear, this means that with the proviso above, users will be able to:

* Add new plugins from the plugin library without reloading
* Add new plugins via drag and drop without reloading
* Delete unneeded plugins without reloading
* Eventually, to use tools like Tinka to package plugins without requiring a reload to test

Really looking forward to this.

Will it also mean one can live-edit a plugin? Or is it the same limitation as with macros, i.e that it refreshes the page? 

Thank you!

<:-)

Jeremy Ruston

unread,
Sep 16, 2019, 7:22:59 AM9/16/19
to tiddl...@googlegroups.com
Hi Mat

> Will it also mean one can live-edit a plugin? Or is it the same limitation as with macros, i.e that it refreshes the page?

Yes, any modification to or creation of a plugin tiddler will trigger the registration of the constituent shadow tiddlers.

Best wishes

Jeremy

Jeremy Ruston

unread,
Sep 16, 2019, 7:38:17 AM9/16/19
to tiddl...@googlegroups.com
I’ve now merged the pull request so you can try out the dynamic loading of plugins at:


As well as installing plugins from the official plugin library you can test it by drag and drop installation any third party plugins that don’t include JS modules.

Any questions or comments welcome.

Best wishes

Jeremy



--
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.

Mohammad

unread,
Sep 16, 2019, 9:44:15 AM9/16/19
to TiddlyWiki
I love it!
Thank you Jeremy!
I just did some experiments it works like a charm!

Normally I work with prerelease and at the start I drop some plugins like favorites over it! 
Now it works without reloading!

Cheers
Mohammad


On Monday, September 16, 2019 at 4:08:17 PM UTC+4:30, Jeremy Ruston wrote:
I’ve now merged the pull request so you can try out the dynamic loading of plugins at:


As well as installing plugins from the official plugin library you can test it by drag and drop installation any third party plugins that don’t include JS modules.

Any questions or comments welcome.

Best wishes

Jeremy

On 13 Sep 2019, at 19:38, Mat <matia...@gmail.com> wrote:

Jeremy Ruston wrote:
Just to be clear, this means that with the proviso above, users will be able to:

* Add new plugins from the plugin library without reloading
* Add new plugins via drag and drop without reloading
* Delete unneeded plugins without reloading
* Eventually, to use tools like Tinka to package plugins without requiring a reload to test

Really looking forward to this.

Will it also mean one can live-edit a plugin? Or is it the same limitation as with macros, i.e that it refreshes the page? 

Thank you!

<:-)

--
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 tiddl...@googlegroups.com.

Mat

unread,
Sep 16, 2019, 2:49:27 PM9/16/19
to TiddlyWiki
@Jeremy

I wanted to try it on https://tiddlywiki.com/prerelease so I opened the Plugin Library (the second green button) and scrolled almost to the end to find the Blog plugin (which is both not installed and doesn't seem to require reload). Clicking "Install" makes it instead say "Reinstall". I was expecting to find the Blog plugin in the installed plugin list but cannot see it there. Do I misunderstand sth?

<:-)

Jeremy Ruston

unread,
Sep 16, 2019, 2:52:04 PM9/16/19
to tiddl...@googlegroups.com
Hi Mat

I wanted to try it on https://tiddlywiki.com/prerelease so I opened the Plugin Library (the second green button) and scrolled almost to the end to find the Blog plugin (which is both not installed and doesn't seem to require reload). Clicking "Install" makes it instead say "Reinstall". I was expecting to find the Blog plugin in the installed plugin list but cannot see it there. Do I misunderstand sth?

Is the blog plugin not listed in control panel after installation? It is for me if I repeat the steps you describe,

Best wishes

Jeremy


<:-)

--
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.

Mat

unread,
Sep 16, 2019, 4:10:18 PM9/16/19
to TiddlyWiki
Jeremy Ruston wrote:
Is the blog plugin not listed in control panel after installation? It is for me if I repeat the steps you describe,

My mistake! Sorry!!

Turns out the plugin doesn't keep the same "name" after it was installed. It is not called "blog" anymore but instead "Tools for using TiddlyWiki to publish blogs". I think the bold type threw me off (i.e bold text in library and then bold link in local listing) and the fact that most of the library plugins are titled the same as that bold name. ... I guess this is another bullet for the things to change in the plugin handling.


<:-)

Mat

unread,
Sep 16, 2019, 4:26:16 PM9/16/19
to TiddlyWiki
AHA! Like in a bad comedy sketch, I posted this and then went right away to scan the latest code changes... and noted that you just hours ago added the feature to show that bold name! I must assume there is already an intention to do this in the local plugin listing also then.

<:-)

TonyM

unread,
Sep 16, 2019, 7:56:55 PM9/16/19
to TiddlyWiki
Folks,

What are good examples of pugins that fit this approach?

I usually distribute macros via bundle and they do not need a reload to start with. 

To test this I am looking for plugins without .js tiddlers. But find very few (so far). Perhaps I need a tool to add to my personal plugins wiki to search for plugins that do not contain js?.

Regards
Tony

On Thursday, September 12, 2019 at 6:43:52 AM UTC+10, Jeremy Ruston wrote:

Mohammad

unread,
Sep 17, 2019, 2:27:14 AM9/17/19
to TiddlyWiki

TonyM

unread,
Sep 17, 2019, 2:48:44 AM9/17/19
to TiddlyWiki
Mohammad,

Are you simply opening them and looking to see if it contains a .js ?

With this facility soon to be available it would be nice if the plugin list indicated such tiddlers, perhaps with an icon/ or *no reload needed

Thanks

Mohammad

unread,
Sep 17, 2019, 2:53:32 AM9/17/19
to TiddlyWiki
Yep!
Tiddlywiki uses a default icon for plugins!
One solution is uses different one! Other as you said is to show it!

Jeremy Ruston

unread,
Sep 17, 2019, 3:29:26 AM9/17/19
to tiddl...@googlegroups.com
Hi Mohammad

Yep!
Tiddlywiki uses a default icon for plugins!
One solution is uses different one! Other as you said is to show it!

I’m still working on the display of plugins but in the current prerelease, there’s an indication in the plugin chooser whether a reload will be required in the text of the installation button:


Best wishes

Jeremy.


-- 
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.

Mohammad

unread,
Sep 17, 2019, 4:03:18 AM9/17/19
to TiddlyWiki
Hi Jeremy!
 That's a good indicator! I am sure the feel and look will be better by release date!
For example font of alert, and other visual effects.
I thought icon can be different, but as developers may use different icons it may not work always!

--Mohammad
Hi Mohammad
To unsubscribe from this group and stop receiving emails from it, send an email to tiddl...@googlegroups.com.

Mohammad

unread,
Sep 17, 2019, 4:04:59 AM9/17/19
to TiddlyWiki
One more point

On drag and drop, no message is shown for reloading and I think that's enough!
But let's what are the other users thought!

--Mohammad

Jeremy Ruston

unread,
Sep 17, 2019, 4:06:11 AM9/17/19
to tiddl...@googlegroups.com
Just to add that there’s now a warning in the import listing if a plugin will require a reload.

Best wishes

Jeremy.



 That's a good indicator! I am sure the feel and look will be better by release date!
For example font of alert, and other visual effects.

I’m still working on it and welcome suggestions.

I thought icon can be different, but as developers may use different icons it may not work always!

Exactly, it would be a shame to hide the plugins own icon, and I’d be concerned that adding an icon wouldn’t be sufficient to communicate clearly to most users.

Best wishes

Jeremy.

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/c36904b7-4724-49b7-b14e-e7701a7b1a5c%40googlegroups.com.

Mohammad

unread,
Sep 17, 2019, 4:11:27 AM9/17/19
to TiddlyWiki
This is much much better!

Thank you Jeremy!

--Mohammad

TonyM

unread,
Sep 17, 2019, 4:15:54 AM9/17/19
to TiddlyWiki
Jeremy,

What about adding to plugins requiring reload a red $:/core/images/refresh-button
with a tool tip saying will require save a reload after install.

This provides all the information, is attention grabbing, or perhaps the $:/core/images/info-button

Regards
Tony

Jeremy Ruston

unread,
Sep 17, 2019, 4:24:00 AM9/17/19
to tiddl...@googlegroups.com
Hi Tony

What about adding to plugins requiring reload a red $:/core/images/refresh-button
with a tool tip saying will require save a reload after install.

The problem is that tooltips don’t work on mobile devices, so the policy of the core is to try to avoid relying on them. While we could add an icon to go alongside the current text it doesn’t seem an improvement.

Best wishes

Jeremy

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/7b29be24-ae9d-42f1-a81f-627f806408c9%40googlegroups.com.

TonyM

unread,
Sep 17, 2019, 4:27:23 AM9/17/19
to TiddlyWiki
Jeremy,

As raised elsewhere, the import process is also a good way to bundle tiddlers into a json tiddler. 

If you are modifying the import process can I please suggest a minor change?

Example
Drag and drop various tiddlers, plugins and json files and rather than hit import, rename to another field and remove the plugin-type import and status field and what remains is a json tiddler containing the collected tiddlers. 

Suggestion
Place a button on the Import tiddler that allows the user to save it for later
rename to another field
and remove the plugin-type "import" and status field

Additional suggestion for hackability
Allow alternatives for the following to be set or selected.
<<buttons>>
{{||$:/core/ui/ImportListing}}

so the import process can be hacked, I want to do this a lot. :)

Regards
Tony



On Tuesday, September 17, 2019 at 6:06:11 PM UTC+10, Jeremy Ruston wrote:

Jeremy Ruston

unread,
Sep 17, 2019, 4:30:40 AM9/17/19
to tiddl...@googlegroups.com
Hi Tony

Example
Drag and drop various tiddlers, plugins and json files and rather than hit import, rename to another field and remove the plugin-type import and status field and what remains is a json tiddler containing the collected tiddlers. 

I’m pretty sure that you can do this yourself with an additional view template segment that displays for plugin-type: import tiddlers.

Additional suggestion for hackability
Allow alternatives for the following to be set or selected.
<<buttons>>
{{||$:/core/ui/ImportListing}}

I don’t want to stray into unrelated extensions of the import mechanism at this point, but will return to it.

Best wishes

Jeremy.

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/f828d14b-e66f-4a02-a2c0-c3197dda3a3d%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages