A Leiningen template for projects using Reagent.
A Leiningen template for a minimal ClojureScript app based on Reagent. If you wish to create a project with a Clojure backend then consider using the reagent-template instead.
For any questions or discussion please come join us at the Reagent Google Group.
Create a new application project with shadow-cljs:
lein new reagent-frontend <name> +shadow-cljs
To start the app in development mode run:
npx shadow-cljs watch app
npx shadow-cljs release app
Create a new application project with Figwheel:
lein new reagent-frontend <name> +figwheel
To start the Figwheel compiler, navigate to the project folder and run the following command in the terminal:
lein figwheel
Figwheel will automatically push cljs changes to the browser.
Once Figwheel starts up, you should be able to open the public/index.html
page in the browser and see the changes refresh live. Alternatively, you could run python -m SimpleHTTPServer
in the public
folder.
lein clean
lein package
The project is setup to start nREPL on port 7002
once Figwheel starts.
Once you connect to the nREPL, run (cljs)
to switch to the ClojureScript REPL.
The template packages everything you need to create a production ready ClojureScript application following current best practices. The template uses the following features and libraries:
Take a look at the open issues, especially ones marked as help wanted
. If you see one you'd like to address don't hesitate to start a discussion or submit a pull request.
If the template isn't doing quite what you're looking for, it's easy to create a local copy of your own following these simple steps:
git clone https://github.com/reagent-project/reagent-template.git
cd reagent-frontend-template
lein install
If you feel that your customizations are general enough to be useful for others then please consider making a pull request.
Copyright © 2015 Dmitri Sotnikov
Distributed under the The MIT License (MIT).
Can you improve this documentation? These fine people already did:
dmitri.sotnikov@gmail.com, Dmitri Sotnikov, Yogthos, Gokul & Sotnikov, DmitriEdit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close