ClojureScript TUI Template
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
- Studied Floki’s stack
- Designed base architecture suitable for most use-cases
- Created a prototype UI
- Researched figwheel-main
- Added +figwheel-main option
- Researched shadow-cljs
- Added +shadow-cljs option
- Made shadow-cljs the default
- 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