News for hackers. Stuff that matters.
Re:Show HN: Boxwood – simple templating engine for JavaScrip... by martinbaun on Monday May 13, 2024 @09:16AM (#40342993)
Sweet, I have been looking into Node for my Python SSR webapps, but Pug and Handlebars are just not cutting it. Jinja templating language is just soooo good.

This looks like what I wanted in a templating language

Re:Show HN: Boxwood – simple templating engine for JavaScrip... by lf-non on Monday May 13, 2024 @10:37AM (#40343868)
Try edge: https://edgejs.dev/

It is mature and feature rich. I like that the expressions can be plain js and it is not coupled with html.

Re:Show HN: Boxwood – simple templating engine for JavaScrip... by saurabh on Monday May 13, 2024 @10:53AM (#40344033)
We are using this as a standalone templating engine. It's easy, fast and has good error reporting. This is the main templating engine of AdonisJS.
Re:Show HN: Boxwood – simple templating engine for JavaScrip... by supriyo-biswas on Monday May 13, 2024 @09:22AM (#40343064)
There’s https://mozilla.github.io/nunjucks/ although it hasn’t been maintained for quite some time.
Re:Show HN: Boxwood – simple templating engine for JavaScrip... by hombre_fatal on Monday May 13, 2024 @06:06PM (#40349077)
Fwiw, you can use JSX without React.

Another project on the HN homepage at the moment happens to do this: https://www.val.town/v/maxm/staticChess

    const { renderToString } = require('react-dom/server')

    renderToString(<ul>{[1, 2, 3].map(n => <li>{n}</ul>)}</div>)
Granted, you have to configure it so that JSX is allowed in your JS. For example, by running your code as `tsx server.js`, but I find it so much better than Pug/Nunjucks of yore that it makes up for that downside.