
Show HN: XT.js – a DOM construction/templating nano-library, 323 bytes minified - plugnburn
https://gist.github.com/plugnburn/07c383da5f151a54d0b2
======
maxpert
Ahh close I once made a complete template library under 325 bytes :D

[https://gist.github.com/maxpert/989159](https://gist.github.com/maxpert/989159)

~~~
plugnburn
Nice one too. The concept of mine is entirely different though: to never deal
with raw HTML strings, just logical blocks such as arrays and objects
describing elements and their attributes and contents. With XT, I never need
to escape content or attribute values manually because they are passed through
appropriate DOM API, not inserted in raw state.

That was one of the goals but I'm writing a complete article on XT.js and
XS.js right now, so I'll cover these aspects in it. But thanks for sharing
your efforts! Starred on GitHub.

------
plugnburn
Some explanations:

1\. Yes, I'm aware of Microjungle but still don't get why does it weigh twice
bigger and above. 323 bytes of XT.js is NOT gzipped size.

2\. This library is VERY strict to the syntax. Any mistake - flow ruined.

3\. You know how to deal with DocumentFragments, right?

4\. No serverside planned, sorry.

5\. Yes, it's already used in production.

