Figwheel Projectsλ︎
A ClojureScript project should contain dependencies for the Clojure and ClojureScript libraries, which are managed by the build tool (Clojure CLI tools or Leiningen) just like any other dependency.
figwheel-main provides additional tooling for REPL driven development, including live updates to the browser REPL and test runner.
Use the figwheel-main
template to generate a working ClojureScript project with Figwheel-main, optionally including reagent and other react.js style libraries.
Figwheel-mainλ︎
Figwheel Main compiles the project when first run and creates a JavaScript application that is launched in the browser.
On every save of ClojureScript code figwheel-main automatically compiles the changes and injects them into the JavaScript application running in the browser, providing instant feedback as the project developers.
figwheel and figwheel-main
figwheel is the original tool that has been replaced by figwheel-main. The configuration between the two tools is incompatible, however, the ClojureScript code should work when migrated to a figwheel-main project configuration.
Figwheel templateλ︎
figwheel-main
template creates a Clojurescript project with configuration to run the Figwheel-main build tool.
The figwheel-main template takes several options, --reagent
, --rum
and --om
, each of which creates a basic project with the respective libraries.
The --
between the project name and --reagent
option ensures this option is passed to the template, rather than being passed to Leiningen itself.
With Practicalli Clojure CLI config installed, a ClojureScipt project with figwheel and reagent is created with the follwoign command in a terminal
Working with Editorsλ︎
Clojure aware editors support ClojureScript too.
Run project via terminal if issues using an editor
Running a ClojureScript project on the command line is a quick way to ensure the ClojureScipt project works, should there be issues with the configuration of an Editor
Referenceλ︎
- Interactive programming Flappy Birds in ClojureScript
- Clojure West 2015 - Developing ClojureScript with Figwheel
Google Closure Compiler
ClojureScript uses the Google Closure compiler and build tools that require a Java Virtual machine. The Google Clojure tools provide highly optimal JavaScript code and eliminates and code not called from the final build.
Self-hosted options include Plank and Lumo. ClojureScript Next and Bootstrapped ClojureScript FAQ elaborate on the advantages and challenges for self-hosted ClojureScript.