Chapter 4 Introducing ClojureScript

Web Development with Clojure, Third Edition — by Dmitri Sotnikov, Scot Brown (25 / 107)

The Pragmatic Programmers
The Pragmatic Programmers

--

👈 What You’ve L earned | TOC | Understand Cloj ureScript 👉

In the preceding chapters, we wrote a typical server-side web application and learned how its components interact with one another. In this chapter, we’ll look at ClojureScript and see how to use it to improve the way we write web applications.

As you’ve probably noticed, the separation between the client and the server portions of the application is not enforced. If we’re not careful, we could easily end up with tightly coupled client and server components. This could become a problem if we want to add a different client later on — for example, if we decided to create a native mobile version of our application.

Up to now, we’ve only been using Clojure on the back end. In this chapter we’ll look at ClojureScript, a dialect of Clojure that compiles to JavaScript. ClojureScript will allow us to bring Clojure to the browser. Let’s look at reasons why you might want to use ClojureScript for front-end development.

👈 What You’ve L earned | TOC | Understand Cloj ureScript 👉

Web Development with Clojure, Third Edition by Dmitri Sotnikov, Scot Brown can be purchased in other book formats directly from the Pragmatic Programmers. If you notice a code error or formatting mistake, please let us know here so that we can fix it.

--

--

The Pragmatic Programmers
The Pragmatic Programmers

We create timely, practical books and learning resources on classic and cutting-edge topics to help you practice your craft and accelerate your career.