beginners 2025-06-16

Hello everyone, I'm learning ClojureScript with shadow-cljs, I got a a Tauri app working on my physical Android with hot reloading. However, I realize now that browsers probably need a very specific way of programming the callbacks or dom elements such that functionality is capable of hot reloading. So my question is, is there a resource that discusses this topic? How to properly stucture an app so that all the tweaks I make to styling and functionality are easily hot reloaded? Not just cljs, but also html and css. I would appreciate the help. My general frontend knowledge is a bit limited and over a decade old so that's also a tricky part. Maybe I should've kept things simple but I really wanted to use CLJS!

Hmmm, I guess the Shadow CLJS User's Guide has some stuff, I missed it originally.

Oh I see, I can get CSS to hot reload, but I was confused as to why my HTML wouldn't get hot reloaded when I edit it. Should I be using Hiccup instead? Will that help with the hot reloading?

Ok, well you can eval (.reload js/location) and that will reload the app on Tauri/Android

I can recommend https://replicant.fun ! Check out the tutorials, it will help you get going.

Thank you! I did want to check out Replicant. Maybe it's a good time to try since I was thinking of giving hiccup a try. I really enjoyed Elm when I tried it out a bunch of years back.

Replicant lets you work with the same concepts as in Elm: top level state and declarative events (events as data). The common practice of event handling in Replicant differs with Elm, though: instead of named events and handlers with pattern matching, state updates and other effects are declared as data directly in the events. Mind you, Replicant has no opinions about this (it provides no state management at all), so you're free to approach this however you'd like, e.g an init/update/view system like in Elm. The examples and tutorials are great (and check out the videos at https://www.youtube.com/@replicant-clj ) And there's the #replicant channel 🙂

Awesome, I'll check it out. Actually I'm working on two websites at the moment; this IoT website that will have live sensor data (which I think replicant will excel at) and then I need a static site generator for my personal website. I wonder what would be a good option there. Claude suggested I could just use hiccup and file I/O and I'm inclined to agree with him, seems like a good way to learn more CLJS

Seems like the universe really wants me to use replicant https://www.youtube.com/watch?v=AGTDfXKGvNI This was the first reddit thread that showed up

Cool! That's a great presentation, btw.

I made a blog some years ago using https://cryogenweb.org, and it worked well for me. Last week borkdude announced https://github.com/borkdude/quickblog, which may be a better option for today (I haven't had a chance to play with it yet).

1

That was for the static site part; for the dynamic one, I strongly second replicant, it's worked very well for me over the last year.