Frag takes a collection of named HTML strings (fragments) along with arbitrary data as input and produces a HTML string as output. You can annotate input HTML with special attributes that control how the data is used to produce the desired HTML output.
If you're familiar with other templating systems, I see Frag as a mix of the attribute based, natural templates seen in Thymeleaf and the logic-less, data-driven approach of Mustache.
I wanted to see if it would work / is any good
Some things are awkward in JSX. e.g. inline scripts
I find the mix of logic within JSX syntax overwhelming at times
I wanted the ability to author HTML files directly
Less build tools and more vanilla HTML, CSS & JS
Don't agree? All good, ignore this and use JSX.
Probably not. Will there be bugs? Absolutely.
See @mrmcc3/frag on JSR for installation instructions and API docs.
Below are examples that showcase how Frag attributes behave with input data.
This website serves as an example cloudflare pages project.