r/Clojure • • Apr 17 '16

The State of Clojure Web Development

http://yogthos.net/posts/2016-04-17-state-of-web-clj-dev.html
74 Upvotes

51 comments sorted by

View all comments

5

u/jhirn Apr 18 '16

Web framework is more than routing/rendering. We need something to store data (relational please), generate validation messages and forms (internationalized), asset compilation for both js (or cljs) as well as css (or sass, garden). Maybe even throw a few "commonly used" js libraries you're going to use anyways. We also need something to manage database migrations and multiple environments (dev, test, staging).

I'd love to see a lein new _ exist that automatically created a full blown project with everything in it where I could remove/replace rather than add the rest. There's no excuse for a "rails new" option to not exist in the Clojure realm.

This framework/monolith phobia is what kills my favorite language from being practical in my day to day. I manage and work on the start through launch of 10-12 websites per year. Sometimes rails makes weird decisions (looking at you coffee script, turbo links) but I just delete those two lines in the gem file, type "rake db:setup" and praise the heavens ActiveRecord exists.

3

u/yogthos Apr 18 '16

A lot of this is addressed by libraries, for example Luminus bundles bouncer by default. Asset compilation for cljs works out of the box as well. Luminus uses conman to manage a pooled database connection, migratus for migrations, and sets up dev/test environments out of the box when the project is generated.

I'd love to see a lein new _ exist that automatically created a full blown project with everything in it where I could remove/replace rather than add the rest.

That's pretty much what Luminus does actually. It sets up a project with batteries included, and you can build and deploy it right away. It comes with database config, migrations, tests, packaging, the works.

If there's a particular piece of functionality or workflow that's missing, then open an issue in GitHub and I'd love to work with you to resolve it.

3

u/jhirn Apr 18 '16

Well this has come a long way since I last looked at it ( which was a while ago, for sure). I didn't see anything for css or sass. I'd also like to see things like cljs by default and without running figwheel, similar to how asset pipeline is ready to go for coffee and scss when running rails server. It's the white glove things like this that annoy me when leaving Rails. Then again it might be these types of things that annoy people coming to rails.

Also korma was a real disappointment last I used it and a sql helper is just not enticing. Not to mention all the validations, error handling and add-ons the conventions of active record can afford. This might be too much for Luminis to take on but AR was core to rails' success.

Anyways next time I take a look I'll seek you out to give you feedback. I'm very glad to see a framework for web stuff in Clojure. I know a lot of people on the fringe of embracing Clojure who aren't happy with the lack of batteries included, opinionated convention heavy frameworks. Too many special snowflakes and sometimes, easy beats simple.