ClojureScript is predominately used for front-end applications, although can also be used as full stack solutions using a Clojure or node.js back-end server.
Minor Language differences
Code which is independent of host can be written in Clojure common files, i.e.
*.cljc file name extension.
Clojure aware Editors also support ClojureScript. Use an editor most familiar with to minimise the initial learning curve.
Clojure aware editors have the same core functionality, so initial choice is not that important. As experience of ClojureScript grows, additional features can become valuable and a review of editor tooling can be done with more insight and understanding.
The main tools to support the ClojureScript workflow:
- Shadow-cljs - implementation of ClojureScipt for node.js and therefore deeply integrated into the npm infrastructure (initially more complex but potential simpler when managing a significant amount of npm packages and dependencies)
Using NPM packages does add complexity to a ClojureScript project, although enables access to a large repository of libraries.
figwheel-template creates ClojureScript projects with figwheel configuration and optionally react, reagent, rum and bundle (webpack) options.
Figwheel-main is library to use for Figwheel
Fighweel-main has replaced the figwheel library (now considered deprecated) and is a large rewrite of the tooling, providing a greatly enhanced experience.
Shadow-cljs is installed via an npm package and designed to work directly with other node.js packages. Projects are created using
npx create-cljs-project command.
Read the user guide in detail to avoid common issues when starting
As with any language, there are a wide range of choice for libraries to help build apps and many types of apps that can be built (UI / full-stacl / backend).
reagent is the most commonly used ClojureScript library for front-end apps, especially single page applications. reagent takes a react.js like approach.
re-frame builds upon reagent and supports the building of more complex UIs and stateful workflows.
reitit-frontend to define routing for URIs to support navigation within a ClojureScript app.