This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-11-09
Channels
- # aleph (3)
- # beginners (327)
- # calva (3)
- # cider (20)
- # cljdoc (59)
- # cljs-dev (40)
- # clojure (104)
- # clojure-dev (30)
- # clojure-italy (8)
- # clojure-nl (36)
- # clojure-russia (3)
- # clojure-spec (3)
- # clojure-uk (79)
- # clojurescript (54)
- # community-development (5)
- # cursive (28)
- # data-science (21)
- # datomic (35)
- # emacs (14)
- # expound (1)
- # figwheel (2)
- # figwheel-main (82)
- # fulcro (18)
- # graphql (13)
- # jobs (12)
- # jobs-discuss (38)
- # kaocha (8)
- # lambdaisland (1)
- # lumo (12)
- # off-topic (20)
- # onyx (4)
- # re-frame (51)
- # reagent (12)
- # reitit (8)
- # ring-swagger (1)
- # shadow-cljs (22)
- # slack-help (2)
- # spacemacs (6)
- # specter (16)
- # testing (3)
Hi, can anyone explain to me what function sidecar
plays in the figwheel workflow? should I be using it?
sidecar is what you used before figwheel-main, if you wanted to use figwheel as a library, rather than through lein-figwheel
anyone using figwheel-main and integrant together?
@andrea.crotti Yes, it works great - use the script API to start figwheel as part of your integrant startup.
great, the only problem I have is that for some reason if I have both figwheel and jetty, only figwheel runs
if I only have jetty jetty works fine
(defmethod ig/init-key :server/figwheel
[_ {:keys [build] :as opts}]
(figwheel/start build))
(defmethod ig/init-key :server/jetty
[_ {:keys [port]}]
(jetty/run-jetty (wrap-reload #'api/app)
{:join? false
:port port}))
(defmethod ig/halt-key! :server/jetty
[_ server]
(.stop server))
(def config
{;;:server/garden {:builds ["screen"]}
:server/figwheel {:build "elo"}
:server/jetty {:port 3335}
})
(defn -main
[& args]
(reset! system (ig/init config)))
quite a simple config so far
am I doing something silly @shaun-mahood?
I think your figwheel config needs the equivalent of :join false?
- I’ll see if I can find the reference quickly
yeah weird because on another project I use at work we don't have any other option and it still works fine
but yeah I suspected it was something like that
:mode :serve
, then you can start the figwheel-repl from your repl. If you are still having trouble at the end of the day let me know and I’ll get some example code together this weekend or Monday, I’m in meetings all day today. :(
mm no sadly still doesn't work, I'm trying to actually get it working on a personal project, to then fix something related on my real project 😄
this is the PR in case you can see something silly https://github.com/AndreaCrotti/elo/pull/90
but should not integrant run things by default in detached mode so to say?
(maybe that's a question for another channel though)
@andrea.crotti you should be able to pass :`join? false` in the :ring-server-options
https://figwheel.org/config-options#ring-server-options
mm not sure I tried but I don't see any difference
I think it's an issue with integrant config not figwheel to be fair
it simply doesn't even call the function to start jetty
yes sure, I have this config now
{:watch-dirs ["src/cljs" "src/cljc"]
:css-dirs ["resources/public/css"]
:open-url false
:auto-testing true
:log-level :debug
:target-dir "resources"
:mode :serve
:ring-server-options {:join? false}}
@ghopper @raymcdermott I haven’t been able to reproduce the figwheel.core warning with the new clojurescript
@andrea.crotti test to see if code that happens after figwheel starts is executed
no it's not @bhauman
@ghopper @raymcdermott perhaps you are using a different clojurescript as well
so yeah definitively blocking
@andrea.crotti Hmmm I’d make sure that those build options are actually getting to figwheel
ah good point I'll check
I get a validation error when they are wrong
so they should be right?
ah yes I tried also without :mode :serve
and the PR is here, https://github.com/AndreaCrotti/elo/pull/90
it gets stuck here
Nov 09, 2018 5:44:23 PM org.jline.utils.Log logr
WARNING: Unable to create a system terminal, creating a dumb terminal (enable debug logging for more information)
Unable to detect a system Terminal, you must not launch the Rebel readline
from an intermediate process.
If you are using `lein` you may need to use `lein trampoline`.
JavaScript environment will not launch automatically when :open-url is false
that warning is not the problem right? I've seen it many times before
@andrea.crotti that is a problem because it is trying to start a REPL
mm :mode :serve
doesn't make a differnce
yes it blocks
and you can also do (figwheel.main.api/start {:mode :serve :pprint-config true} "dev")
elo.api=> (figwheel.main.api/start {:mode :serve} "elo")
[Figwheel] Validating figwheel-main.edn
[Figwheel] figwheel-main.edn is valid \(ツ)/
ExceptionInfo ClojureScript Namespace elo.dev was not found on the classpath. clojure.core/ex-info (core.clj:4739)
same thing without {:mode :serve}
works
does it somehow assumes something about the name dev?
ahh ok I get it now
so now it stopped blocking
elo.api=> (figwheel.main.api/start {:mode :serve} "elo")
[Figwheel] Validating figwheel-main.edn
[Figwheel] figwheel-main.edn is valid \(ツ)/
[Figwheel:WARNING] Attempting to dynamically add "target" to classpath!
[Figwheel:WARNING] Target directory "target" is not on the classpath
[Figwheel:WARNING] Please fix this by adding "target" to your classpath
I.E.
For Clojure CLI Tools in your deps.edn file:
ensure "target" is in your :paths key
For Leiningen in your project.clj:
add it to the :resource-paths key
[Figwheel:SEVERE] java.lang.AssertionError: Assert failed: Should have at least one build input!
(not-empty build-inputs)
[Figwheel] Starting Server at
Opening URL
nil
elo.api=>
after I coimmented out
;; :main elo.dev
from my elo.cljs.edn
so getting closer 😄
well I put main back, and I require dev
now
elo.api=> (require 'elo.dev)
nil
elo.api=> (require '[figwheel.main.api :as figwheel])
nil
elo.api=> (figwheel.main.api/start {:mode :serve} "elo")
[Figwheel] Validating figwheel-main.edn
[Figwheel] figwheel-main.edn is valid \(ツ)/
ExceptionInfo ClojureScript Namespace elo.dev was not found on the classpath. clojure.core/ex-info (core.clj:4739)
elo.api=>
how can it not be in the classpath if I also just required it?
ah damn clojrescript
not clojure
😄
ok makes sense then
ok then I'll sort it out, problem for future me
thanks a lot in the meanwhile