As discussed per
https://github.com/thymol/thymol.js/issues/19 I'm opening a topic on this.
Basically Thymol.js seems to be built to run in a browser. However it could be much more useful to use it as a general templating engine for Node.js. For instance we are using Thymol for the node edition of patternlab.
That is, the DOM engine Thymol requires is the one of a web browser like Firefox's. This engine uses the DOM level 4.
However there is no default DOM engine in Node.js, but there are projects to emulate the browser DOM (having objects like window and document).
Currentlly the only engine Thymol works with is "jsdom", which is terribly slow. In the issue I mentioned that a major speedup could be archieved.
To explain: There are different Document Object Model standards leveled from 1 to 4 (?), where a higher level extends all previous levels (e.g. adding window and document objects).
So I'd like to suggest to steps:
1. I'll do a pull request so that Thymol can be used with a Browser or Domino (which is much faster). This requires only minimal changes to the existing codebase and can be implemented in a very compatible way.
2. Thymol uses jQuery for a few simple queries. However jQuery requires a compatible DOM level. I am wondering if we could get rid of jQuery completely in the core engine code and also switch to a lower DOM level. DOM Level 2 supports namespaces (
https://www.w3.org/TR/1999/WD-DOM-Level-2-19990719/namespaces.html) and that's all we need in an XML based template engine. However currently Thymol.js does only work with DOM level 4.