This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-12-04
Channels
- # adventofcode (171)
- # beginners (160)
- # boot (13)
- # chestnut (2)
- # cider (6)
- # cljs-dev (15)
- # cljsjs (35)
- # cljsrn (1)
- # clojure (139)
- # clojure-argentina (3)
- # clojure-brasil (1)
- # clojure-greece (31)
- # clojure-italy (5)
- # clojure-russia (5)
- # clojure-spec (18)
- # clojure-uk (11)
- # clojurescript (42)
- # clojurex (6)
- # core-async (12)
- # cursive (14)
- # dirac (13)
- # emacs (13)
- # events (1)
- # fulcro (46)
- # graphql (7)
- # leiningen (10)
- # lumo (3)
- # mount (31)
- # off-topic (20)
- # onyx (30)
- # perun (4)
- # planck (47)
- # re-frame (28)
- # reagent (14)
- # ring (5)
- # shadow-cljs (3)
- # spacemacs (7)
- # specter (13)
- # timbre (3)
- # unrepl (65)
- # yada (8)
sure thing, sir. https://github.com/spacegangster/sg-share
@qqq for a reason I don't know yet similar configuration lein new reagent
produces single module, whilst mine inferred from lein new chestnut
produces a set of modules. With :optimizations :advanced
it becomes a single module, but the error seems to persist, just with mangled names.
opt-none produces many *.js files, as reloading works withI believe one js file per cljs file
mangling errors are probably due to https://github.com/cljsjs/packages/wiki/Creating-Externs ... you have to properly setup externs if you don't want the closure compiler to rename everyhing to aa ab ac ad ...
I tried opt-advanced only to see if it will fly with a single module.
react_dom is written here
reagent.dom.global$module$react_dom = goog.global.ReactDOM;
but expected here
reagent.dom.node$module$react_dom.render.call
So I tend to blame my cljs build conf, which I don't even fully understand, i.e. why it produces a set of modules instead of one. And seemingly the same conf in reagent template produces single module.
Tried simple, yes, it gives a single module, with the same issue and strange looking export
reagent.dom.global$module$react_dom = goog.global.ReactDOM;
reagent.dom.node$module$react_dom.render.call
Also gives error on cljs compilation now
@qqq
is there a well accepted method for binding and unbinding the same partialed function used by event handlers in different parts of a component's lifecycle? partialing the function in both component-did-mount
and component-will-unmount
returns two different functions, of course, so unbinding the second doesn't unbind the first. my solution is to store the function in a local atom but it feels dirty...
(defn hook-resize [this]
(js/console.log "Test" (-> this
(r/dom-node)
js/$
(ocall :find ".grid-container")
width-and-height)))
(defn grid-container []
(let [resize-fn (r/atom nil)]
(r/create-class
{:component-did-mount (fn [this]
(-> js/window
(ocall :addEventListener "resize" (reset! resize-fn (partial hook-resize this)))))
:component-will-unmount (fn [this]
(-> js/window
(ocall :removeEventListener "resize" @resize-fn)))
:reagent-render (fn []
[:div.grid-container
[:h1 "Zoop zoop"]])})))
Is there a simple way to manage react ^{:key} changes in a dynamic list e.g. my data changes from [:a :b :c]
to [:a :c :b]
? The top style is determined based on the vector index and the key is based on the value. From my observation, it looks like once a key is used it searches for a duplicate and removes it if it's there. This makes the css transition I have for the :c
element work but not for the :b
element.