Fork me on GitHub
#clojurescript
<
2019-11-11
>
Eliraz10:11:08

Hello. I need some help with shadow-cljs

thheller10:11:43

@eliraz.kedmi happy to help, but probably best to move it to #shadow-cljs

Eliraz10:11:18

I'm not so positive it's related to shadow-cljs directly. I'll just post the error I'm getting trying to compile / watch my app: Illegal UTF8 string in constant pool in class file jdk/nashorn/internal/runtime/linker/Bootstrap

Eliraz10:11:51

Execution error (ClassFormatError) at java.lang.ClassLoader/defineClass2 (ClassLoader.java:-2).
Illegal UTF8 string in constant pool in class file jdk/nashorn/internal/runtime/linker/Bootstrap

Eliraz12:11:07

I changed the JDK to version 11 from 13.0.1 and now It works

Eliraz12:11:14

how would I (js/console.log "dsad") from repl ? I get this error message: No such namespace: js

Joni12:11:05

That should work if you're in the right cljs repl

sudakatux13:11:02

(.log js/console "dsad")

sudakatux13:11:12

I think it should still don't show No such namespace: js error

Ramon Rios13:11:17

Hello, you guys know some look n' feel stuff for clojurescript? Like a bootstrap ? Also, how can i make my views responsive?

joelsanchez13:11:50

Semantic UI is responsive by default. in general, avoiding hardcoded dimensions (such as width: 400px) and using media breakpoints will help you

Ramon Rios14:11:04

Let me see if i understood: it is a component library for react?

joelsanchez14:11:17

Semantic UI is a UI library, Semantic UI React is a port of Semantic UI to React, and that cljsjs package wraps Semantic UI React in order to use it from CLJS

Ramon Rios14:11:51

Oh, great. Thank you 😃

Ramon Rios14:11:22

Is this like Garden or something?

Ahmed Hassan14:11:39

no, it provides low level utility classes, so you can build UIs

Ramon Rios14:11:11

Got it, so i install it and i can use in my cljs project

Ahmed Hassan14:11:27

Yeah, Garden generates CSS from Clojure(Script) code, so both have different purposes and can be used in the same project

Ahmed Hassan14:11:04

Tailwind CSS is framework, sort of Bootstrap.

Ramon Rios14:11:54

Is it responsive ?

Ramon Rios16:11:47

Do you have any example of how to setup this on a re-frame project?

Ahmed Hassan19:11:34

You can read it from website of Tailwind CSS.

dangercoder19:11:23

Is it possible to use e.g 'calc(100% + 224px)'; in Clojurescript? Haven't seen anyone use it. In my case I have a material ui css property that i need to calc.

lilactown19:11:18

that’s a CSS feature; has nothing to do with ClojureScript

4
lilactown19:11:13

if you scroll to the bottom of the page, it lists the support for it in various browsers. ensure that the browsers you target support it. if so, you can use it

dangercoder19:11:21

Worked like a charm when I updated my browser.

carocad21:11:57

does anyone knows if there a difference in the way that Clojurescript escapes regex compared to Clojure ? I have a very simple regex which works on Clojure but fails on Clojurescript due to “improper” escaping 😕

chrisulloa21:11:39

do you have an example of the regex?

carocad21:11:17

yeap here it is: #"^([^\s\/]+\/)?(\/|[^\s\/]+)$"

Alex Miller (Clojure team)21:11:04

Clojure and ClojureScript use their respective host regex engines and you should not expect portability

carocad21:11:39

the problem is actually that the regex that I am trying is valid in Js but not after passing through Cljs 😕

carocad21:11:37

- this works in my chrome browser: /^([^\s\/]+\/)?(\/|[^\s\/]+)$/ - but this doesnt #"^([^\s\/]+\/)?(\/|[^\s\/]+)$"

bfabry21:11:40

I'm suspicious of the need to escape /

carocad21:11:48

if I dont then it crashes

/^([^\s/]+/)?(/|[^\s/]+)$/.exec("hello/world")
;; Uncaught SyntaxError: Unexpected token ')'

bfabry21:11:01

yes for a JS regex literal

bfabry21:11:14

the JS documentation says you need to escape / for a JS regex literal

bfabry21:11:29

but I'm suspecting that a CLJS regex literal does not require that and in fact it breaks it

carocad21:11:41

that seems to be the case yes. If I remove the \ in front of the / then it works from Cljs … though it seems counter intuitive to have a regex that works on java, clojure, js but not on clojurescript 😞

bfabry21:11:51

cljs.user=> (re-find #"/" "/")
"/"

bfabry21:11:51

that's because java regexes ignore pointless backslashes, whereas JS regexes consider them an impossible to match character by the looks of it

bfabry21:11:30

or maybe it's even more complicated than that ¯\(ツ)

bfabry21:11:51

I think if you follow the rules for the JS "new RegExp(...)" constructor you'll be good

4
Thomas Lisankie22:11:05

Hey all, I'm trying to run the example Sente project (https://github.com/ptaoussanis/sente/tree/master/example-project), however I'm getting quite a few errors that I suspect are related to my environment. I can't figure out for the life of me what the problem is though. Attached is the feedback/errors I get when I try to run lein start. My lein version is Leiningen 2.8.1 and Java version is Java 1.8.0_222 OpenJDK. All on Ubuntu 18.04.

flowthing07:11:33

The Sente example project relies on some pretty old libraries... What does /tmp/clojure-3693083459432344239.edn contain?

flowthing07:11:39

What I did last time to get it to work was removing the Austin dependency and updating the cider/cider-nrepl dependency (https://github.com/ptaoussanis/sente/pull/338#issue-261453889 and https://github.com/ptaoussanis/sente/pull/338/commits/13a13fb1d3f0f9c9f4ad8146bb16abeed65a3596).

flowthing07:11:42

You could try removing it and opening the browser manually.