clojurescript

ClojureScript, a dialect of Clojure that compiles to JavaScript http://clojurescript.org | Currently at 1.10.879
mengu 2021-02-10T11:40:57.099800Z

hi all

mengu 2021-02-10T11:41:53.100600Z

is anyone using intellij idea + cursive plugin with clojurescript? i don't seem to get the cursive benefits even though I added the project as a leiningen project

p-himik 2021-02-10T11:44:06.100700Z

That combination is the second most popular dev setup in the Clojure community, according to the State of Clojure 2020 survey results. :) Have you followed through the Cursive documentation? If yes, then #cursive might be a better place to ask.

mengu 2021-02-10T11:57:46.100900Z

that's a great suggestion, thank you @p-himik

flowthing 2021-02-10T16:05:55.104200Z

I'm trying to call a macro I wrote and sporadically get an error like this:

null
StackOverflowError:
        clojure.lang.KeywordLookupSite$1.get (KeywordLookupSite.java:45)
        cljs.analyzer/source-info (analyzer.cljc:717)
        <snip very long stack trace>
Any ideas on what might be going on? Something's causing an infinite loop somewhere, but I don't really understand what.

flowthing 2021-02-10T16:06:18.104700Z

The error seems to be slightly different every time, too.

thheller 2021-02-10T16:07:39.105200Z

this seems to be related to using a different JVM implementation. I think this happens on the OpenJ9

flowthing 2021-02-10T16:24:12.105500Z

I'm on OpenJDK 15.0.1.

flowthing 2021-02-10T16:24:25.105900Z

But thanks for the tip, I'll try a different version.

flowthing 2021-02-10T16:26:56.106400Z

Same thing with OpenJDK 1.8.0_272, but at least I get a bit more detail:

Encountered error when macroexpanding cljs.core/aset.
StackOverflowError:
        cljs.analyzer/checked-arrays (analyzer.cljc:178)

mfikes 2021-02-10T16:34:23.107300Z

@flowthing Hrm. If you can boil it down to a small repro that is driven by deps.edn -based configuration, maybe we can get a JIRA logged against the compiler.

flowthing 2021-02-10T16:35:13.107600Z

All right, I can give it a shot tomorrow.

vanelsas 2021-02-10T17:03:35.113Z

Hi all. Relative newby to Clojurescript here. I'm trying to unzip a file loaded by de browser. So far I've only found JSZip, but that requires me to use js and I'm having issues getting it to work. I've managed to see what is in the zip file, but I haven't yet gotten the actual files out. To see what is in it I do this: (-> (js/JSZip.loadAsync zipfile) (.then (fn [obj] (js/console.log "object " obj) (js/console.log "files " (.-files obj)))) I can see in the console that the obj has 4 files in it. But Now I have issues getting these files out of the obj that (js.JSZip.loadAsync) creates.. According to the JZip docs I should do something like this

zip.file("image.png").async("base64").then(function (b64) {
    // ...
});
Has anyone tried this before, is there a code sample I could see ?

vanelsas 2021-02-11T13:14:07.123700Z

vanelsas 2021-02-11T13:14:41.123900Z

I've managed to solve the problem. The code above works for me.

flowthing 2021-02-10T17:04:24.113100Z

Here's the full stack trace: https://gist.github.com/eerohele/3bd89bc9dfaf2d53e4c9cced3c5be7a1 @thheller this time shadow-cljs is the topmost entry, but I have no idea whether that really means anything.

thheller 2021-02-10T17:05:45.113300Z

I don't know. https://github.com/thheller/shadow-cljs/issues/804

thheller 2021-02-10T17:06:10.113700Z

the failures are "random" and not reproducible so I don't have a clue what is going on

flowthing 2021-02-10T17:07:07.113900Z

Yeah, my thing is random as well.

flowthing 2021-02-10T17:07:41.114100Z

Well, semi-random. Right now I can reproduce it every time.

thheller 2021-02-10T17:14:26.114500Z

no clue what you are doing. might be a macro expanding itself in an infinite loop or so

flowthing 2021-02-10T17:14:59.114900Z

Yeah, I'll try making a repro.

2021-02-10T17:15:53.115800Z

@alexander.vanelsas How do you load the zip from your browser? Ajax call?

lilactown 2021-02-10T17:19:31.116200Z

> I can see in the console that the zip file has 4 files in it. But Now I have issues getting them out of there. what do you mean by this?

vanelsas 2021-02-10T17:36:05.116300Z

Hi there, In react I load the file with an :input typ=file. The file is read in with (.readAsArrayBuffer) which seems to be the input JSZip wants.

vanelsas 2021-02-10T17:38:24.116500Z

Sorry, that was confusing. JSZip gives me a js obj. I can see in the console that the object has 4 files in it. In order to get them out of the object I believe I need to call the .async method that JSZip mentions in the docs. It is here where I get stuck. Not sure how to set that async call up

vanelsas 2021-02-10T17:56:04.117100Z

Here is the object and its content. I wat to get the index.html and the other image files unzipped out of the obj

2021-02-10T23:47:11.119700Z

We currently use Garden for CSS. We use Reagent. We're considering moving to a more dynamic/runtime library like herb, stylefy, spade or forest.  Q: Are we missing any contenders?  Q: Any opinions on the efficacy of these contenders, based on direct experience?

👀 1
2021-02-11T09:59:43.122100Z

@mikethompson I might be 2 days ~ 2 weeks away from a first release of Girouette, currently working on a CSS classes extraction tool.

2021-02-11T10:01:13.122400Z

However, you can already use Girouette as it is on the master branch. The only issue is that the CSS extraction is not final.

2021-02-11T12:05:03.122600Z

And there's also lambdaisland's approach called ornament: https://github.com/lambdaisland/webstuff/blob/main/src/lambdaisland/ornament.cljc

👍 1
borkdude 2021-02-11T12:11:35.123Z

Just for completeness, here's another CSS lib from the (g)olden days: https://github.com/cdaddr/gaka (this one also happens to work with babashka)

😮 1
2021-02-11T21:00:40.126700Z

If you don't need JVM support, there are these wrappers of emotion and styled-components: https://github.com/dvingo/cljs-emotion https://github.com/dvingo/cljs-styled-components

👍 1