r/coolgithubprojects • u/Plenty_Ordinary_5744 • 7d ago
Lithent: a ~4.8KB UI library where component state is plain closure variables, no hooks (JSX or no-build templates, SSR, Custom Elements)
https://github.com/superlucky84/lithent
1
Upvotes
1
u/Plenty_Ordinary_5744 7d ago
Author here. Lithent is a small virtual-DOM library I've been building for UIs where a full framework runtime is too much, especially widgets embedded in pages you don't own.
The idea: component state is just variables in a closure. You call
renew()when you want a redraw, or use the optional reactive helpers (lstate,store).No rules of hooks, no dependency arrays.
Numbers, honestly:
cacheUpdate.Extras ship as subpaths of the one package:
lithent/element: register a component as a standard Custom Element (<1KB on top)lithent/ssr: server rendering + hydrationlithent/ftags: no-build templateslithent/test: render / act / cleanup for Vitest + Testing LibraryTry it:
npx create-lithent@latest(SPA, SSR or widget template). Docs: https://superlucky84.github.io/lithent/It's a good fit for small apps and embeddable widgets. If you rely on the React ecosystem, it isn't. Feedback on the API is very welcome.