On my path to creating my ideal frontend web framework in Go, I've been experimenting with a template system that works with Vecty. I originally built a prototype that output HTML, like a standard template engine. Then, I adapted it to output Vecty objects and got a proof of concept working with Vecty in browser. But, I really didn't want to make a template system specific to Vecty, especially because there aren't a ton of great templating systems in Go. So, I wanted to make the core functionality neutral to outputting HTML strings or Vecty objects. This took some time to figure out, but I've done it.
The result is quite ergonomic both in use and in implementation. We build on an HTML parser and make a new Node tree that allows us to write custom directives, custom element parsers, and as I mentioned custom expression evaluators. So really what we have is a templating system framework inspired by Vue templates.
Now that I have this working with an HTML renderer, I'm going back to building a Vecty renderer, which has its own implementation of the basic directives. Custom elements let me wrap how Vecty handles components, and I just need to implement slots and a few other directives and I'll be ready to start building components with Vecty.