Subplugins questions

I went one more time through PluginMechanism and Disabling Plugins in the official documentation and I still have a couple of questions about subplugins. Particularly about CodeMirror core plugin and its ecosystem.

How tight are the subplugins coupled to their parent plugin? I think I can just install CodeMirror main plugin. I can install it, then install a subset of its subplugins (or all of them).

But what exactly happens when disabling a plugin with subplugins, then enabling it back later?

If I install CodeMirror and all its subplugins, then disable the main plugin, do the subplugins get automatically disabled as well? Or do I have to manually disable each subplugin?

If I install CodeMirror and a subset of its plugins, then disable it (them, if manual intervention for each is required, see previous question), then later decide to enable it (them) back, do I have to re-enable just the parent plugin? Will TiddlyWiki remember that a certain subset of subplugins were enabled before and automatically reenable them, or would I need again to manually enable each subplugin?

The Disabling Plugins documentation tiddler only documents what happens behind the curtain (the disabled state of a plugin is saved in a tiddler with a special name) but doesn’t cover subplugins at all. It could benefit from a slight improvement that elaborates on subplugins.

I think they just stop working, since they need the main plugin. But I did not test it. You should test it and let us know.

I have just ran a simple test:

  1. Installed CodeMirror; saved and reloaded
  2. Installed one subplugin; saved and reloaded
  3. Disabled CodeMirror; saved and reloaded; subplugin stayed enabled
  4. Completely deleted CodeMirror; saved and reloaded; subplugin was not autoremoved as well; and just like in the previous step stayed enabled

By this (visually, at least, since I lack expertise to read the source), I can conclude that when disabling/deleting a plugin, I have to handle its subplugins manually (just treat them like regular plugins) and not expect that state changes of the parent plugin will get propagated to its children. Is this correct?

From an end user’s perspective, it would be logical if TiddlyWiki could handle this automatically (disabling a plugin would also disable all its subplugins; deleting a plugin would automatically remove all its subplugins), because for plugins with many subplugins (CodeMirror is a good example) a lot of additional manual management becomes tedious at some point.

I think you will find although the subplugins are active they only act on tiddlers where codemirroe is active, thus with the primary plugin disabled they will have no impact, or effectivly disabled.

If they could work independantly then they would not be subplugins, but free standing plugins, even if they are optionaly listed for a master plugin.