1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-09 03:19:56 +00:00
TiddlyWiki5/editions/dev/tiddlers/from tw5.com/TiddlyWiki for Developers.tid

27 lines
1.8 KiB
Plaintext
Raw Normal View History

2013-12-12 09:48:08 +00:00
created: 20131203074550710
modified: 20140318210720798
2013-12-12 09:48:08 +00:00
tags: introduction dev
title: TiddlyWiki for Developers
type: text/vnd.tiddlywiki
TiddlyWiki is published as OpenSource which means that anyone can read the code and contribute to its development.
2013-12-12 09:48:08 +00:00
! Resources
If you're interested in understanding more about the internal operation of TiddlyWiki, [[TiddlyWiki Architecture]] gives an overview of how TiddlyWiki is structured. Then read the code -- start with the boot kernel [[$:/boot/boot.js]].
2013-12-12 09:48:08 +00:00
! The one thing you need to know
TiddlyWiki's architecture is very different from an HTML page written using jQuery. This section concisely explains what TiddlyWiki does differently. It may not make much sense on the first reading.
The key to understanding how it works internally is to see that the RefreshMechanism requires that any region of the DOM can be regenerated at any time. This means that the entire state of the user interface must reside in the tiddler store, from where it is synchronised into the DOM. This is done to improve performance by minimising the DOM interactions during the refresh cycles.
2013-12-12 09:48:08 +00:00
It also determines the standard UI flow:
# An event handler on a widget is triggered
# The event handler can manipulate the DOM nodes directly created by the widget, and/or modify the state of the tiddler store
# The core then issues a store change event which triggers the refresh cycle
# Each widget in the tree then gets a chance to refresh itself to reflect the changes in the store if they need to
From a technical perspective, TiddlyWiki is a fairly classic MVC architecture, with strict separation of concerns. The model is the tiddler store, the view is a rendering tree (such as the one created from [[$:/core/ui/PageTemplate]] in startup.js), and the controller is the core code itself.