{"id":13544040,"url":"https://github.com/boot-clj/boot-figreload","last_synced_at":"2025-08-24T05:07:57.892Z","repository":{"id":62434264,"uuid":"77953819","full_name":"boot-clj/boot-figreload","owner":"boot-clj","description":"Boot task providing live-reload using Fighweel client","archived":false,"fork":false,"pushed_at":"2018-03-06T21:00:17.000Z","size":194,"stargazers_count":50,"open_issues_count":5,"forks_count":1,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-04-18T22:51:42.875Z","etag":null,"topics":["boot","boot-tasks","clojure","clojurescript","figwheel","hot-reload","javascript","livereload"],"latest_commit_sha":null,"homepage":null,"language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/boot-clj.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-03T21:12:40.000Z","updated_at":"2025-02-28T22:58:25.000Z","dependencies_parsed_at":"2022-11-01T21:01:52.861Z","dependency_job_id":null,"html_url":"https://github.com/boot-clj/boot-figreload","commit_stats":null,"previous_names":[],"tags_count":38,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boot-clj%2Fboot-figreload","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boot-clj%2Fboot-figreload/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boot-clj%2Fboot-figreload/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boot-clj%2Fboot-figreload/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/boot-clj","download_url":"https://codeload.github.com/boot-clj/boot-figreload/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251638811,"owners_count":21619667,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["boot","boot-tasks","clojure","clojurescript","figwheel","hot-reload","javascript","livereload"],"created_at":"2024-08-01T11:00:41.192Z","updated_at":"2025-04-30T07:42:27.749Z","avatar_url":"https://github.com/boot-clj.png","language":"Clojure","funding_links":[],"categories":["Features"],"sub_categories":[],"readme":"# boot-figreload\n[![Clojars Project](https://img.shields.io/clojars/v/powerlaces/boot-figreload.svg)](https://clojars.org/powerlaces/boot-figreload)\n\n[Boot][1] task to automatically reload resources in the browser when files in\nthe project change. Featuring [lein-figwheel][2].\n\n* Provides the `reload` task\n* Reload client can show warnings and exceptions from ClojureScript build on **heads-up display**.\n    * Requires `adzerk/boot-cljs` \u003e= `2.0.0`\n\n## Usage\n\nAdd dependency to `build.boot` and `require` the task:\n\n```clj\n(set-env! :dependencies '[[adzerk/boot-cljs \"LATEST\" :scope \"test\"]\n                          [powerlaces/boot-figreload \"LATEST\" :scope \"test\"]\n                          [pandeiro/boot-http \"0.7.6\" :scope \"test\"]\n\n                          [adzerk/boot-cljs-repl \"0.3.3\" :scope \"test\"]\n                          [com.cemerick/piggieback \"0.2.1\"  :scope \"test\"]\n                          [weasel \"0.7.0\"  :scope \"test\"]\n                          [org.clojure/tools.nrepl \"0.2.12\" :scope \"test\"]])\n\n(require '[adzerk.boot-cljs          :refer [cljs]]\n         '[adzerk.boot-cljs-repl     :refer [cljs-repl]]\n         '[powerlaces.boot-figreload :refer [reload]]\n         '[pandeiro.boot-http        :refer [serve]])\n```\n\nAdd the task to your development pipeline **before `(cljs ...)`**:\n\n```clj\n(deftask dev []\n  (comp (serve)\n        (watch)\n        (reload)\n        (cljs-repl)\n        (cljs :source-map true\n              :optimizations :none)))\n```\n\n### Dirac\n\nBoot-figreload is compatible with Dirac, enabling REPL evaluation in-browser on top of Figwheel's reloading.\n\nYour `dev` task could therefore become:\n\n```clj\n(set-env! :dependencies '[[adzerk/boot-cljs \"LATEST\" :scope \"test\"]\n                          [powerlaces/boot-figreload \"LATEST\" :scope \"test\"]\n                          [pandeiro/boot-http \"0.7.6\" :scope \"test\"]\n\n                          ;; Dirac and cljs-devtoos\n                          [binaryage/dirac \"RELEASE\" :scope \"test\"]\n                          [binaryage/devtools \"RELEASE\" :scope \"test\"]\n                          [powerlaces/boot-cljs-devtools \"0.2.0\" :scope \"test\"]\n\n                          [adzerk/boot-cljs-repl \"0.3.3\" :scope \"test\"]\n                          [com.cemerick/piggieback \"0.2.1\"  :scope \"test\"]\n                          [weasel \"0.7.0\"  :scope \"test\"]\n\n                          ;; Has to be `0.2.13`\n                          [org.clojure/tools.nrepl \"0.2.13\" :scope \"test\"]])\n\n(require '[adzerk.boot-cljs              :refer [cljs]]\n         '[adzerk.boot-cljs-repl         :refer [cljs-repl]]\n         '[powerlaces.boot-figreload     :refer [reload]]\n         '[powerlaces.boot-cljs-devtools :refer [dirac cljs-devtools]]\n         '[pandeiro.boot-http            :refer [serve]])\n\n...\n\n(deftask dev [D with-dirac bool \"Enable Dirac Devtools.\"]\n  (comp (serve)\n        (watch)\n        (cljs-devtools)\n        (reload)\n        (if-not with-dirac\n          (cljs-repl)\n          (dirac))\n        (cljs :source-map true\n              :optimizations :none\n              :compiler-options {:external-config\n                                 {:devtools/config {:features-to-install [:formatters :hints]\n                                                    :fn-symbol \"λ\"\n                                                    :print-config-overrides true}}})))\n\n```\n\n## Node.js\n\nIt should work out of the box. Two things to be aware of:\n\n * you need to have a `main.cljs.edn` like:\n\n   ```clojure\n   {:compiler-options {:target :nodejs}\n    :init-fns [server.core/main]}\n   ```\n\n * you need to launch your built artifact using node:\n\n   ```shell\n   $ cd target\n   $ node main.js\n   ```\n\n## Figwheel Integration Status\n\nOk this is a super alpha of the figwheel client in `boot-reload`.\n\nAt the moment the implemented server to client messages are:\n\n- [x] `:files-changed`\n- [x] `:compile-warning`\n- [x] `:compile-failed`\n- [x] `:css-files-changed`\n\nWhereas the implemented [client to server](https://github.com/arichiardi/lein-figwheel/blob/boot-reload-changes/sidecar/src/figwheel_sidecar/components/figwheel_server.clj#L75) messages are:\n\n- [ ] `\"file-selected\"`\n- [ ] `\"callback\"`\n\n### Other tasks to complete:\n\n- [x] Inject the Figwheel bootstrap script\n- [x] Handle individual `js-onload` per build id (untested but there)\n- [x] Figwheel version\n- [x] Use Figwheel [init code](https://github.com/bhauman/lein-figwheel/blob/cc2d188ab041fc92551d3c4a8201729c47fe5846/sidecar/src/figwheel_sidecar/build_middleware/injection.clj#L171) (?)\n- [ ] Handle `boot-reload`'s `:asset-host` in Figwheel ([link to comments](https://github.com/adzerk-oss/boot-reload/commit/e27e330d9f688875ba19d56e825cd9e81013e58e#commitcomment-20350456))\n- [ ] Pass the right `:open-file` option to Figwheel\n- [ ] Solve the \"first message lost\" problem with a message queue (?)\n- [x] Assert needed dependencies\n- [ ] Repl integration (at the moment supported via [boot-cljs-repl][3])\n\n### To be thorougly tested:\n\n- [x] Node client\n- [ ] Web-worker client\n- [ ] Trigger of multiple `js-onload`s\n\n## Additional Info\n\nYou can see the options available on the command line:\n\n```bash\nboot reload --help\n```\n\nor in the REPL:\n\n```clj\nboot.user=\u003e (doc reload)\n```\n\n## Examples\n\nFor an up-to-date demo project check [figreload-demo][4].\n\nLegacy examples of how to use `reload` in development can be useful as well. See\n[Boot templates and example projects][5] in the ClojureScript wiki.\n\n## License\n\nCopyright \u0026copy; 2014 Adzerk\u003cbr\u003e\nCopyright \u0026copy; 2015-2016 Juho Teperi\u003cbr\u003e\nCopyright \u0026copy; 2017 Juho Teperi and Andrea Richiardi\n\nDistributed under the Eclipse Public License either version 1.0 or (at\nyour option) any later version.\n\n[1]:                https://github.com/boot-clj/boot\n[2]:                https://github.com/bhauman/lein-figwheel\n[3]:                https://github.com/adzerk-oss/boot-cljs-repl\n[4]:                https://github.com/arichiardi/figreload-demo\n[5]:                https://github.com/clojure/clojurescript/wiki#boot\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboot-clj%2Fboot-figreload","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fboot-clj%2Fboot-figreload","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboot-clj%2Fboot-figreload/lists"}