boot-clj/boot-figreload

Name: boot-figreload

Owner: boot-clj

Description: Boot task providing live-reload using Fighweel client

Created: 2017-01-03 21:12:40.0

Updated: 2018-04-12 11:20:57.0

Pushed: 2018-03-06 21:00:17.0

Homepage: null

Size: 194

Language: Clojure

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

boot-figreload

Clojars Project

Boot task to automatically reload resources in the browser when files in the project change. Featuring lein-figwheel.

Usage

Add dependency to build.boot and require the task:

-env! :dependencies '[[adzerk/boot-cljs "LATEST" :scope "test"]
                      [powerlaces/boot-figreload "LATEST" :scope "test"]
                      [pandeiro/boot-http "0.7.6" :scope "test"]

                      [adzerk/boot-cljs-repl "0.3.3" :scope "test"]
                      [com.cemerick/piggieback "0.2.1"  :scope "test"]
                      [weasel "0.7.0"  :scope "test"]
                      [org.clojure/tools.nrepl "0.2.12" :scope "test"]])

uire '[adzerk.boot-cljs          :refer [cljs]]
     '[adzerk.boot-cljs-repl     :refer [cljs-repl]]
     '[powerlaces.boot-figreload :refer [reload]]
     '[pandeiro.boot-http        :refer [serve]])

Add the task to your development pipeline before (cljs ...):

task dev []
omp (serve)
    (watch)
    (reload)
    (cljs-repl)
    (cljs :source-map true
          :optimizations :none)))
Dirac

Boot-figreload is compatible with Dirac, enabling REPL evaluation in-browser on top of Figwheel's reloading.

Your dev task could therefore become:

-env! :dependencies '[[adzerk/boot-cljs "LATEST" :scope "test"]
                      [powerlaces/boot-figreload "LATEST" :scope "test"]
                      [pandeiro/boot-http "0.7.6" :scope "test"]

                      ;; Dirac and cljs-devtoos
                      [binaryage/dirac "RELEASE" :scope "test"]
                      [binaryage/devtools "RELEASE" :scope "test"]
                      [powerlaces/boot-cljs-devtools "0.2.0" :scope "test"]

                      [adzerk/boot-cljs-repl "0.3.3" :scope "test"]
                      [com.cemerick/piggieback "0.2.1"  :scope "test"]
                      [weasel "0.7.0"  :scope "test"]

                      ;; Has to be `0.2.13`
                      [org.clojure/tools.nrepl "0.2.13" :scope "test"]])

uire '[adzerk.boot-cljs              :refer [cljs]]
     '[adzerk.boot-cljs-repl         :refer [cljs-repl]]
     '[powerlaces.boot-figreload     :refer [reload]]
     '[powerlaces.boot-cljs-devtools :refer [dirac cljs-devtools]]
     '[pandeiro.boot-http            :refer [serve]])



task dev [D with-dirac bool "Enable Dirac Devtools."]
omp (serve)
    (watch)
    (cljs-devtools)
    (reload)
    (if-not with-dirac
      (cljs-repl)
      (dirac))
    (cljs :source-map true
          :optimizations :none
          :compiler-options {:external-config
                             {:devtools/config {:features-to-install [:formatters :hints]
                                                :fn-symbol "?"
                                                :print-config-overrides true}}})))
Node.js

It should work out of the box. Two things to be aware of:

Figwheel Integration Status

Ok this is a super alpha of the figwheel client in boot-reload.

At the moment the implemented server to client messages are:

Whereas the implemented client to server messages are:

Other tasks to complete:
To be thorougly tested:
Additional Info

You can see the options available on the command line:

 reload --help

or in the REPL:

.user=> (doc reload)
Examples

For an up-to-date demo project check figreload-demo.

Legacy examples of how to use reload in development can be useful as well. See Boot templates and example projects in the ClojureScript wiki.

License

Copyright © 2014 Adzerk
Copyright © 2015-2016 Juho Teperi
Copyright © 2017 Juho Teperi and Andrea Richiardi

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.