All Projects → boot-clj → Boot Figreload

boot-clj / Boot Figreload

Licence: epl-1.0
Boot task providing live-reload using Fighweel client

Programming Languages

javascript
184084 projects - #8 most used programming language
clojure
4091 projects
clojurescript
191 projects

Projects that are alternatives of or similar to Boot Figreload

universal-hot-reload
Hot reload client and server webpack bundles for the ultimate development experience
Stars: ✭ 79 (+58%)
Mutual labels:  livereload, hot-reload
Boot Reload
Boot task providing live-reload of browser css, images, etc.
Stars: ✭ 90 (+80%)
Mutual labels:  livereload, hot-reload
hot-reload
Hot reload development for Go
Stars: ✭ 72 (+44%)
Mutual labels:  livereload, hot-reload
Flexlib
FlexLib是一个基于flexbox模型,使用xml文件进行界面布局的框架,融合了web快速布局的能力,让iOS界面开发像写网页一样简单快速
Stars: ✭ 1,569 (+3038%)
Mutual labels:  livereload, hot-reload
Jet Live
c++ hot code reload for linux and macos
Stars: ✭ 283 (+466%)
Mutual labels:  livereload, hot-reload
Mac Linux Usb Loader
Boot Linux on your Mac, easily
Stars: ✭ 854 (+1608%)
Mutual labels:  boot
Elm Live
⚡ A flexible dev server for Elm. Live reload included.
Stars: ✭ 973 (+1846%)
Mutual labels:  livereload
Systemjs Hmr
Hot Module Replacement for SystemJS
Stars: ✭ 24 (-52%)
Mutual labels:  hot-reload
Floppybird
Floppy Bird (OS)
Stars: ✭ 836 (+1572%)
Mutual labels:  boot
Debootstick
Generate a bootable live image from any Debian/Ubuntu filesystem tree.
Stars: ✭ 48 (-4%)
Mutual labels:  boot
Deku
⛄️ No-bundle Dev Server for ES modules with deno.
Stars: ✭ 43 (-14%)
Mutual labels:  hot-reload
Got Reload
Reload Go code in a running process at function/method level granularity, using Yaegi
Stars: ✭ 29 (-42%)
Mutual labels:  hot-reload
Livereactload
Live code editing with Browserify and React
Stars: ✭ 870 (+1640%)
Mutual labels:  livereload
Spring Boot
spring-boot 项目实践总结
Stars: ✭ 989 (+1878%)
Mutual labels:  boot
Cr
cr.h: A Simple C Hot Reload Header-only Library
Stars: ✭ 845 (+1590%)
Mutual labels:  hot-reload
Slater Theme
Shopify Starter theme based on slate
Stars: ✭ 47 (-6%)
Mutual labels:  livereload
Proxy Hot Reload
Node.js application hot reload with `Proxy`.
Stars: ✭ 19 (-62%)
Mutual labels:  hot-reload
Hr4r
Example project - "Hot Reloading 4 RequireJS" front-end web applications & some extra code demonstrating hot-reloading for Node.js Express servers
Stars: ✭ 28 (-44%)
Mutual labels:  hot-reload
Pmbootstrap
Repository has been moved! https://postmarketos.org/move.html#/pmbootstrap 🚚 🚚 🚚
Stars: ✭ 1,010 (+1920%)
Mutual labels:  boot
Hot Loader Demo
React Hot Loader 3 minimal demo
Stars: ✭ 27 (-46%)
Mutual labels:  hot-reload

boot-figreload

Clojars Project

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

  • Provides the reload task
  • Reload client can show warnings and exceptions from ClojureScript build on heads-up display.
    • Requires adzerk/boot-cljs >= 2.0.0

Usage

Add dependency to build.boot and require the task:

(set-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"]])

(require '[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 ...):

(deftask dev []
  (comp (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:

(set-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"]])

(require '[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]])

...

(deftask dev [D with-dirac bool "Enable Dirac Devtools."]
  (comp (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:

  • you need to have a main.cljs.edn like:

    {:compiler-options {:target :nodejs}
     :init-fns [server.core/main]}
    
  • you need to launch your built artifact using node:

    $ cd target
    $ node main.js
    

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:

  • [x] :files-changed
  • [x] :compile-warning
  • [x] :compile-failed
  • [x] :css-files-changed

Whereas the implemented client to server messages are:

  • [ ] "file-selected"
  • [ ] "callback"

Other tasks to complete:

  • [x] Inject the Figwheel bootstrap script
  • [x] Handle individual js-onload per build id (untested but there)
  • [x] Figwheel version
  • [x] Use Figwheel init code (?)
  • [ ] Handle boot-reload's :asset-host in Figwheel (link to comments)
  • [ ] Pass the right :open-file option to Figwheel
  • [ ] Solve the "first message lost" problem with a message queue (?)
  • [x] Assert needed dependencies
  • [ ] Repl integration (at the moment supported via boot-cljs-repl)

To be thorougly tested:

  • [x] Node client
  • [ ] Web-worker client
  • [ ] Trigger of multiple js-onloads

Additional Info

You can see the options available on the command line:

boot reload --help

or in the REPL:

boot.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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].