Here's my take on how to improve the "new user" story for Clojure(Script) I was inspired to write this by this twitter thread
- The compiler is too damn slow. If I just require a few popular libs (core.async, dommy) and don't write any of my own code, I'm looking at >30 seconds for
lein cljsbuild onceto finish. A bit of googling tells me the startup time is to blame, and thatlein cljsbuild autowill keep the compiler in memory and automatically recompile as I make changes. Great, awesome, let's do that... emezeske/lein-cljsbuild#249 :frown:. So I rollback to the working version and recompiles only take a about 5-7 seconds. This is tolerable (though still way slower than I'm used to) but it took me a good 30-40 minutes to realize that there was a problem, search for a github issue, and then create one. - Which segues into point #1: way too many half-working things (this may be partly my fault, for immediately gravitating to the new & shiny). With the same project, (still containing none of my own code) the compiler will occasionally throw an NPE from deep within it's bowels on the first recompile. No useful message to indicate wtf went wrong. The only way to get out of that situation seems to be cleaning the project and compiling again.
- I have no idea what I'm doing. While this is clearly my fault, only an asshat would see that as a satisfactory resolution. Every how-to blog post I find assumes I want to write a server-side clojure application and immediately has me setting up a minimal (or not so minimal) ring project with routes and templating languages and god knows what else. I just want to write some ClojureScript code in a file and run it in a browser, this shouldn't require any additional tools.
- I know that you can actually serve static files via the browser repl because I read an @swannodette blog post but that only works if I dump everything in my project root. This seems like low-hanging fruit to me, a slightly more flexible static-file-and-browser-repl-server (basically let me set the root directory to serve) that was documented in the lein cljsbuild readme would be a huge improvement.
- Really unclear node.js story. You could argue that this is unimportant, but I don't think I'm the only node user interested in writing ClojureScript in that environment.
- Apparently I need to assign a magic global
*main-cli-function*to a function and that will work. - There's a noderepl plugin, but it also has issues
- How do I integrate ClojureScript with node's view of the world? (Do things like
goblocks work if I'm calling functions from external javascript in them?).
:whitespaceoptimization,:simpleand:advancedare loss-y because of inlining and dead code elimination.index.htmlfiles and that's it. I also have a fairly simple setup for my Jekyll based blog that works for me - http://github.com/swannodette/swannodette.github.comlein-cljsbuildfolks, but honestly this seems like a separate CLJS tool to me.