Community Tools and Templates for Clojure CLI Tools

There are a number of tools from the Clojure community which add build tool features to the Clojure CLI tools. This enables developers to have a very lightweight and customisable set of tools that just do what they need.

This article just covers the very basics of each tool, see each projects documentation to get the full benefit of each tool.

  • depot finds newer versions of libraries (from Clojars and Git repositories)
  • kaocha full featured next gen Clojure test runner
  • depstar to package up your application for the JVM platform

Please see earlier articles in this series for background:

Read More

Development Workflow With Clojure CLI Tools

Continuing our exploration with Clojure CLI tools, we will discuss what what templates are available to help us create project, Then we will create a new ClojureScript project using figwheel-main and show the different builds we can use to provide several workflows for developing, testing and deploying an application.

We will create a new project using the figwheel-main template, explaining that we need to specify organisation/project-name or organisation.project-name for the clj-new templates to work properly.

Then run the project using the -A:fig:build alias to run with rebel readline to our user account version of deps.edn so it is available for all projects. Then we will run a test runner and see the auto-testing monitoring. Finally we will show ways to configure a deploy workflow that we can use with GitHub

This article is also covered in Practicalli Clojure study group #38 video

Please see earlier articles in this series for background:

Read More

A Deeper Understanding of Clojure CLI Tools

CLI tools make Clojure very accessible and simple to install as they are a essentially a wrapper for running Clojure code using the java command and use additional libraries to manage dependencies, class paths, create projects and build java archive (jar) files.

Its quite common to use the java command to run your code in production, usually defined in a shell script. Leiningen can be used to run your application in production too, however, because Leiningen creates 2 JVM instances (one for itself and one for the application), its more efficient to just use the java command.

Leiningen does provides a very rich set of templates that speed up development with Clojure and has a multitude of plugins. Plugins provide a rich source of features but they are not very composable, especially compared to the Clojure language itself.

Clojure CLI tools provide a minimal but elegant layer on top of the java command and enables libraries, configuration and code to compose together just like Clojure functions. So we will continuing the exploration of Clojure CLI tools and dig a little deeper under the covers to understand how they work and how to configure projects to be very flexible, especially the different sources of code you can use .

This article follows on from getting started with Clojure CLI tools

Read More

CIDER Jack-in to Clojure CLI Projects From Spacemacs

Running a Clojure project created with CLI tools or clj-new may require you to pass in an alias for the REPL to pick up the right libraries.

A few days ago I created a new ClojureScript and reagent project, using the Clojure CLI tools and clj-new project creation tool, which converts Leiningen and Boot templates into a deps.edn based project. Unfortunately when I created a project from the fighwheel-main template the REPL failed to run from CIDER using cider-jack-in-cljs, saying that figwheel-main was not found. All that was required was to specify the :fig alias when running a REPL.

This article covers two approaches to running Clojure CLI projects from CIDER jack-in that require setting of an alias or multiple aliases e.g. -A:fig:build:party:hammock

See Getting started with Clojure CLI tools for background to this article.

Read More

Getting Started With Clojure CLI Tools

Clojure Command Line Interface (CLI) tools provide a fast way for developers to get started with Clojure and simplify an already pretty simple experience. With tools.deps it also provides a more flexible approach to including libraries, including the use of code from a specific commit in a Git repository.

Practicalli Clojure 35 - Clojure CLI tools - an introduction is a video of a live broadcast of this content (inclucing typos)

Clojure CLI tools provide:

  • Running an interactive REPL (Read-Eval-Print Loop)
  • Running Clojure programs
  • Evaluating Clojure expressions
  • Managing dependencies via tools.deps

Clojure CLI tools allow you to use other libraries to, referred to as dependencies or ‘deps’. These may be libraries you are writing locally, projects in git (e.g. on GitHub) or libraries published to Maven Central or Clojars.

The Clojure CLI tools can cover the essential features of Clojure Build tools Leiningen and Boot, but are not designed as a complete replacement. Both these build tools are mature and may have features you would otherwise need to script in Clojure CLI tools.

This article is a follow on from new Clojure REPL Experience With Clojure CLI Tools and Rebel Readline

Read More

Clojurex Cfp 2019 - Share Your Experiences

ClojureX conference is a great opportunity to meet and exchange ideas with other Clojure developers at a supportive and friendly conference. As well as learning all the latest technology in the Clojureverse, its a once a year chance to meet other developers in London to build new relationships and renew existing friendships.

We want to hear your experiences with Clojure/ClojureScript in what ever form, as well as any related topics. Have you created some neat technology or discovered a useful practice? Are you working on challenging or innovative projects? Every developers journey with Clojure and functional programming is different, so you will have learnt something that others haven’t and so we encourage you to share.

Submit your talk proposal via the CfP Google form

Deadline for the CfP submission is Monday 24th June 2019.

Read More

REPL Driven Development With Clojure

Clojure is a powerful, fun and highly productive language for developing applications and services. The clear language design is supported by a powerful development environment known as the REPL (read, evaluate, print, loop). The REPL gives you instant feedback on what your code does and enables you to test either a single expression or run the whole application (including tests).

The approach I take is called REPL driven development and I’ll explain that here in detail.

Read More

New Clojure REPL Experience With Clj Tools and Rebel Readline

A REPL is the foundation of the Clojure coding experience. The REPL provides a runtime environment where you can instantly get the results of evaluating your code. You can write code in a REPL too, although typically code is written editor and sent to a REPL to be evaluated. When you start coding, the first step is to run the REPL and keep it running until you are finished.

A REPL is the same environment used for running your Clojure applications too.

Lets look at the newest and fastest approach to running a Clojure REPL, the Clojure CLI Tools and rebel-readline.

Read More

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.

Read More