This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-09-04
Channels
- # beginners (14)
- # boot (28)
- # chestnut (9)
- # cljsrn (18)
- # clojure (64)
- # clojure-conj (1)
- # clojure-dusseldorf (45)
- # clojure-finland (4)
- # clojure-gamedev (1)
- # clojure-greece (8)
- # clojure-italy (22)
- # clojure-russia (4)
- # clojure-spec (19)
- # clojure-uk (38)
- # clojurescript (49)
- # code-reviews (2)
- # component (12)
- # core-async (3)
- # cursive (3)
- # data-science (2)
- # events (4)
- # fulcro (394)
- # heroku (3)
- # hoplon (16)
- # immutant (11)
- # jobs (5)
- # lein-figwheel (1)
- # lumo (18)
- # off-topic (8)
- # om (11)
- # other-languages (1)
- # overtone (1)
- # pedestal (7)
- # portkey (62)
- # protorepl (1)
- # re-frame (40)
- # reagent (41)
- # ring-swagger (5)
- # spacemacs (5)
- # unrepl (5)
- # yada (12)
Has someone successfully set up a binaryage/devtools
component so it get's started with the system, but only as part of the dev build?
How did you do that @darwin? I'm running into the problem that the system map for the reloaded.nrepl methods is build on the Clojure side, even the figwheel-sidecar components. Since binaryage/devtools is cljs only, how can I add it as a component to the system map?
you should follow: https://github.com/binaryage/cljs-devtools/blob/master/docs/installation.md#install-it-via-preloads
imagine your clojure backend to be written in another language, you can still use cljs on client-side
Thanks, :preloads
are working. The chestnut template uses component to initialize the view rendering, and figwheel-sidecar is a component, so it seems to be a popular thing on the browser side, too. But anyway, I'm happy to have the formatters working!
AFAIK figwheel-sidecar is backend stuff so it makes sense to integrate it with backend code, cljs-devtools does not have anything to do with your backend
You should not confuse “figwheel” as whole, “figwheel support” (client-side) and “figwheel sidecar” (server-side), btw. I wrote this a while ago: https://github.com/binaryage/dirac/blob/master/docs/about-repls.md#figwheel
@darwin That is a very nice writeup! I can't claim I understand the complex relations in the bottom diagram though.
Btw, unfortunately the :preloads compiler option only works on the first reload. Once reloaded.repl/reset
(e.g. after the first figwheel reload) is called it's unloaded.
Seems like the concept behind devtools is incompatible with the reloaded.nrepl idea of refreshing all namespaces that contain changes.
no idea, I’m not familiar with reloaded.repl
, I always thought it is again just server-side thing, so that your REPL reflects changes in your backend code
The same is set up by default by the chestnut lein template for the frontend code, too.
I don’t understand how it works with client-side and what “reset” means for cljs on client
I'm still very much a beginner trying to follow what's currently accepted good practice.
I wish @plexus where here, he wrote chestnut and could probably explain a lot better then me. I'm just beginning to grasp the wiring.
I must admint that using com.stuartsierra.component
doesn't seem to give a lot of benefit. But that might be my limited exposure talking.
@vinai I was curious and tested chesnut-generated leiningen-based app with added devtools and it works just fine
for cljs-devtools to do the expandable visualization of data you have to pass cljs values into console.log
if you look at how prn
and println
and similar are implemented in cljs.core you would see that cljs code asks passed values to print into strings, for example via IPrintWithWriter
protocol or via javascript, this way cljs-devtools gets strings on input and cannot do anything smart with it, it simply prints them as strings
typically I tend to write some macros to wrap console.log and friends, here you can see it with some fancy styling: https://github.com/binaryage/dirac/blob/master/src/background/dirac/background/logging.clj
@stvnmllr2 most likely missing :externs
, you can try with the compiler option :pseudo-names true
to confirm which name is missing from the externs
var $contentWindow$jscomp$1$$ = $JSCompiler_StaticMethods_getIframeToken_$self_doc$jscomp$31$$.$iframe_$.contentWindow; Is that something that makes sense to anyone?
@stvnmllr2 its a bit garbled but what pseudo-names
does is basically wrap the original names it doesn know into $
what was the error you got? it probably doesn’t know .$iframe_$.contentWindow
which would be .iframe_.contentWindow
in code
@ericnormand thanks, so if I want localized state for the object I need to use reify
and contain it within a function?