[Discussion] How to reduce the size of your Tiddlywiki

I thought my edit clarified that it was indeed possible to host on TH. But it might be clearer in my mind than in my text :wink:

Save time is definitely faster. There’s a theory that your browser can cache the library, so, if that is true, then loading should also be faster after the first load.

Yes, just have to convince simon to serve the libraries at a known location. It would probably only be applicable to 5.2.3 and on. It might reduce the load on the servers if the cached library theory is true. That is, after the first load, the user wouldn’t be pulling the library.

1 Like

Maybe this could be officially be done on the TW5 github repo itself ? Apparently github page can be used as a CDN: Github as a CDN | Lance Pollard

But maybe a true CDN would be best : https://cdnjs.com/ for example, it’s free and opensource. I will create a PR for this

I did think you implied as much, but I didn’t follow the details. I think I understand that you’re working with a core library hosted at Github. Setting up a Github core library doesn’t sound straightforward for me…

But do we each need to host our core library somewhere? That seems redundant…

Should there be some central place (like tiddlywiki.com) where the core (or at least the current version) can be available to any of us who wish to use this method?

[Edit: I think I understand that setting such a thing up is exactly what some of the later posts are aiming to do.]

-Springer

1 Like

If you’re using github pages, then all we are talking about is a static host of the TW core library file (which you obtain per the instructions in the how-to) on github pages. It’s just a hosted file. If you have some other place to host the file, that could work too. But there seem to be fewer and fewer free places where you can do that.

Yes. But early days … probably need to see how well it works first.

2 Likes

As CDN - Content delivery network was mentioned I want to point out even whole tiddlywiki files load quicker “internationally” using the free CloudFlare CDN

  • It also makes sense we have any sharable resource such as the seperate JAVAscript core that we have this on a CDN somewhere. Ideally this will be done on an appropriate CDN and domain name. As suggested under tiddlywiki.com or similar, and publish it for all.

However regardless of the speed enhancing methods you use, always keep in mind this will not always work enough for users on low bandwidth and there is value still installing a splash screen or look at static html landing pages etc…

1 Like

Github user cdruan has made a TiddlyWiki plugin for externalizing TW core and plugins !

3 Likes

@telumire @Mark_S thank you! This is amazing. I’m really keen to make Tiddlyhost support this style of TiddlyWiki. This issue is tracking it.

4 Likes

There may be some limitations. My attempt to try it on one of my larger TWs (8mb) immediately got the RSOE, and I was unable to proceed further. Possibly it only works with 5.2.1 ?

Edit – problem plugin:

Motion - Vim-like keyboard shortcuts for TiddlyWiki.

Edit – misc problems

Some plugins might not be identified?

image

Edit - status

Worked with all but one of my current plugins. Some plugins are lacking the “name” field and don’t show up on list. Can I safely externalise them? The two plugins I encountered without names were:

  • TiddlyClip
  • GoToShortcut

Maybe …? Could you try to upgrade your wiki to the latest version before converting it ? If it still doesnt work then that’s a bummer :confused:

I noticed the same thing and did it anyway, on my wiki everything works fine - but just in case it’s always best to keep a backup

Is this compatible with TW 5.2.3? I assume this solution also externalize core, where in 5.2.3 TiddlyWiki itself support externalizing the core but not the plugin (already done by @cdruan).

You can now try a “external core” TiddlyWiki on Tiddlyhost.

See a demo here or try it out yourself by clicking “Show more types” when creating a site.

Right now it’s considered experimental, so it’s better not to use it for important stuff. Let me know if you find any problems.

3 Likes

Not so much a problem but have you considered using a CDN as raised earlier?

  • It will potentially reduce the demand on your infrastructure a great deal.

Small (310kb) and loading is really fast!

1 Like

Yeah definitely. Though even without that there’s still a large benefit for Tiddlyhost’s traffic and workload in general.

Actually I’m hoping they will be eventually be uploaded somewhere for all to use, as suggested in #7091.

And I added there

Great stuff, just consider being able to load a different core as per the TiddlyWiki version, maintaining back versions . Ideally this would be automatic, and please consider if the core can be switched to a new version later.

@Mark_S

Thanks for describing the problems you’ve encountered. I’ve added a fallback display value when a plugin’s “name” field is missing.

As for the problem with the motion plugin, it could be fixed if you modify the content of the $:/plugins/benwebber/motion/modules/startup/motion.min.js tiddler near the top:

The value of exports.after should really be “render” instead of “startup”, e.g.:

exports.after=["render"]

Its init function tries to access rootWidget’s children, but they are only instantiated after the “render” module. It just so happens in the regular startup, this module is called after render, but unfortunately, in external-js mode, this startup module is moved up before render, causing the crash.

Hope this helps.

1 Like

Welcome to the forum cdruan !

With your plugin, is there somewhere we can configure or overwrite to set:

  1. The path to the core library
  2. The path to the plugin library

These two paths are likely to be different, since there might someday be a universal core library location, but users will need to maintain their own particular plugin libraries.

Thanks!

1 Like

You can, edit the files $:/config/ExternalJS/Prefix/Plugins and $:/config/ExternalJS/Prefix/Core, without the version and extension, example :

You need to do that before exporting the core and plugins

Thanks for the fix. I’ve released a new version of motion that changes its startup order.