Questions re TiddlyWiki + nodejs for building TiddlyWiki editions

85 views
Skip to first unread message

Charlie Veniot

unread,
Jul 28, 2021, 11:11:22 AM7/28/21
to TiddlyWiki
BTW: I'm spawning this thread from "TiddlyWiki + nodejs: What are benefits and use cases?", thinking a conversation quickly gets very unwieldy when it starts having multiple threads within one conversation.

Focusing on the use of nodejs for building TiddlyWiki editions, as I try to wrap my mind around the benefits of this ...

One could build an edition of TiddlyWiki with just the single-HTML-file version of TiddlyWiki.

However-1: (if I understand correctly) one really must use TiddlyWiki on nodejs to build a TiddlyWiki edition in which core tiddlers have been tweaked?  (Because one can't, and/or one can get into a mess, fiddling with core tiddlers in single-HTML-file TiddlyWiki?)

However-2: (again, if I understand correctly) there is a huge advantage in using TiddlyWiki on nodejs when building/maintaining multiple editions of TiddlyWiki when those editions share things in common.  Building/maintaining multiple single-HTML-files would be a nightmare keeping each "build" in sync.  Am I thinking about this correctly, and whatever benefits of building TiddlyWiki editions via nodejs am I not aware of?

Thank-you so much in advance !

I like trying to understand things often because I wonder what kind of good stuff I might be missing out on.




PMario

unread,
Jul 28, 2021, 1:01:43 PM7/28/21
to TiddlyWiki
Hi,
I think you don't miss much, if you use a single file TiddlyWiki, if it fit's your needs and you workflow. So as long as working with a single file doesn't drive you against a wall, there is no need to switch.

Using TiddlyWiki with nodejs is just an other workflow.

 ----------- A bit of history, which may let you understand things a bit better.

First things first.

 - TiddlyWiki exists since 2004
 - Ruby on rails was first released in late 2004
 - GitHub was founded early 2008 
 - Nodejs was released mid 2009
 - TiddlySpace was created 2010 and closed late 2016
 - TiddlyWiki5 development started 2010or2011 (Jeremy will probably know exactly)
   - First commit to github is from 5.0.0-alpha-11 on Nov. 2011
   - First beta was released Dez. 2013
   - V5.1.0 was released: 20. Sept. 2014

--------

In the early days of TW5 also known as TiddlyWiki 2 the devs needed a way to build a single file wiki out of many source files, because it's easier to track changes, if you don't have to inspect a several 100 kByte file, which mixes HTML, CSS and javascript code.

TW2 used to use unix shell- and ruby-scripts to build tiddlywiki. There are some artefacts stored on github. The process was know as "cooking" ... Hence the name of the script to build a wiki was: "cook"  ... The script to split a single file, was named "ginsu" .. I have no idea what that means ;)

The whole build system was 100% dependent on the directory structure. If you didn't have the same structure as the devs it was close to impossible to build a new wiki. ... It was especially complicated, if you wanted to use windows as your development OS.

All of that was really painful for new contributors, because usually you start with your own structure, just to find out, that you have to change it completely if you want to contribute to the TW core.

The second thing which was a PITA, where the ruby-scripts. Ruby is a completely different language than javascript and it needs it's own development environment. It wasn't overly complicated to learn "just enough" of ruby, to create a build system. .. BUT still it was a second element, which had to be maintained on it's own. ...

Lessons learned from TW2 and TiddlySpace, with TiddlyWiki 5 the whole process had to be much easier. For developers and also new contributors. As you can see in the timetable nodejs and GitHub where already available. Both systems where new, but very promising.

nodejs was designed to run server-side javascript applications.

nodejs as a build-system has the advantage that it uses javascript as it's main language. ... So it is possible to write code, that can run on the server and in the browser alike. ... That's a huge win.

The tiddlywiki --server command once was a pure development helper. It was used to quickly test changes in the core code and immediately see what's going on.  It was also used to write documentation tiddlers in the browser as a single file per tiddler. Those tiddlers where easy to use with the version control system (git), and the editor UI could be TiddlyWiki.

TiddlyWiki users found out about about the --server command and also wanted to use it for their own wikis, because of the "single file per tiddler" behaviour.
A lot of development was and is going on to make the server more stable, more secure and add new features.

The new command which let's you use all features is tiddlywiki --listen

The server is able to serve static files from a /files directory.
The server is able to use SSL certificates, so you can use https:// as the protocol
The server is able to implement a basic "role based" authorisation system, to define readers and writers
  - This is a multi user functionality, which imo is still in it's infancy state.
The server is able to import content from other wiki-folders
...

All the commands can be seen at: https://tiddlywiki.com/#Commands

As always. There could be a lot more documentation to make it easier for users to work with the server. .. BUT it also needs feedback, so that we can see what's missing.

---------

Personal remarks. ... I personally would never connect the nodejs server directly to the internet without a proxy in front of it. .. Because of security concerns. ... Letting nginx- or an apache-server handle the certificates and the /file resources is probably much more efficient than letting the tiddlywiki server handle those requests.

hope that helps
mario

TW Tones

unread,
Jul 28, 2021, 8:58:57 PM7/28/21
to TiddlyWiki
Charlie et al,

I would add to Mario's history that Jed built bob and the easy to install Bob.exe as an extended Node server install and it can handle multiple users and locks at the tiddler level. Bob as well is ideal in the LAN/local network with reservations if you wanted it internet facing.

Some opinions

I hope one day an easy to use implementation of node server or bob with a proxy would be available in a docker package as I would install it on my Synology NAS and make it internet facing. There are docker packages available but my skills are presently insufficient to get past the jargon and assumed knowledge. 

Regards
Tones
Reply all
Reply to author
Forward
0 new messages