3 ms·
'Lack' of frameworks. I always think it's kind of funny when starting a new Clojure web project, I have to explicitly insert a middleware for parsing parameter
by akjetma 11y ago
'Lack' of frameworks. I always think it's kind of funny when starting a new Clojure web project, I have to explicitly insert a middleware for parsing parameter strings into a Clojure data structure, and then another middleware for transforming the string keys in that structure into keywords. There are just a bunch of things that don't magically work for you. That said, I really enjoy Clojure and appreciate/understand the high configurability.
- AlwaysBCoding 11y agoOh man, and having to manually configure your server logs just so you can see what requests are being made and where errors are popping up vs. just tailing log/development.txt in Rails...
- sveri 11y agoHi, author of closp (https://github.com/sveri/closp https://github.com/sveri/closp). TLDR; Yes, clojure is behind in regards of web development, but it is not as bad as you said. There is active work done in this area. I totally agree with what you said. It is a general understanding in the clojure community that you compose libraries to get things done. However, for web development that still means a lot of repitition, thats why I created the closp template. It is based on luminus (http://www.luminusweb.net/ http://www.luminusweb.net/) which is a lighter "framework" with more options. My idea was to provide one way with sensible defaults to get started in doing web stuff in clojure. I still work regularly on it and would be happy about contributions / feature requests. Whereas regularly means in terms of months as I do this all in my spare time. Also I am quite active in the clojure community and I know that luminus is not shunned, but instead it also receives improvements and releases regularly. Also the author of luminus works professionally with clojure and with luminus. And I have to admit, that luminus has the far superior documentation, he has done a good job on it I think.
- yogthos 11y agoThese are precisely the kinds of things that Luminus http://www.luminusweb.net/ http://www.luminusweb.net/ addresses. The template generates a project with all these things configured with reasonable defaults for a typical application. Luminus will also setup things like a logging configuration, authentication, databases, Swagger API, etc. I think the fact that these things aren't magically is a big plus. You can use the defaults, but you can trivially customize the middleware stack for your specific needs. Another thing to note is that a lot of the stuff that traditional frameworks do is geared towards doing presentation on the server. Modern apps tend to do presentation on the client, and the server primarily provides a set of stateless services for the client to fetch the data that it needs. With this approach, you don't really need a complex server framework in the first place.
- retrogradeorbit 11y agoUse destructuring to pull the needed values out of the ring request. For example: (defn login [{{:keys [email password]} :params session :session}] ...) Also remember as well as the :keys special form you have :strs and :syms. https://gist.github.com/john2x/e1dca953548bfdfb9844 https://gist.github.com/john2x/e1dca953548bfdfb9844