TiddlyWiki as a website... TinyTiddly and externalized contents / plugins

79 views
Skip to first unread message

Tobias Beer

unread,
Sep 6, 2010, 9:43:43 AM9/6/10
to TiddlyWiki
Hi everyone,

I have set up a TiddlyWiki that is going to be used as a website. Now,
I would like to optimize it for both filesize and loadtime.

1) First of all, is TinyTiddly being maintained and if yes where would
I find a current version? http://tinytiddly.tiddlywiki.org only runs a
2.4.3 core. If it does not require magic to create a current
TinyTiddly, how exactly? Would be nice to see a step-by-step howto
here [1].

3) Would it make sense to also externalize all other plugins and to
shrink them? Using what, preferably?

4) To some degree there are plugins AND tiddlers in the wiki that are
only required for the local "backend" with admin / editing features
yet not for the actual website that is going to be on display, like
TiddlerTweaker, NewMeansNewPlugin, UploadPlugin, SomeAdminPanel, etc.,
etc... So which is the preferred way to conditionally load external
content possibly required to be loaded as a plugin?

...from TiddlyTools:
*LoadTiddlersPlugin
*LoadRemotePlugin
*ExternalTiddlersPlugin

...other sources or general proceedings
*MasterIncludesPlugin
???

How would that be best done with a focus on reducing load-time? How
would I best access / manage the contents of those files? Any
experiences of that kind which you can share? I guess a summary of
that kind would make for a good article on tiddlywiki.org.


Tobias.


[1] http://tiddlywiki.org/wiki/TinyTiddly

Christian MICHON

unread,
Sep 6, 2010, 12:03:10 PM9/6/10
to tiddl...@googlegroups.com
On Mon, Sep 6, 2010 at 3:43 PM, Tobias Beer <beert...@googlemail.com> wrote:
> Hi everyone,
>
> I have set up a TiddlyWiki that is going to be used as a website. Now,
> I would like to optimize it for both filesize and loadtime.
>
> 1) First of all, is TinyTiddly being maintained and if yes where would
> I find a current version? http://tinytiddly.tiddlywiki.org only runs a
> 2.4.3 core. If it does not require magic to create a current
> TinyTiddly, how exactly? Would be nice to see a step-by-step howto
> here [1].

in the link you sent, if you follow closely, you'll find this :
http://jonrobson.me.uk/static/development/TinyTiddly/tinytiddly.tar
It's v2.6.1

>
> 3) Would it make sense to also externalize all other plugins and to
> shrink them? Using what, preferably?

externalize: yes
shrink them: maybe
But if you externalize them (ex: mysql db, like in phptiddywiki), it
means size does not really matter (else than the loading time
required).

My 2 cents only. Hope it helps. I'm currently looking at using
tinytiddly with a mysql backend (what a coincidence!)

--
Christian

Tobias Beer

unread,
Sep 6, 2010, 2:35:03 PM9/6/10
to TiddlyWiki
On 6 Sep., 18:03, Christian MICHON <christian.mic...@gmail.com> wrote:
> in the link you sent, if you follow closely, you'll find this :http://jonrobson.me.uk/static/development/TinyTiddly/tinytiddly.tar
> It's v2.6.1

I know, I just put it there ;-)

passingby

unread,
Sep 6, 2010, 2:41:51 PM9/6/10
to TiddlyWiki



> > in the link you sent, if you follow closely, you'll find this :http://jonrobson.me.uk/static/development/TinyTiddly/tinytiddly.tar
> > It's v2.6.1
>
> I know, I just put it there ;-)

ha ha ha,

sorry, it felt funny!

Christian MICHON

unread,
Sep 6, 2010, 3:32:23 PM9/6/10
to tiddl...@googlegroups.com

I did not check the history of the wiki indeed:
http://tiddlywiki.org/index.php?title=TinyTiddly&action=history

Sorry for the noise then. Maybe you can ask Jon how he did it ?

I used to have my own tinytiddly, but I lost the recipe.

Since I'll look at this again for my tinytiddly+mysql, I can keep you
posted (unless Jon answers first).

--
Christian

Christian MICHON

unread,
Sep 7, 2010, 4:11:27 AM9/7/10
to tiddl...@googlegroups.com

What is more funny is that it's not a tinytiddlywiki at all !! Packer
has not even been used...

I'll post my recipe here soon.

--
Christian

Tobias Beer

unread,
Sep 7, 2010, 7:48:50 AM9/7/10
to TiddlyWiki
Hi Christian,

Posting the recipe would be great! I hope it won't involve a ton of
linux commands... well, if it did, what the heck ;o)

On the other hand, I would love to hear you and Jon comment on
"packer" (which?) and why he wouldn't use it or why you would.

