Fork me on GitHub
#clojurescript
<
2018-05-18
>
wiseman00:05:11

oh--i should have checked. yes, it runs fine after i delete main.out. thanks!

👍 4
dvingo01:05:29

Does anyone have any experience inter-operating with JavaScript code that uses template strings? I'd like to use this lib from cljs: https://www.styled-components.com/docs/basics

dvingo01:05:18

interesting... it looks like you can just invoke their template literals as functions

rgdelato01:05:41

You're going to have to look this up to double-check me, but I'm pretty sure that:

hello`there ${how} are ${you} today`
is equivalent to:
hello(["there ", " are ", " today"], how, you)

dvingo01:05:24

ahh, thanks! I'm going to try out calling it in js in that fashion first

dvingo01:05:52

confirmed this works in js:

const color = "blue"
 const ColorDiv = styled.div`color: ${color};`
 const ColorDiv = styled.div(['color: ', ';'], color)

dvingo01:05:10

thanks for your help

philrees01:05:59

Has anyone set this up using lein-cljsbuild instead of build? https://clojurescript.org/guides/javascript-modules#node-modules more info in #lein-figwheel of the exact issue I’m hitting is

artenator17:05:27

Hey guys, Just recently created a macro namespace in clojurescript, and I’m now running into an issue when figwheel reloads… FileNotFoundException: Could not locate <macro ns> on classpath Anyone else run into this issue before? Everything works fine if i build via lein cljsbuild but figwheel no longer works after adding the macro.

Bravi18:05:59

@danvingo I use styled-components at my workplace and at the moment I’m trying to find something similar in cljs as well

nenadalm18:05:04

I am just putting styles into style attribute. But https://github.com/roman01la/cljss doesn't look bad.

Bravi18:05:22

that doesn’t seem to work with re-frame 😞

Bravi18:05:14

hmm I think I was doing something wrong, haha

dvingo21:05:13

https://clojurians.slack.com/files/U051V5LLP/FATG42LGN/styled-components.clj I was able to get styled-components working with a fulcro app. Just making sure you can call the styled-components from cljs. I'm working on writing a macro now (the code snippet has some thoughts on that) to replicate what the template literals expand into in JS, and deal with passing javascript objects to styled components but allowing client code to transparently pass cljs data structures for props.

Bravi18:05:03

have you found anything?

Bravi18:05:50

trying to decide which library to use for css in my re-frame application. any recommendations anyone?

joelsanchez19:05:02

this is not a popular opinion here but...just use properly written SCSS. trying to cram every CSS/SCSS feature into some weird CLJ DSL isn't going to cut it

gbouvier19:05:21

Is Garden popular for clj/cljs web apps? Seems like writing hiccup and clojure might make sense. https://github.com/noprompt/garden

Philip Hale19:05:53

Something like https://github.com/gajus/babel-plugin-react-css-modules would be nice... standard SCSS but scoped to individual components to save managing global cascades

👍 4
joelsanchez20:05:54

@phil672 I also tried to keep using SCSS but having local names - linked to clj namespaces https://github.com/JoelSanchez/fqcss

👍 8
joelsanchez20:05:31

the problem being, that it's slightly painful to write/read, specially in the clj part

joelsanchez20:05:42

I just write scss now.

Philip Hale20:05:57

Yeah that doesn't look as nice, because rather than writing regular classnames you have to write clj; it's not true SCSS.

joelsanchez20:05:30

yep, also editors go crazy trying to parse it

Bravi21:05:28

is it normal for lein figwheel to take around 1 minute and 10 seconds to start up, every time?

Bravi21:05:55

actually I just timed it and it’s 100 - 110 seconds

mfikes21:05:26

@bravilogy No, not in general. If you can, do a thread dump to see where it is spending its time (presuming that most of it is spent in one big operation that is easy to catch).

Bravi21:05:36

is there a command for that @mfikes?

mfikes22:05:29

jps to find the process id