Hacker News new | ask | show | jobs
by arms 3444 days ago
The last time I wrote any ClojureScript was over a year and a half ago. I played around with Reagent a bit and remember really liking it. I never used it for any serious projects or in anger though - how is the tooling and debugging experience? I would love to use ClojureScript for my front end work (since I always end up using React + ImmutableJS anyways) but developer ergonomics are really important to me.
6 comments

Well, the CLJS->JS side of story is very polished, Figwheel [1] makes things work smoothly (in-browser errors and warnings, sourcemaps, hot reload all work from the box). You can check out [2] if you are interested.

There are two areas that still can be improved in my opinion:

* the asset story. Right now I use a gulp task that prepares my assets and outputs CSS into a folder known to Figwheel, which makes hotreloading work automagically. However, if you need a complicated interaction between JS, HTML and CSS (i.e. you use CSS Modules), it can be a bit more involved.

* the NPM deps story. AFAIK it's gonna be solved in CLJS core soon, but right now your best bet is to pack all NPM deps using native JS tool (webpack, rollup or w/e) into one file and include it before CLJS-generated JS code. Ah, and in some cases you will need externs, too. It's actually way less complicated then it sounds, and if you need any help, feel free to reach me through mail (my nickname here at gmail.com). I would be happy to help.

[1]: https://github.com/bhauman/lein-figwheel

[2]: https://www.youtube.com/watch?v=KZjFVdU8VLI

Fighwheel and cljs-devtools (https://github.com/binaryage/cljs-devtools) makes working with ClojureScript very ergonomic. The regularity that re-frame brings (knowing where all data resides and exactly what can change it) makes it even nicer.
As others have mentioned Figwheel and DevTools certainly improve the picture. There is also re-frisk which is an embedded, real-time, event monitor and database viewer. It's early days but already very helpful.
The debugging experience still requires thinking in javascript (https://drive.google.com/file/d/0Bz3IhEqTy9ioZWQ1T24tSzVwaW8...). It's not that big a deal from a day to day. Obviously still worth it, clojurescript is amazing and no other language comes even close. I dont use a ClojureScript repl these days either but I know some are and I need to revisit it.
I haven't gotten a chance to try it yet (would be interested in hearing from anyone who has), but there is a Chrome devtools fork called Dirac that is targeted at natively debugging clojurescript.

https://github.com/binaryage/dirac

Wouldn't JavaScript make you angrier anyway?
It probably would. Yet

>to "use something in anger" is a phrase, meaning to use something "for real" - in production, etc. rather than just to try it out.

That's weird, but I believe I remember seeing some DHH writings talking about coding in anger around the time he was defending cursing and sexually suggestive mostly-nude slides at Ruby confs[1]. I blew the phrase off as as a DHH-ism, thinking maybe he believed in trying to remain angry while coding or something crazy like that. Thanks for explaining the term!

1) http://david.heinemeierhansson.com/posts/39-im-an-r-rated-in...

I don't know what DHH meant, but the idiom "in anger" is used to mean "in seriousness", "for real" or "properly". Whether or not DHH meant the idiom, I do not know. But its likely.

For example: "I've been tinkering with emacs, but I've yet to use it in anger."