Fork me on GitHub
#clojurescript
<
2018-05-29
>
hagmonk00:05:41

Using cljs.main, is it possible to start any kind of nREPL session, so I can cider-jack-in to the browser REPL?

ackerleytng00:05:22

you can use piggieback, figwheel-sidecar and tools.nrepl

ackerleytng00:05:39

: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 { }}

hagmonk00:05:35

That looks like a lein project.clj, I'm specifically thinking of the new cljs.main stuff in 1.10 …

hagmonk00:05:26

e.g. (assuming deps.edn): clj --main cljs.main --watch src --compile foobar.core --repl

hagmonk00:05:44

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

p4ulcristian01:05:32

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.

benzap10:05:21

@jherrlin does replacing :onClick with :on-click fix your issue?

benzap11:05:31

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?

pesterhazy12:05:38

@jherrlin first, replace the handle fn with a (js/console.log "hello"). Does that end up in the dev console?

pesterhazy12:05:24

second, assuming that dispatch! is re-frame's, shouldn't the event be in a vector?

pesterhazy15:05:08

(defmulti button (fn [a _ _] (:type a)))

pesterhazy15:05:10

by the way if that's Reagent, be careful with using defmethods as components - there are known bugs related to those

JH15:05:00

@pearofducks appreciate it, would you mind elaborating on known bugs?

pesterhazy16:05:51

@JH, check this stackoverflow answer https://stackoverflow.com/a/33487691

lwhorton17:05:59

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?

lwhorton17:05:59

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?

thheller17:05:30

@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.

thheller17:05:48

if you want the fastest thing possible use a javascript array

lwhorton17:05:54

ah, yea forgot about dropping down into interop. 👍

justinlee18:05:57

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

tungsten20:05:21

has anyone had trouble with devcards not hot reloading the actual "cards" but reloading the components under "test"

kwladyka20:05:28

I am curious what ClojureScript guys use for CSS? https://github.com/roman01la/cljss https://github.com/Jarzka/stylefy SASSS LESS STYLUS ?

lwhorton20:05:22

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

lwhorton20:05:59

i wrote a custom stylus -> clojurescript def my-class tool, it’s just okay: https://github.com/lwhorton/boot-stylus

kwladyka20:05:44

Interesting, ClojureScript seems to be perfect for preprocessing CSS

kwladyka20:05:55

I would expect there is some mature solution

kwladyka20:05:03

unless people just use SASS etc.

lwhorton20:05:12

i think part of the problem is that you’re going to want, at minimum, css modules style components

lwhorton20:05:19

and that necessarily introduces a lot of moving parts

kwladyka20:05:15

What exactly do you mean?

kwladyka20:05:58

split CSS depend on UI components - that part I understand

kwladyka20:05:12

but what issue about that in context?

lwhorton20:05:44

you need some way to generate a non-colliding class name, and to provide your hiccup forms those class names

lwhorton20:05:38

[: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)

lwhorton20:05:06

and that’s where the complexity creeps in. cljss handles it alright, but like I said I dont think anyone has solved it perfectly

kwladyka21:05:57

Since I am not Windows user does it mean https://github.com/roman01la/cljss/issues/44 this lib wouldn’t work on all IE?

kwladyka21:05:10

ver. 11 is the newest one?

lwhorton21:05:21

the issue here is css-vars isnt supported in IE, only edge

lwhorton21:05:46

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

kwladyka21:05:35

yeah, but when it comes into divide community it sound like a bad idea

kwladyka21:05:47

in the context of maintenance

kwladyka21:05:44

But still to many people use IE to ignore it

lwhorton21:05:04

yea the fork is more of a stop-gap because the lib maintainer is pretty non responsive

kwladyka21:05:45

now I start to understand > but haven’t found a great one ye

lwhorton21:05:11

yea it was too complected with reagent and felt like too much manual work to implement dynamic styles

theeternalpulse03:05:31

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

theeternalpulse04:05:15

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

theeternalpulse04:05:03

it's mostly a nit-pick and probably bad practice, but I have to deal with non-clojure css all day 😞

kwladyka11:05:44

You can always write your own 😉

kwladyka11:05:15

But yeah different syntax is some kind of issue

theeternalpulse14:05:15

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

lwhorton15:05:40

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

theeternalpulse15:05:42

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.

symfrog20:05:07

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?

kwladyka20:05:50

@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

tungsten20:05:25

we use cljss

symfrog20:05:00

@kwladyka thanks, but I don't think that issue is related. I checked Jira before without finding a relevant issue.

kwladyka20:05:43

> CLJS-2689: Don’t try to use node resolve for goog: modules @symfrog maybe this one?