Also, I would want to externalize the core as is included in the 2.4.3
release of TinyTiddly ...so it would be nice if you could put
instructions for that in your recipe as well. Thanks a lot!

Tobias.

Christian MICHON

unread,
Sep 7, 2010, 8:03:43 AM9/7/10
to tiddl...@googlegroups.com
On Tue, Sep 7, 2010 at 1:48 PM, Tobias Beer <beert...@googlemail.com> wrote:
> Hi Christian,
>
> Posting the recipe would be great! I hope it won't involve a ton of
> linux commands... well, if it did, what the heck ;o)

I'll do a separate thread for this. I'll explain about the
prerequisites. Currently I'm performing this experiment in Windows...

> On the other hand, I would love to hear you and Jon comment on
> "packer" (which?) and why he wouldn't use it or why you would.

I use packer3 (the web interface). Actually, it's better to
externalize the js first, then depending on your goals to decide or
not on the compression levels.

>
> Also, I would want to externalize the core as is included in the 2.4.3
> release of TinyTiddly ...so it would be nice if you could put
> instructions for that in your recipe as well. Thanks a lot!

This one will also be covered.

I'm actually trying to modify the original phptiddlywiki from Patrick
Curry (PMC) to upgrade it to php5, tw-2.6.1 with external js. Still a
few issues to iron... Another potential thread...

--
Christian

Tobias Beer

unread,
Sep 7, 2010, 8:16:32 AM9/7/10
to TiddlyWiki
Hi Christian,

Looking forward to the other thread! Be so kind as to leave a pointer
to it here. But, take your time. Better have a well laid out plan
(possibly with deficiencies) than some quick fix that is hard to re-
engineer. On the other hand, you could always use tiddlywiki.org to
draft and modify said instructions... so it'd be much more of a
collaborative approach with intermediate progress well visible while
the discussion would concentrate on things to discuss instead of
laying down the whole concept.

Tobias.

rakugo

unread,
Sep 7, 2010, 9:05:50 AM9/7/10
to TiddlyWiki
On Sep 7, 12:48 pm, Tobias Beer <beertob...@googlemail.com> wrote:
> Hi Christian,
>
> Posting the recipe would be great! I hope it won't involve a ton of
> linux commands... well, if it did, what the heck ;o)
>
> On the other hand, I would love to hear you and Jon comment on
> "packer" (which?) and why he wouldn't use it or why you would.
>

Whoops I replied to Christian's email rather than the thread
accidently!
Basically:
Packing comes with a cost - client side performance - that in most
cases completely undoes what you are trying to achieve with packing.
http://ejohn.org/blog/library-loading-speed/ is worth a read on this
subject.

Tobias Beer

unread,
Sep 8, 2010, 6:05:58 PM9/8/10
to TiddlyWiki
Hi Jon,

Can you provide a...

*HowTo for cooking a TinyTiddly (preferably published on
tiddlywiki.org)
*TinyTiddly with an externalized core for the current tw release
**or a HowTo as for creating one from a non externalized version

...as you'Ve pointed out minified rather than of packed? That wouldb
be great!

Cheers, Tobias.

Tobias Beer

unread,
Sep 8, 2010, 6:07:06 PM9/8/10
to TiddlyWiki
Also, externalizing the core and static plugins / tiddlers should come
with the benefit of drastically reducing the filesize of any backups,
am I right?

Tobias.

rakugo

unread,
Sep 9, 2010, 6:46:54 AM9/9/10
to TiddlyWiki
Hi Tobias,
You can currently cook a tiny tiddly from an svn checkout.
In here: http://svn.tiddlywiki.org/Trunk/contributors/JonRobson/verticals/TinyTiddlyTemplate/
you will find this - http://svn.tiddlywiki.org/Trunk/contributors/JonRobson/verticals/TinyTiddlyTemplate/generate_tiny
- which does all the necessaries. However it requires using a unix
environment, setting up environment variables and having used cook
previously... is that something you are capable with? if not what are
the pain points?

On the subject of backups... i doesn't I am afraid. Since your custom
built tiddlers are designed to be readable and are not code it is not
possibly to minify. Hence any tiddlers you create will cause the
TiddlyWiki to get bigger (the entire works of shakespeare for instance
would not be possible to minify). Any plugins you add can be minified
using http://developer.yahoo.com/yui/compressor/ to keep the file size
down, but currently you will have to do this manually.

You could write a plugin that minifies tiddlers tagged systemConfig
using http://www.crockford.com/javascript/jsmin.html to automatically
compress plugins..

Jon

Tobias Beer

unread,
Sep 9, 2010, 6:40:27 PM9/9/10
to TiddlyWiki
Hi Jon,

