Bundler plugin: filename collision when exporting data

First of all, despite the topic title sounding “threatening”, this is not a bug report. I’d just like to read other points of view about the problem described below.

Bundler plugin designs tiddler bundles as regular tiddlers. I think it is fine if an user wants to export a bundle tiddler as JSON. For a foo.bundle tiddler, a foo.bundle.json file will be created (Android, Tiddloid). Notice that this exports the tiddler itself - the bundle “template” as in the explicit list of other tiddler titles belonging to the bundle, or a filter expression if it’s a filtered bundle.

If trying to export the bundle from the Bundles tab, by clicking the button before the bundle name, again, a file named foo.bundle.json is created. Except this time the actual content of the tiddlers included in the bundle is written to the file.

I ran the two tests above separately, I exported to a directory that contained no foo.bundle.json file, and I ended with two files having the same name (which was suggested to me, I accepted the default), yet having different content. This feels somehow “wrong”, I don’t know if I should say “technically wrong” or “aesthetically wrong” here.

I think it is fair if a tiddler named foo.bundle will get exported (as a tiddler, regardless of context!) to a file named foo.bundle.json, because that’s how TiddlyWiki works. But I wonder if another file name should be suggested by the Bundler plugin, when a bundle gets exported (see second test above).

Ahhh - Nice catch. I did not think about this usecase. – I always save the bundle configuration with the bundle itself. I only export bundle-configurations using a different name instead of the default.

Need to think about it.
-m

hmmm.

As I did create the bundler plugin, it was convenient to create a new.bundle tiddler with the [New Bundle] button. Where technically it is a configuration tiddler.

I will change the bundle data export default name to
{{{ [<currentTiddler>] ".data" [join[]] }}}

So the new default name will be eg: new.bundle.data.json

The config will keep the tiddler title as it is now. So the exported data should not overwrite an eventually saved configuration tiddler.

New plugin-version v1.2.0 is online: Bundler Edition — Improve your export / import workflow

1 Like

Sounds good.

If the change will cause a plugin version bump, could we have a bundle composition mini-guide (the one that I asked about in another thread) included in documentation?

A laconic example could look like:

Filtered bundles can include other bundles:

1. To include a regular bundle, add `[subfilter{foo.bundle!!text}]` to the filter expression of the parent bundle.

2. To include a filtered bundle, add `[subfilter{foo.bundle!!filter}]` to the filter expression of the parent bundle.

This works for multiple levels of nesting, so exporting the data of a bundle that includes other bundles, those bundles containing other bundles, will contain all the non-bundle tiddlers from the whole hierarchy.

Note: I have tested this for two levels of nesting (super-super filtered bundle containing super- filtered bundles, each of them containing regular bundles), but you may want to double check this.

The documentation edition is independent of the plugin version, except for completely new functionality.

I did bump the minor plugin version number to v1.2.0 because there is different behaviour. But there is no incompatibility.

I’ll have a closer look.

Edit: There is a new nested bundle + docs under Tips and Tricks

Did it work out as expected?

Yes, it did. Having the view template of the filtered bundle display the included tiddlers is very helpful :+1: