@jonikorpi@mastodon.gamedev.place
Post #1619740
2026-01-20 20:04 UTC
More people need to know about lit-html. (It’s not a framework or a web components thing.) https://lit.dev/docs/libraries/standalone-templates/
You get to render HTML like this:
```
render(
html`<h1>Hello</h1>`,
document.body
)
```
and then to update it like this:
```
render(
html`<h1>Hello <b>world</b></h1>`,
document.body
)
```
It takes care of all the diffing, patching, and memoizing. The performance is good. You get to structure your program around it any way you like. It’s great.
Replies (5)
-
@lexoyo@framapiaf.org 2026-01-20 20:23
@jonikorpi i use it wherever I can in @silex It's great really. Only standard but same use case as react
-
@thomastc@mastodon.gamedev.place 2026-01-20 20:32
@jonikorpi Thanks, filing that away for potential future web projects.
-
@risingtail@mastodon.gamedev.place 2026-01-20 23:05
@jonikorpi That looks absolutely horrible. I do not understand why anyone would do that instead of plain markup.
-
@nmn@indieweb.social 2026-01-21 00:39
@jonikorpi The brilliance of lit-html is overshadowed by the stupidity of web components and the rest of Lit.
-
@daeinc@genart.social 2026-01-21 14:02
@jonikorpi I used it in my recent personal project as I wanted something closer to web component standards than other frameworks. but the library development doesn't seem very active.