Of course, tiddler content would not be minified. But as the core and
plugins were outside they would not be contained in the backups (or
uploads) ...thus the backup size is (considerably) lower ...depending
on the amount of content in the wiki itself.

Also, externalizing plugins seems more of a one time effort, unless
they tend to change often and critically, which the main candidates
don't.

Being able to work with *nix code half asleep would be great, but
right now I would tend to not try and wrap my head around it or setup
a virtual linux along with cook and all other prerequisites. I would
appreciate if TinyTiddly were autogenerated (via your cook scripts)
and made available somewhere near the official release from
tiddlywiki.com.

As for now, I guess I'll try to go ahead and use the current minified
version from your site, which read 2.6.1 *alpha* and therefore made me
hesitate.

Cheers, Tobias.

Christian MICHON

unread,
Sep 28, 2010, 10:25:57 AM9/28/10
to tiddl...@googlegroups.com

Managed to find some spare time.

Here are the updated instructions:

- download tiddlywiki 2.6.1 empty.html, jsmin, shrinksafe and a local
copy of packer3 (use google to gather the urls)

- externalize the 4 javascript files (jqueryarea.js jsarea.js
jsdeprecatedarea.js jslibarea.js) and modify your main html empty.html
accordingly to load these 4 external scripts

- step1: jmin (mostly whitespace and comment removal. tou can swap
step1 and step2 and gain maybe some extra space, since jmin and
shrinksafe have reduction common techniques around comments and
newlines)

jsmin.exe < jqueryarea.js > jqueryarea-1-jsmin.js
jsmin.exe < jsarea.js > jsarea-1-jsmin.js
jsmin.exe < jsdeprecatedarea.js > jsdeprecatedarea-1-jsmin.js
jsmin.exe < jslibarea.js > jslibarea-1-jsmin.js

- step2: shrinksafe (caution here, mostly around the special characters \uxxxx)

java -jar shrinksafe.jar -escape-unicode jqueryarea-1-jsmin.js >
jqueryarea-2-shrinksafe.js
java -jar shrinksafe.jar -escape-unicode jsarea-1-jsmin.js >
jsarea-2-shrinksafe.js
java -jar shrinksafe.jar -escape-unicode jsdeprecatedarea-1-jsmin.js >
jsdeprecatedarea-2-shrinksafe.js
java -jar shrinksafe.jar -escape-unicode jslibarea-1-jsmin.js >
jslibarea-2-shrinksafe.js

- step3: use packer3 web interface to pack each of the 4 files, rename
them as in empty.html and you're done.

Figures for tiddlywiki 2.6.1:

- original empty.html = 368091 bytes

- with externalized js:

empty.html = 24762 bytes
jqueryarea.js = 6219 bytes
jsarea.js = 269928 bytes
jsdeprecatedarea.js = 4103 bytes
jslibarea.js = 72350 bytes

- after 3 steps:

empty.html = 24762 bytes
jqueryarea.js = 2834 bytes
jsarea.js = 108476 bytes
jsdeprecatedarea.js = 2007 bytes
jslibarea.js = 51209 bytes

Tobias: I'll send you a 7-zip containing the final code for testing purposes.

I'll try to publish this with the whole git history/steps on my github
account soon.

--
Christian

rakugo

unread,
Sep 28, 2010, 11:21:43 AM9/28/10
to TiddlyWiki
Hey, I'm sure I posted a message here but it hasn't appeared.
TinyTiddly was updated to 2.6.1.

My script to generate them is unix only. I just need to get better at
releasing TinyTiddly with every new release... :/
http://jonrobson.me.uk/static/development/TinyTiddly/

Jon

On 28 Sep, 15:25, Christian MICHON <christian.mic...@gmail.com> wrote:

Christian MICHON

unread,
Sep 28, 2010, 11:38:38 AM9/28/10
to tiddl...@googlegroups.com
On Tue, Sep 28, 2010 at 5:21 PM, rakugo <jdlr...@gmail.com> wrote:
> Hey, I'm sure I posted a message here but it hasn't appeared.
> TinyTiddly was updated to 2.6.1.
>
> My script to generate them is unix only. I just need to get better at
> releasing TinyTiddly with every new release... :/
> http://jonrobson.me.uk/static/development/TinyTiddly/
>
> Jon

It seems we did not use the same approach, right ?

I'm using 'the old method', compressing a 'wee' bit more (~90kb less)

--
Christian

Tobias Beer

unread,
Sep 28, 2010, 12:42:31 PM9/28/10
to TiddlyWiki
@Christian Thanks for your email!

@both, Christian & Jon, thanks a lot for taking the time! I will go
and play with these.

Cheers, Tobias.
Reply all
Reply to author
Forward
0 new messages