UIx — Experimental ClojureScript wrapper for modern React.js

clojurescript
#1

Hello! Showing off a library that I’ve been working on during my screencasts. It’s still largely remains an experiment, but I’m also successfully using it on a small personal project (3kloc of cljs), so I’d say that it mostly consists of practical decisions.

Library repo https://github.com/roman01la/uix

It’s Reagent-like wrapper for modern React, based on hooks and functional components, and more modern React features adapted into Clojure style constructs.

Hiccup interpreter is based on Reagent’s, so it’s fast, but there’s also a macro to pre-compile Hiccup for perf sensitive code. Compiler macro is based on Kevin Lynagh’s excellent research on leveraging ClojureScript’s compiler type information to ensure that as much as possible could be pre-compiled and everything else is left for run-time interpretation.

Server side rendering on JVM works, based on Rum’s Hiccup serializer.

There’s more features and information in readme.

I don’t know yet where this project is going to end up, at least for now public API feels good to me, so I don’t plan to change it a lot. In the long run I’d imagine libraries like UIx, hx, chia and others could be merged into a single effort.

8 Likes