This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-10-16
Channels
- # beginners (1)
- # boot (69)
- # carry (1)
- # cider (29)
- # cljs-dev (17)
- # cljsrn (100)
- # clojure (13)
- # clojure-austin (13)
- # clojure-brasil (1)
- # clojure-dev (1)
- # clojure-korea (3)
- # clojure-russia (3)
- # clojure-spec (20)
- # clojure-uk (5)
- # clojurescript (45)
- # cloverage (3)
- # datomic (5)
- # figwheel (1)
- # hoplon (198)
- # klipse (25)
- # lein-figwheel (2)
- # leiningen (3)
- # off-topic (35)
- # om (7)
- # om-next (2)
- # onyx (8)
- # proton (8)
- # re-frame (3)
- # untangled (1)
- # vim (13)
Is it possible to use Figwheel with boot? I'd like to get the awesome error messages and helpers in the heads up display
@grounded_sage there is a boot-fighweel
task and I have wanted to try it out for long time now...I don't have any feedback yet on it, but if you try please report back ok?
Will do haven't been able to get the demo to work yet as I was wanting to use that as a baseline to work off. Going to have a little hack at it tomorrow
(require ‘[example.main])
(deftask
run-main
[]
(with-pass-thru
_
(example.main/-main)))
@piotrek try putting this into your build.boot
: (load-data-readers!)
@martinklepsch Is it a boot’s function?
yeah I think it's defined in boot.core
Yeah, it helped. Thanks @martinklepsch
If you search the issues on github you can find out why that is required, I don't exactly remember right now :)
^^ it's because clojure itself runs its own function to scan the classpath for data_readers.clj files when clojure first starts, but in boot you mostly add dependency jars after clojure itself is already loaded, so you need to call it yourself
hi! how can i specify serve directory of boot-http
within the build.boot
?
@olegakbarov usually you want to serve from the classpath i think
i’m working on a lib and would like to run different “examples”
i mean i have examples
folder, and different snippets there
yeah, that would be perfect
boot.user=> (doc serve)
-------------------------
pandeiro.boot-http/serve
([& {:as *opts*, :keys [help dir handler init cleanup resource-root port httpkit silent reload nrepl not-found]}])
Start a web server on localhost, serving resources and optionally a directory.
Listens on port 3000 by default.
Keyword Args:
:help bool Print this help info.
:dir str The directory to serve; created if doesn't exist.
:handler sym The ring handler to serve.
:init sym A function to run prior to starting the server.
:cleanup sym A function to run after the server stops.
:resource-root str The root prefix when serving resources from classpath
:port int The port to listen on. (Default: 3000)
:httpkit bool Use Http-kit server instead of Jetty
:silent bool Silent-mode (don't output anything)
:reload bool Reload modified namespaces on each request.
:nrepl edn nREPL server parameters e.g. "{:port 3001, :bind "0.0.0.0"}"
:not-found sym a ring handler for requested resources that aren't in your directory. Useful for pushState.
should i pass it as follows?
(deftask run []
(comp (serve {:dir “examples"})
(watch)
(cljs-repl)
(reload)
(cljs)))
(deftask run []
(comp (serve :dir "target/examples")
(watch)
(cljs-repl)
(reload)
(cljs)
(target)))
because :dir
refers to a directory in the filesystem, rather than a path in the classpath
it can be time consuming when you don't need it and have a lot of files, and nowadays it's rarely needed
and when i deploy i also don't really need files because i'm pushing artifacts to the cloud
I wonder if the majority of workflows use target and would've benefited from the convention; true in my case, but I wonder if it causes problems with other use cases
@olegakbarov ^^ @pandeiro made boot-http
also the issue of what to do when you implicitly emit artifacts to target and there are two instances of boot running
i got one more (newbie) question: how can i make my lib visible inside examples
folder?
currently got this:
adzerk.boot_cljs.util.proxy$clojure.lang.ExceptionInfo$ff19274a: ERROR: No such namespace: cljs-dnd.core, could not locate cljs_dnd/core.cljs, cljs_dnd/core.cljc, or Closure namespace "cljs-dnd.core" in file /Users/oleg/.boot/cache/tmp/Users/oleg/code/cljs-dnd/p1d/-rcsl8f/sort.cljs at file examples/sort.cljs
@olegakbarov i'm curious why you don't have an index page that lets you choose the example you want, with all examples served?
at the moment it is kinda a mess
let me try to clean this up
5 mins, i’ll push current state to github 🙂
https://github.com/olegakbarov/cljs-dnd
so my goal is to set up dev
task to serve one of examples and to have cljs-dnd
required as lib
pretty sure this is wrong:
(deftask development []
;; should run examples
(task-options! cljs {:optimizations :none :source-map true}
reload {:on-jsload 'cljs-dnd/examples.sort/mount-root})
identity)
why not build all examples and serve them, and let the user choose which example they want to see via links from an index page?
that might work as well
so you'd just create in resources/examples
one .cljs.edn
file and one index.html
file per example
how can i require cljs-dnd.core
inside examples
?
got :
ERROR: No such namespace: cljs-dnd.core, could not locate cljs_dnd/core.cljs, cljs_dnd/core.cljc, or Closure namespace "cljs-dnd.core" in file /Users/oleg/.boot/cache/tmp/Users/oleg/code/cljs-dnd/qbw/-rcsl8f/cljs_dnd/examples/sort.cljs at file src/cljs_dnd/examples/sort.cljs
thank you! that do solved the issue