Teaser image of ClojureScript TUI Template

ClojureScript TUI Template

eccentric-j/cljs-tui-template
  • clojure
  • clojurescript

A ClojureScript terminal-user-interface template built on web technologies you already know.

Goal

I always wanted to write rich terminal-user-interface applications to better automate mundane tasks and integrate with my common tools. Discovering https://github.com/denisdoro/floki blew me away with how powerful and familiar it was to write applications like that using blessed js, a curses implementation in node. Inspired by its stack I knew I had to make a template for other developers to be able to get started quickly.

This project is one of my first ClojureScript projects, I felt intimidated by the tooling required and put off diving in. However, while working on this project I found it may be valuable to try each major build tool: lein-figwheel, figwheel-main, and shadow-cljs to learn how to use them. Now I’m a lot more comfortable working in ClojureScript and look forward to doing more with it.

The reason I chose ClojureScript for this project is that you can distribute your transpiled apps with NPM and the startup time is significantly faster than Java based Clojure.

Process

  1. Studied Floki’s stack
  2. Designed base architecture suitable for most use-cases
  3. Created a prototype UI
  4. Researched figwheel-main
  5. Added +figwheel-main option
  6. Researched shadow-cljs
  7. Added +shadow-cljs option
  8. Made shadow-cljs the default
  9. Designed a small demo app to show what it can do

Discoveries

  • Dived much deeper into ClojureScript
  • Learned how to work with Reagent’s atoms and life-cycle functions
  • Learned lein-figwheel
  • Learned figwheel-main
  • Learned shadow-cljs
  • Discovered how amazing shadow-cljs is for ClojureScript apps