<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Templating on jackieli.dev</title><link>https://jackieli.dev/tags/templating/</link><description>Recent content in Templating on jackieli.dev</description><generator>Hugo</generator><language>en</language><lastBuildDate>Sat, 04 Jul 2026 08:26:00 +0000</lastBuildDate><atom:link href="https://jackieli.dev/tags/templating/index.xml" rel="self" type="application/rss+xml"/><item><title>Why I built gsx</title><link>https://jackieli.dev/posts/why-i-built-gsx/</link><pubDate>Sat, 04 Jul 2026 08:26:00 +0000</pubDate><guid>https://jackieli.dev/posts/why-i-built-gsx/</guid><description>&lt;p&gt;I have been building &lt;a href="https://github.com/gsxhq/gsx" class="external-link" target="_blank" rel="noopener"&gt;gsx&lt;/a&gt;, a Go template compiler
with JSX-style markup, &lt;code&gt;component&lt;/code&gt; declarations, and plain Go output.&lt;/p&gt;
&lt;p&gt;The obvious question is: why?&lt;/p&gt;
&lt;p&gt;More specifically: why not just use &lt;a href="https://templ.guide/" class="external-link" target="_blank" rel="noopener"&gt;templ&lt;/a&gt;?&lt;/p&gt;
&lt;p&gt;Firstly, I like templ. gsx is not built because I think templ is bad. In fact,
gsx is intentionally compatible with the templ ecosystem. A &lt;code&gt;gsx.Node&lt;/code&gt; has the
same render shape as &lt;code&gt;templ.Component&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-go" data-lang="go"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;Render&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Context&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;w&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;io&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Writer&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kt"&gt;error&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;So this is not a &amp;ldquo;throw everything away and start again&amp;rdquo; situation.&lt;/p&gt;</description></item></channel></rss>