This is a great book! I just bought the beta and read the whole thing, and I think it’s certainly the best all-around discussion for getting up and running with Clojure web development. What’s especially good is the pragmatic focus not just on easy things (like the concepts behind ring) but also stuff that’s more finicky or more tacitly understood (like typical organization of a noir app, typical deployment configurations, and tradeoffs around possible deployment configurations).
While this is where the book excels, it’s also where there’s opportunity to do even better. I think there a number of quite important topics that are neglected. Here’s my top list:
Authentication. There is no discussion of libraries for handling HTTP Basic authentication, which is pretty standard for anyone building an API endpoint.
HTTPS. There is no discussion of deployment configuration for using SSL/TLS, which is also pretty standard for any web app which handles passwords, including API endpoints.
Are they not mentioned because they’re hard to do given the current state of Clojure libraries? If so, that’s worth knowing! Or are they trivial? If so, then there should really be a paragraph or two to illustrate that. It’s certainly something that almost anyone building a real web app will need to know, unless they want passwords flying around in the clear.
No discussions of pros/cons of ahead-of-time compilation, as regards web app deployment. As I understand it, settings in your project file affect whether your app is AOT compiled. This in turn affects responsiveness in some environments, like Google App Engine. At least, this was my experience a while ago. I suspect there are some lurking issues like this, where Clojure’s execution model with its embedded run-time does not play nicely with a hosting environment out of the box, but requires some savvy tweaking.
Cloud deployments in general. Would be nice to see basic HelloWorld-level examples for Google App Engine, Amazone Elastic Beanstalk, etc.. Is Pallet or Jclouds worth a mention in this context?
Debugging in development. What’s the setup for the best interactive development experience developing a web app?
Debugging in production. Lisps are famous for offering you the ability to connect to a live system’s REPL and have a poke around to see what’s going on. It would be great if there were some discussion of (1) whether this is actually a useful/intelligent thing to do, (2) how to actually do it with the current Clojure web frameworks.
Async-oriented development. Frameworks like Pedestal, technologies like WebSockets, comparison with node.js, etc..
The fact is, the existing standard frameworks for standard websites (Rails, Django) are incredibly mature. Clojure is a lovely language but it is likely to be seen as a—shall we say?—adventurous choice for that kind of development, for the foreseeable future.
However, where Clojure is a more plausible choice for web development is for systems that have slightly different requirements: pure API endpoints talking to compute-intensive or Java-only services, newer stuff like WebSockets or single-page apps that are not very well-served by the older, established frameworks. It would be great to get a pragmatic take on whether there areas like these where Clojure is indeed an especially strong choice, where it’s not playing catch-up.
I’m super glad I bought this book. I hope it might expand to cover some of these areas as well! :)