Adventures in Clojurescript & React at Devoxx 2017

Join me for the Adventures in Clojurescript & React workshop at Devoxx 2017 on Friday 12th May, in Lab Room B from 11.15am until 1.15pm.

Together we will build a client-side web app using a React library and Clojurescript. Along the way I’ll cover the theory of React and the features of Clojurescript that make it a great language for development.

Read on to find out how to prepare for the workshop.

Development Environment

This workshop requires a few tools to be present in your development environment to start with:

Tool Version Test install (command line)
Java JRE or Java SE 8 java -version
Leiningen 2.7.1 lein version
Git Client 2.x git --version

Hint To install any of these tools, see the instructions later on in this article.

Clojure & ClojureScript are installed as libraries by Leiningen, so do not need to be installed directly.

Clojure Aware Editors

I recommend using a Clojure aware editor with REPL for the workshop, so you can follow the code and use structural editing features to navigate the code.

Background Recommended Editor
Java / Intellij Cursive
Web Developer using Atom Protorepl
Polyglot developer using Emacs / Vim Spacemacs
Developer with custom Emacs config CIDER
You just want something simple LightTable

I recommend using Emacs with Spacemacs and have a detailed workshop on how to get the most out of Spacemacs for Clojure development.

Installing Java JRE or SRE

Check you have a Java runtime on your system path by typing the following in a terminal window:

1
java -version

Install from Oracle or OpenJDK. Java may also be available via your operating systems package manger, for example on Ubuntu / Debian systems this would be installed via sudo apt-get install openjdk-8-jre

Leiningen

Leiningen is the most commonly used build automation tool used to manage Clojure projects. Install by saving the Leiningen install script and running it inside a terminal window.

For Linux and MacOSX, save the lein file on your operating system path, eg ~/bin and make the file executable

1
2
chmod a+x ~/bin/lein
lein

Run lein on the command line and a Java archive file (JAR) of the latest version of Leiningen is downloaded, completing the installation. When you run the script again, you have a working Leiningen build tool.

Figwheel

Figwheel is a Leiningen plugin that builds your ClojureScript code into Javascript and pushes change into the browser repl as you are coding!

Figwheel is a Leiningen plugin and is included via the leiningen template we will use to create the ClojureScript project.

Creating a Clojurescript project

In the workshop we will create a project using the Leiningen template called Chestnut. This template will provide sample code and more importantly download the libraries we will use to build the Clojurescript web site.

Create a project with the Chestnut template the following command

1
lein new chestnut my-project

You can replace my-project with your own name for the project should you wish.

Explore the project in your favourite editor once its created. Take a look at the README.md file for instructions on how to use the project with your specific environment. Also look at the project.clj file to see how a project is configured, along with the library dependencies included.

See you at Devoxx 2017

See you at Devoxx and if you have any questions in advance of the workshop, visit the Heroku booth during the event.

Thank you.
@jr0cket


This work is licensed under a Creative Commons Attribution 4.0 ShareAlike License, including custom images & stylesheets. Permissions beyond the scope of this license may be available at @jr0cket
Creative Commons License