Fork me on GitHub
#clojurescript
<
2021-02-10
>
mengu11:02:53

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-himik11:02:06

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.

mengu11:02:46

that's a great suggestion, thank you @U2FRKM4TW

flowthing16:02:55

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.

flowthing16:02:18

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

thheller16:02:39

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

flowthing16:02:12

I'm on OpenJDK 15.0.1.

flowthing16:02:25

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

flowthing16:02:56

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)

mfikes16:02:23

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

flowthing16:02:13

All right, I can give it a shot tomorrow.

flowthing17:02:24

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

thheller17:02:10

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

flowthing17:02:07

Yeah, my thing is random as well.

flowthing17:02:41

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

thheller17:02:26

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

flowthing17:02:59

Yeah, I'll try making a repro.

vanelsas17:02:35

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 ?

vanelsas13:02:41

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

Michaël Salihi17:02:53

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

vanelsas17:02:05

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.

lilactown17:02:31

> 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?

vanelsas17:02:24

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

vanelsas17:02:04

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

mikethompson23:02:11

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?

👀 4
solf01:02:39

No experience using cljs libraries for css, but here's a (futur) tailwind-like possible contender: https://github.com/green-coder/girouette https://www.youtube.com/watch?v=Tnv6SvZM6tg I think it's pre-alpha though.

🙂 4
West01:02:00

I’m really curious as well about this topic.

mikethompson05:02:16

In the interests of completeness, I've now also been told about a Tailwind-ish approach: https://github.com/HealthSamurai/macrocss

mikethompson06:02:27

And another related library (done in the last 5 hours ?): https://github.com/wilkerlucio/tailwind-garden

🙌 6
Vincent Cantin09:02:43

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

Vincent Cantin10:02:13

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

borkdude12:02:35

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)

😮 4
dvingo21:02:40

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

👍 3