Fork me on GitHub
#clojurescript
<
2020-05-19
>
Bardia Pourvakil01:05:36

Anyone know if it’s possible to import or require your own libraries in klipse?

didibus09:05:02

What's the benefit of scss compared to a css-in-clojurescript approach?

didibus09:05:08

Or even just plain static css?

didibus09:05:29

Also, I'm a bit confused about :npm-deps, like is it possible for it to fail to infer externs and foreign-libs for some given npm dependency?

Roman Liutikov09:05:13

imo just divide your CSS into modules, have a tool that concatenates them together, this will help a lot already

✔️ 4
Roman Liutikov09:05:37

scss and co. is useful for reusing values: colors, margins etc

Roman Liutikov09:05:53

css-in-js or basically runtime css is useful when your styles are dependant on runtime values, I wouldn't use it to generate static styles

Roman Liutikov09:05:09

it's just tooooo much complexity for nothing

👍 4
didibus09:05:58

Ya, I mostly think of css-in-cljs for dynamic css, like if I need to create CSS based on DB or user input.

didibus09:05:11

Though I like how it can bundle css with a react component like all in one. So say you require some namespace that has some nice react component, there's no other setup, no need to remember to add some additional stylesheet to your server or html

didibus09:05:47

And so if I understand correctly, scss can only do static generation. So I guess I would look into it if my normal css becomes so complicated and big that I want to start having more organization and reuse in them

Alex Fell10:05:37

In JS land I pushed to use astroturf as it combines the css in js syntax, but pulls out the embedded css text to sass modules via a virtual file system so that webpack treats them as part of regular css compilation. https://github.com/4Catalyzer/astroturf/blob/master/README.md From my very limited understanding, this smells a bit like a macro, I know that clojurescript can talk to the compiler in a macro, but unsure if it can talk to any other tool chains? What does shadow use under the hood, webpack or something else?

didibus16:05:04

Shadow uses it's own bundler

didibus16:05:25

You can have a macro generate css files at compile time. Or I guess it could even generate sass? I think because I don't really understand sass I'm not totally following though

athomasoriginal02:05:55

Also note that css custom properties replace the need to use scss variables and they are dynamic which is v powerful

athomasoriginal02:05:24

Essentially CSS is actually incorporating many of the features that made css preprocessors like scss interesting

athomasoriginal03:05:33

one of my fav things to do is define a bunch of top level custom properties at the html block level and then you can have media queries which, when hit, will redefine the values making it easy to create responsive layouts

didibus03:05:07

Ok cool,.I'm just learning CSS right now. Will have a look. I do feel I won't find the benefit of scss and sass until I'm somewhat writing a really big complicated set of CSS. And with what you said, probably standard CSS can go a really really long way already

👍 4
Jakob Durstberger10:05:08

Also SCSS is useful for css libs like http://bulma.io. It provides a few variables that can be configured like colours

jeroenvandijk10:05:27

I believe it could make css more maintainable. I see it as combination of Sass and all of the approaches combined in clojure and with absolutely minimal code

e14:05:22

So I'm pretty new to the cljs ecosystem... wanted to compile code into an npm module using shadow-cljs. It compiles perfectly well if I set the target to browser, but is less happy with the npm module target:

IllegalStateException: Could not find where to put constant cljs$cst$keyword$priority. Used by [cljs.core.async.js, ajax.xhrio.js], selected common dep goog.async.nexttick.js
As this is the first time I've compiled to an npm module, is this below configuration correct? The only googling I could find on this error indicates that :modules should not be used with :npm-module, because there's a lot of syntactic sugar going on behind the scenes that makes it unnecessary. Assuming there is some other nuance I'm missing...
{:lein   true
 :nrepl {:port 8777}
 :builds {:npm {:target :npm-module
                :output-dir "resources/public/js/compiled"
                :asset-path "/js/compiled"
                :entries [foo.core]}}}

thheller14:05:18

@rbruehlman which version do you use? that particular issue was fixed a while ago and I haven't seen it reported since? the version in project.clj is the important one here.

e14:05:17

2.8.83 for shadow-cljs, looks like

thheller14:05:01

I can't remember the version I fixed this in so try 2.9.8 which is the latest

e14:05:22

Gotcha--I'll try that. Hopefully that does the trick!

thheller14:05:55

curious why you are using :npm-module though? looks like you are building something where :browser might be a better fit?

thheller14:05:44

well at least the paths would suggest a browser build 😛

e14:05:33

Yeah, I just lazily stole the paths from the browser build 😉 I definitely need to find a better home for them, but right now was just trying to get it to work

thheller14:05:30

happy to help in #shadow-cljs if you have more questions

e14:05:14

aha, thanks! i will do that next time. (also, upgrading seems to have done the trick--thanks again)

👍 4
Eliraz15:05:44

for those of you who uses emacs (evil-mode), which package do you use to handle s-expression manipulation and smart parentheses?

Eliraz16:05:30

Thank you

👍 4
myguidingstar18:05:08

Highly recommended

isak19:05:22

A colleague just tried switching us from using bidi to reitit for frontend routing. From the build report, bidi was 10 Kb, but now reitit is 58 Kb (55 Kb from reitit-core) - is this to be expected?

isak19:05:41

> react + react-dom is 109 kb (34.8 kb gzipped)

lilactown19:05:10

might be worth asking in #reitit

lilactown19:05:14

that does seem pretty heavy

orestis20:05:18

Cross posting cause I’m also interested :)

isak20:05:08

Thanks, will join and follow up there :thumbsup::skin-tone-2:

jaide01:05:52

What motivated them to switch?

ikitommi05:05:01

answered on #reitit

johanatan22:05:20

anybody here using secretary with :advanced compilation and :source-maps ?

johanatan22:05:43

i'm getting a runtime error on this line:

(defmethod encode-pair ::sequential [[k v]]
XR.Ha is not a function.

johanatan22:05:54

looks like missing externs for secretary ?

lilactown23:05:32

you can compile with :pretty-print and `:pseudo-names` to help troubleshoot these kinds of issues

johanatan23:05:52

awesome, thx!