Plugin repacking deletes shadow tiddler overrides

96 views
Skip to first unread message

Nicolas Petton

unread,
Apr 25, 2020, 7:53:28 PM4/25/20
to tiddly...@googlegroups.com
Hi,

I've started making a plugin in the browser (without nodejs), and
everything went fine during the first packing. All the tiddlers included
in the plugin became shadow tiddlers as expected, and the plugin works
just fine.

My issue is that now each time I try to make a change to one of the
plugin shadow tiddlers and repack the plugin using

$tw.utils.repackPlugin("$:/plugins/name/plugin")

All overrides to shadow tiddlers get reverted back to the version of the
shadow tiddlers, deleting all changes I'm trying to add to the plugin.

The doc at
https://tiddlywiki.com/dev/#How%20to%20create%20plugins%20in%20the%20browser
seems to indicate that it should work though:

To make a modified copy of a plugin, one edits the constituent shadow
tiddlers (doing this actually overrides the shadow tiddler with a new
non-shadow tiddler containing the modified content). The repacking
process retrieves the current value of all the shadow tiddlers included
in the plugin, and then bundles the new values back into the original
plugin tiddler.

However this is not what I'm experiencing.

I guess I'm doing something wrong, but at that point I'm a bit stuck :-)

Thanks,
Nico
signature.asc

Jeremy Ruston

unread,
Apr 26, 2020, 5:15:47 AM4/26/20
to TiddlyWikiDev
Hi Nico

I think you’ve stumbled on a limitation of $tw.utils.repackPlugin(). It’s actually quite an old way to build plugins, and now the Tinka plugin is more widely used, and may be worth checking out,


Best wishes

Jeremy

--
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 tiddlywikide...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/87pnbvktqm.fsf%40petton.fr.

Nicolas Petton

unread,
Apr 26, 2020, 7:05:54 AM4/26/20
to Jeremy Ruston, TiddlyWikiDev
Jeremy Ruston <jeremy...@gmail.com> writes:

> Hi Nico

Hi Jeremy,

> I think you’ve stumbled on a limitation of
> $tw.utils.repackPlugin(). It’s actually quite an old way to build
> plugins, and now the Tinka plugin is more widely used, and may be
> worth checking out,

Unfortunately the Tinka plugin suffers from the same bug, I'm wondering
if it uses the `repackPlugin` function under the hood as well.

I'll have a look at the pluginmaker.js, we'll see if I can find a fix
for it.

Nico
signature.asc

Nicolas Petton

unread,
Apr 27, 2020, 4:51:40 PM4/27/20
to Nicolas Petton, Jeremy Ruston, TiddlyWikiDev
Nicolas Petton <ni...@petton.fr> writes:

>> I think you’ve stumbled on a limitation of
>> $tw.utils.repackPlugin(). It’s actually quite an old way to build
>> plugins, and now the Tinka plugin is more widely used, and may be
>> worth checking out,

It actually works (both using `repackPlugin` and Tinka), but after the
first repacking, a page reload is neeeded. (I haven't seen the issue
with subsequent repacking).

Would it be worth logging some warning to the console?

Cheers,
Nico
signature.asc

Mohammad

unread,
Apr 28, 2020, 2:12:19 AM4/28/20
to TiddlyWikiDev
Nico,
 I may recommend the below tools

-In browser (very simle method)


- Node.js +TW


I see you have developed some nice tools (Progect Manager, Notebook theme,...) I may recommend to put the repo somewhere in GitHub or similar host
for future reference issue tracking, ...


--Mohammad

Nicolas Petton

unread,
Apr 28, 2020, 3:23:15 AM4/28/20
to Mohammad, TiddlyWikiDev
Mohammad <mohammad...@gmail.com> writes:

> I see you have developed some nice tools (Progect Manager, Notebook
> theme,...) I may recommend to put the repo somewhere in GitHub or similar
> host
> for future reference issue tracking, ...

This was more of an experiment, and I had a lot of fun developing
it live directly within the wiki inside the browser. For anything
serious I would definitely track it in git though, agreed!

Nico
signature.asc

Mohammad

unread,
Apr 28, 2020, 4:00:30 AM4/28/20
to TiddlyWikiDev
Hi Nico,

 Your experiment result in such a great theme and plugin!
 I am sure your serious development will absolutely amazing!

 Cheers and looking forward to see more contribution from your side :-)

 Best wishes
 Mohammad

Nicolas Petton

unread,
Apr 28, 2020, 4:36:07 AM4/28/20
to Nicolas Petton, Jeremy Ruston, TiddlyWikiDev
Nicolas Petton <ni...@petton.fr> writes:

> It actually works (both using `repackPlugin` and Tinka), but after the
> first repacking, a page reload is neeeded. (I haven't seen the issue
> with subsequent repacking).

I don't know how I missed this, but a reload warning is actually shown
upon first repacking :)

2020-04-28-103407.png
signature.asc

Mohammad

unread,
Apr 28, 2020, 5:00:11 AM4/28/20
to TiddlyWikiDev
Nico,
 Do you use TW 5.1.22 or older one?

 When you add a plugin and hence when you you create/repack a new plugin! this message appears and it is part of TW mechanism!
  Adding new plugins in TW 5.1.21 and older require save and reload.
  
 In TW 5.1.22 and later if the plugin does not include JavaScript code No relaod is required and this message will not be shown!

--Mohammad

Nicolas Petton

unread,
Apr 28, 2020, 7:41:33 AM4/28/20
to Mohammad, TiddlyWikiDev
Mohammad <mohammad...@gmail.com> writes:

> Do you use TW 5.1.22 or older one?

I'm using 5.1.22, and reloading after the first repacking seems
necessary, but not after subsequent repackings.
signature.asc

Mohammad

unread,
Apr 28, 2020, 9:05:23 AM4/28/20
to TiddlyWikiDev
Nico,
 When the plugin has no JS no needs for reloading! 
 Jeremy may have better answer, but I am using in browser plugin packing and I have not such experience in 5.1.22+
 I just curious about dependency which have JS! See here: from above reference:

Plugins may now declare dependencies that are automatically installed without user intervention


--Mohammad


On Tuesday, April 28, 2020 at 4:11:33 PM UTC+4:30, Nicolas Petton wrote:
Reply all
Reply to author
Forward
0 new messages