Proposal: "Plugin per file" should be used more

37 views
Skip to first unread message

Arlen Beiler

unread,
Jan 18, 2019, 12:08:17 AM1/18/19
to TiddlyWiki
I would like to mention to everyone that there is a feature in the boot code which is often overlooked but is very useful. And that is that you can distribute a plugin as a single JSON file. This has a massive advantage when we're looking at hosting wikis online because these could be compiled and published to NPM and then distributed through jsdelivr.com

The distinct advantage of this is that once someone loads one wiki which uses this method, the files will be in their browser cache, so when they go visit the next website, the same file can be simply gotten from the browser cache instead of going to the server for it. This can improve loading speeds a lot, especially for wikis that don't have very much content. 

The second advantage of this is for online editing connectors like TWCloud, where you can reference the hosted JS file, allowing you to have a much smaller file that needs to be uploaded everytime you save. Of course, you could easily make this rule-based where it loads them from one location or another based on the origin, etc. 

The logical next step is to load content tiddlers in a similar fashion, allow groups of tiddlers to be imported (kind of like includeWikis) cutting down on the file size further, especially if you're like me where all your wikis have the same custom styles and macros. Cloud connectors could be configured to work with this by overriding the default loading mechanism with cloud-specific code to insert the requested files.

I always try to work within the scope of the current code as much as possible, and right now I think only one tiny change needs to be made in order to make this perfectly doable. 
Reply all
Reply to author
Forward
0 new messages