I know compression has been discussed to make TiddlyWikis smaller in a more general sense. However, I’m considering a more focussed application.
I have developed plugin integrations for several JavaScript charting libraries. Of the feedback I got, the most common related to how big they were.
The bulk of each plugin was the respective chunk of minimised JavaScript for each library. The only way to make them smaller was to apply some sort of compression.
I had recently been working with a small unzip library for my work, and thought the inflate code would be applicable. I’ve uploaded the result to:
https://www.scss.com.au/family/andrew/tiddlywiki/CompressedPlugins.html
If you download that wiki and search the source for “TinyInflater” you’ll find the minimised inflater code, followed by a wrapper function that is between the inflater and TW code. After that are the two core TW functions I had to modify: “defineTiddlerModules” and “defineShadowModules”.
(Aside: “defineTiddlerModules” processes differently based on “tiddlers.field.type”, while “defineShadowModules” does not - that seems wrong to me? I would have said the switch in the former should be factored out and then called by both?)
The end result is roughly halving the size of every plugin, just by compressing already minimised code.
This would also be applicable to other plugins that incorporate large JavaScript libraries, such as the KaTeX plugin. Compressing just the main katex.min.js saves about 170KB.
Naturally, I think supporting compression in this way would be a worthwhile addition to the core.