Figwheel interface for Boot repl.
boot-figwheel currently intend to provide same api that exist in figwheel-sidecar.repl-api.
[ajchemist/boot-figwheel "0.5.4-6"] ;; latest release
[org.clojure/tools.nrepl "0.2.12" :scope "test"]
[com.cemerick/piggieback "0.2.1" :scope "test"]
[figwheel-sidecar "0.5.7" :scope "test"]figwheel-sidecar whose version is above 0.5.x would be well accepted.
NOTE: After version 0.5.0, boot-figwheel changed how the REPL dependencies are handled. For now user is required to add dependencies to one’s project which are necessary libraries. figwheel task will print the required dependecies when run. This change related to this.
(require 'boot-figwheel)
(refer 'boot-figwheel :rename '{cljs-repl fw-cljs-repl}) ; avoid some symbols(task-options!
figwheel
{:build-ids ["dev"]
:all-builds [{:id "dev"
:source-paths ["src"] ; cljs(cljc) directories
:compiler {:main 'app.core
:output-to "app.js"}
:figwheel {:build-id "dev"
:on-jsload 'app.core/main
:heads-up-display true
:autoload true
:debug false}}]
:figwheel-options {:open-file-command "emacsclient"
:repl true}})When users need to change their cljsbuild config on live, just eval (task-options! :figwheel {...}) at the time, and restart the figwheel.
If a user doesn’t supply build-ids options, figwheel-system will build all build configurations.
Now start a boot repl.
boot figwheel repl
figwheel task updates :output-to compiler option so that the build output locate in :target-path (default is “target”).
After the repl is started, ordinary dev routines follow.
boot.user> (start-figwheel!)
boot.user> (start-autobuild)
boot.user> (stop-autobuild)
boot.user> (fw-cljs-repl)
cljs.core> (fig-status)
cljs.core> :cljs/quit
...
boot.user> (task-options! :figwheel {...})
...
boot.user> (stop-figwheel!)
boot.user> (start-figwheel!)when (fw-cljs-repl) is an issue, then see #7.
- cljs-devtools-sample project
try with
boot demo
or
boot demo-figwheel repl
- rum-mdl project
- When
:optimizationsis not:none, then:output-dirwill not be configured by default.
- Separate
figwheeltask into two parts, one is a preamble and another is a middleware.
- [ BREAKING ] Integrate
boot-figwheelandfw-build-oncetask functionalities intofigwheeltask. - Add a new
figwheeltask-option, calledonce-idsto specify configurations which are going to be built once.
So now, please change following composed task
(comp
(figwheel)
(boot-figwheel :ids ["main"])
(fw-build-once :ids ["advanced"]))to this oneliner
(figwheel :build-ids ["main"] :once-ids ["advanced"])- [ BREAKING ] Now users should configure their
:source-pathsin:all-buildstask option.(get-env :source-paths)is no longer injected into user build configurations:source-paths. - Add new
boot-figwheeltask to run figwheel-system. Users can apply this task to cljs building on startup time. - Add new
fw-build-oncetask to build supplied ids once. Users can also apply this task on startup time.
(comp
(figwheel)
(boot-figwheel :ids ["main"]) ; -> "advanced" configuration is out of autobuilder
(fw-build-once :ids ["advanced"]))[:figwheel-options :css-dirs]should have explicit configuration if a user want to figwheel css watcher feature.
figwheel has now new task-option target-path for specifying explicit target-path.
And when
[:figwheel-options :http-server-root][:figwheel-options :css-dirs]
are not specifed, boot-figwheel uses "target" for those.
NOTE: Boot has recently had built-in target task for explicit emitting target, so now boot-figwheel can be cooperated with built-in watch task with (target :no-clean true). #4
- Both
:output-toand:output-dirwould be prefixed with:target-pathwhether they are specified or not. - Parent of
:output-dirwould be the same as the parent of:output-tounless:output-diris specifed. :asset-pathwould be prefixed with:target-pathonly if it’s not specified. (thx Antonis Kalou PR #2)
- [ BREAKING ] Figwheel has changed a lot since
0.5.0release. So boot-figwheel have had to adapt to it. Now boot-figwheel doesn’t make another pod forfigwheelandfigwheelruns on the same pod where your app runs. But figwheel-sidecar is only required when current boot task is compose offigwheeltask.
Copyright © 2015-2016 aJchemist
Licensed under Eclipse Public License.