Yes, its 2025. Long live clojure, long live repl.
This project was created using bun init in bun v1.2.0. Bun is a fast all-in-one JavaScript runtime.
-
Bump deps, both the cljs and npm packages.
-
There is
templatebranch for barebone minimal setup which can be used with e.g.:
bunx degit datafy-id/cljs_hello#template new_dir-
Open the project with emacs.
-
M-x cider-jack-in-cljsthen chooseshadowthen choose:appor:clibuild for target browser and target node-script respectively. -
You're on roll now.
Open browser http://localhost:8000 (for build target browser) or execute bun run out/me/main.js (for build target node) to connect nrepl client (emacs) to the runtime (browser or bun).
From cider cljs repl, we can switch to its sibling clojure repl with: M-x cider-connect-sibling-clj.
From within clojure repl, we can compile, watch etc like this:
;; Compile
(shadow.cljs.devtools.api/compile :cli)
;; Watch
(shadow.cljs.devtools.api/watch :cli)
;; Unwatch
(shadow.cljs.devtools.api/stop-worker :cli)
;; Switch / enter the cljs repl
(shadow.cljs.devtools.api/node-repl {:build-id :cli})
;; Quit from cljs repl
:cljs/quitInstall the npm deps:
bun add --dev tailwindcss @tailwindcss/cliCreate input css file, e.g. ./src/css/style.css.
@import "tailwindcss";
Run the following in seperate terminal:
bun x @tailwindcss/cli -i ./src/css/style.css -o ./public/css/style.css --watchAs of tailwindcss v4, it will automatically scan our source files (e.g. all files except ignored by .gitignore). It will detect the class names defined in uix component as shown below:
(defui button [{:keys [on-click children]}]
($ :button.border.py-1.px-4.rounded-md {:on-click on-click} children))To use daisyui, simply install and use it.
bun add --dev daisyuiUse the plugin in input css file (./src/css/style.css).
@import "tailwindcss";
@plugin "daisyui";