This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-05-29
Channels
- # aleph (4)
- # architecture (12)
- # bangalore-clj (1)
- # beginners (87)
- # boot (3)
- # cider (19)
- # cljs-dev (84)
- # clojars (10)
- # clojure (79)
- # clojure-italy (7)
- # clojure-nl (19)
- # clojure-russia (10)
- # clojure-spec (9)
- # clojure-uk (55)
- # clojurescript (64)
- # core-async (7)
- # core-typed (4)
- # cursive (7)
- # data-science (2)
- # datomic (8)
- # devcards (6)
- # docs (1)
- # duct (5)
- # fulcro (117)
- # graphql (1)
- # instaparse (1)
- # leiningen (13)
- # lumo (103)
- # nyc (3)
- # off-topic (54)
- # om (9)
- # onyx (1)
- # pedestal (6)
- # planck (3)
- # portkey (7)
- # re-frame (26)
- # reagent (20)
- # ring-swagger (14)
- # shadow-cljs (164)
- # sql (11)
- # tools-deps (25)
- # yada (1)
Using cljs.main
, is it possible to start any kind of nREPL session, so I can cider-jack-in to the browser REPL?
you can use piggieback, figwheel-sidecar and tools.nrepl
:profiles
{:dev
{:dependencies [[binaryage/devtools "0.9.10"]
[figwheel-sidecar "0.5.16"]
[cider/piggieback "0.3.5"]
[org.clojure/tools.nrepl "0.2.13"]]
:repl-options {:nrepl-middleware [cider.piggieback/wrap-cljs-repl]}
:plugins [[lein-figwheel "0.5.16"]]}
:prod { }}
That looks like a lein project.clj, I'm specifically thinking of the new cljs.main
stuff in 1.10 …
e.g. (assuming deps.edn): clj --main cljs.main --watch src --compile foobar.core --repl
it dumps you to a cljs repl connected to the browser, which I assume is some custom websocket thing, not sure if it supports middlewares
is there something similar to cljs.reader/read-string, what doesn't accept maps with variables like {:random-key value}. I am trying to make an edn editor on clojurescript.
Also, it's been a while since i've used om, Is that clojure code being wrapped in a sablono wrapper in the render function?
@jherrlin first, replace the handle fn with a (js/console.log "hello")
. Does that end up in the dev console?
second, assuming that dispatch!
is re-frame's, shouldn't the event be in a vector?
(defmulti button (fn [a _ _] (:type a)))
by the way if that's Reagent, be careful with using defmethods as components - there are known bugs related to those
@pearofducks appreciate it, would you mind elaborating on known bugs?
@JH, check this stackoverflow answer https://stackoverflow.com/a/33487691
i think i finally found a use case for records.. please correct me if i’m wrong: i have an event log that’s going to be updated quite frequently as my app progresses. i could use an atom and keep swap!
ing changes onto the atom, but I could also use a defrecord with a mutable field, right?
is this a case of me trying to prematurely optimize? is it even worth it to try to avoid constant updates to an atom, since we’re not even worrying about thread blocking?
@lwhorton you could use volatile!
instead of an atom but even the atom will be fast enough. updating a mutable field won't make a big difference.
I want to point out that spell-spec
has a implementation for closed maps! thanks @bhauman https://github.com/bhauman/spell-spec#spell-specalphastrict-keys Looks like an A+ library
has anyone had trouble with devcards not hot reloading the actual "cards" but reloading the components under "test"
I am curious what ClojureScript guys use for CSS? https://github.com/roman01la/cljss https://github.com/Jarzka/stylefy SASSS LESS STYLUS ?
pain point all around. they all have tradeoffs but haven’t found a great one yet. cljss is good except :advanced mode compilation doesnt seem to work with certain media query styles
i wrote a custom stylus -> clojurescript def my-class
tool, it’s just okay: https://github.com/lwhorton/boot-stylus
i think part of the problem is that you’re going to want, at minimum, css modules style components
you need some way to generate a non-colliding class name, and to provide your hiccup forms those class names
[:div {:class "foo"
won’t work because to be modular what you really need is [:div {:class (get-some-random-class-name-tied-to-my-css-file)
and that’s where the complexity creeps in. cljss handles it alright, but like I said I dont think anyone has solved it perfectly
Since I am not Windows user does it mean https://github.com/roman01la/cljss/issues/44 this lib wouldn’t work on all IE?
ive been debating a fork to fix this since it looks fairly trivial to get rid of css vars and just use regular class rules
yea the fork is more of a stop-gap because the lib maintainer is pretty non responsive
Did you try https://github.com/Jarzka/stylefy/issues ?
yea it was too complected with reagent and felt like too much manual work to implement dynamic styles
I'm currently fiddling with cljss styled components with a javascript30 example and I like it. There are some gaps with sharing styles but I like that it mounts the clojurescript without needing a build or manual process like what I've had to do with garden
I wish the macro though accepted non-data for defstyled so instead of
(defstyled some-component :div
{:height "22px" ...
it allowed
(defstyled some-component :div
height 22px
it's mostly a nit-pick and probably bad practice, but I have to deal with non-clojure css all day 😞
granted cljss just needs a way to merge deftsyles with defstyled and I'll enjoy it, ill have to fork it and see if its possible
you can do the merging beforehand with good ol’ clojure merge
, but i do see some scenarios where it doesnt work all the time. another approach is to have global themes that you pull in to each component, via something like (get-theme :primary/:secondary)
so there’s a lot less need for merging
You can't merge in the defstyled forme though, but yeah, I was thinking of just doing it before hand. I do think it would be good for the meacro to eval if the items are symbols or maps and do the merging for you though, to keep in line with the "intended" use of the macro.
I am upgrading from 1.9.946 to 1.10.238. It seems that the macro cljs.core/resolve
no longer produces sufficient information to invoke a function across module boundaries. Specifically, 1.10.238 (and master) produces nil
for meta at this point https://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/core.cljc#L3292 while it produces the correct value in 1.9.946 (meta with argslist etc.). Is this a known issue?
@symfrog I have no idea if it help and it is about that but:
CLJS-2416: Self-host: defn macro Var doesn't have :macro true meta