Web Development with Clojure, Third Edition
Build Large, Maintainable Web Applications Interactively
by Dmitri Sotnikov, Scot Brown
Version: P1.0 (July 2021)
Copyright 2021 The Pragmatic Programmers, LLC. This book is licensed to the individual who purchased it. We don't copy-protect it because that would limit your ability to use it for your own purposes. Please don't break this trustyou can use this across all of your devices but please do not share this copy with other members of your team, with friends, or via file sharing services. Thanks.
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and The Pragmatic Programmers, LLC was aware of a trademark claim, the designations have been printed in initial capital letters or in all capitals. The Pragmatic Starter Kit, The Pragmatic Programmer, Pragmatic Programming, Pragmatic Bookshelf and the linking g device are trademarks of The Pragmatic Programmers, LLC.
Every precaution was taken in the preparation of this book. However, the publisher assumes no responsibility for errors or omissions, or for damages that may result from the use of information (including program listings) contained herein.
About the Pragmatic Bookshelf
The Pragmatic Bookshelf is an agile publishing company. Were here because we want to improve the lives of developers. We do this by creating timely, practical titles, written by programmers for programmers.
Our Pragmatic courses, workshops, and other products can help you and your team create better software and have more fun. For more information, as well as the latest Pragmatic titles, please visit us at http://pragprog.com.
Our ebooks do not contain any Digital Restrictions Management, and have always been DRM-free. We pioneered the beta book concept, where you can purchase and read a book while its still being written, and provide feedback to the author to help make a better book for everyone. Free resources for all purchasers include source code downloads (if applicable), errata and discussion forums, all available on the book's home page at pragprog.com. Were here to make your life easier.
New Book Announcements
Want to keep up on our latest titles and announcements, and occasional special offers? Just create an account on pragprog.com (an email address and a password is all it takes) and select the checkbox to receive newsletters. You can also follow us on twitter as @pragprog.
About Ebook Formats
If you buy directly from pragprog.com, you get ebooks in all available formats for one price. You can synch your ebooks amongst all your devices (including iPhone/iPad, Android, laptops, etc.) via Dropbox. You get free updates for the life of the edition. And, of course, you can always come back and re-download your books when needed. Ebooks bought from the Amazon Kindle store are subject to Amazon's polices. Limitations in Amazon's file format may cause ebooks to display differently on different devices. For more information, please see our FAQ at pragprog.com/#about-ebooks. To learn more about this book and access the free resources, go to https://pragprog.com/book/dswdcloj3, the book's homepage.
Thanks for your continued support,
Andy Hunt
The Pragmatic Programmers
The team that produced this book includes: Dave Rankin (CEO) Janet Furlow (COO) Tammy Coron (Managing Editor) Michael Swaine (Development Editor) L. Sakhi MacMillan (Copy Editor) Potomac Indexing, LLC (Indexing) Gilson Graphics (Layout) Andy Hunt and Dave Thomas (Founders)
For customer support, please contact .
For international rights, please contact .
Table of Contents
Copyright 2021, The Pragmatic Bookshelf.
Praise for Web Development with Clojure, 3rd Edition
Luminus has been the go-to web development toolkit for Clojure for years, and its author, Dmitri Sotnikov (with Third Edition co-author Scot Brown), in Web Development with Clojure, has the go-to book on developing in Clojure for the web. Complete, comprehensive, accessible: dont go out there without it.
Simon Brooke |
Chair, Standingstone Farm Ltd |
Web Development with Clojure is a great, thorough introduction to this complex topic, which is as interesting as it can be confusing, especially when starting out. The possibilities are endless, so it really helps to be introduced to some best practices by an experienced Clojure developer. I also bought the previous editions and have found Web Development with Clojure to be invaluable in my quest to use Clojure for modern web applications!
Maximilian Gerlach |
Senior Technical Architect, Ada Inc. |
If youre new to Clojure, the Clojure communitys assemble-your-own-web-framework culture can be frustrating, forcing you to guess at which libraries to use and patch together what you can from online tutorials. The Luminus micro-framework bundles together the communitys preferred libraries and has become the recommended starting place for new Clojure developers. With the creator of Luminus as your guide, Web Development with Clojure provides a comprehensive and realistic walk-through of how to build a web application in the Clojure ecosystem in 2021.
Rafal Dittwald |
Partner, Bloom Ventures |
Web Development with Clojure, 3rd Edition is the book you need for learning to write single-page apps in Clojure/Script. Well-paced, interactive, and covering everything from basics to structuring and deploying real-lifeweb projects. New tools, new libraries, and lots of new content. Highly recommended.
Acknowledgments
In the case of this book, theres no false modesty. We genuinely have to thank a great many folk who have helped make it possible. The volume of feedback we received shaped the book and made it far more useful than it would have been otherwise.
Dmitri would like to thank his beautiful wife, Linda. She spent many hours helping him refine the book. It simply would not have been the same without her oversight.
Scot would like to thank his wonderful partner Christina for her support and patience through this journey. This book would not have been possible without her.
The Pragmatic Bookshelf team has our thanks for their guidance and insight. Wed like to call out Mike Swaine in particular for his suggestions and constant demand for quality throughout the process. Wed also like to thank Sakhi MacMillan for her thorough copyediting and valuable feedback on the drafts.
We were lucky to have a team of highly experienced technical reviewers who were willing to ask tough questions. Thank you, Tommi Reiman, Maximilian Gerlach, Rafal Dittwald, and Simon Brooke.
Finally, we owe a big thanks to the beta readers who chose to put their trust in us. Their feedback helped elevate this book to a higher standard.
Were proud to put our names on this book. Thank you to all the people whove taken this journey with us. Our sincere respect and gratitude goes out to all of you.
Copyright 2021, The Pragmatic Bookshelf.
Introduction
The cover of this book has a bonsai tree on it.We chose it to represent elegance and simplicity because these qualities make Clojure such an attractive language.A good software project is like a bonsai.You have to meticulously craft it to take the shape you want, and the tool you use should make it a pleasant experience.We hope to convince you here that Clojure is that tool.