Fork me on GitHub
#clojurescript
<
2021-11-03
>
Leaf Garland02:11:23

I'd like to investigate this error from the clojurescript compiler, when requiring a namespace in the REPL. Are there any options I can give to java or clojure to get a stack trace or other details? Unexpected error compiling at (REPL:1). Not supported: class cljs.repl.browser.BrowserEnv$fn__7901

p-himik07:11:32

That exception should be bound to *e - just evaluate that to get the full stacktrace.

Leaf Garland10:11:15

I think the exception is happening in ClojureScript's code (in Clojure), not in my cljs environment. *e is nil.

p-himik10:11:18

Ah, hmm. Would be curious to poke around if you can come up with a minimal reproducible example.

Leaf Garland10:11:43

I'll try to do that, but it's a weird one - some of my team it works fine, others not. This is why I was hoping to find some way of getting more details about the error so that I could poke it myself. Thanks though.

Simon10:11:04

Is there a way to do something similar to this is Clojure?

//JavaScript

let cat = 'Miaow';
let dog = 'Woof';
let bird = 'Peet peet';

let someObject = {
  cat,
  dog,
  bird
}

console.log(someObject);

//{
//  cat: "Miaow",
//  dog: "Woof",
//  bird: "Peet peet"
//}

henryw37410:11:07

you could do it with a macro. I don't know of an existing one

raspasov12:11:06

Seems to be simply:

(defmacro create-map
  [& syms]
  (zipmap (map keyword syms) syms))

(let [x 1 y 2 z 3] (create-map x y z))
;=> {:x 1 y 2 :z 3}

Simon12:11:34

wow yeah, thank you so much!

Simon12:11:16

Great googling skills.

🤓 1
Albert01:11:39

should we just do it in reverse way? (let [{:keys [a b c] :as v} {:a 1 :b 2 :c 3}] [v a b c])

Sandra Iskander11:11:35

Hello everyone, please tell me your opinion which one is better to use with clojurescript and reagent .. Bootstrap or Material UI ?

❤️ 1
Simon11:11:07

What you choose for component library is independent of cljs and reagent.

Simon11:11:46

if you are using a react component library, remember to make use of [:> Button ...

Simon11:11:12

and when passing an element as parameter (reagent/as-element ...

dnolen17:11:14

finally - a possible fix for the #js literal issue in core.async https://github.com/clojure/core.async/pull/60/files

🙌 6
dnolen17:11:20

if you know how to use git deps give it a try

dnolen17:11:43

if no one is able to break it will merge this in

dnolen19:11:38

@alexmiller ^ merged, could use a core.async release - I went back through the tickets and saw that this resolved the previously reported cases and added them as tests

Alex Miller (Clojure team)20:11:07

1.4.627 is on the way to maven

Joshua Suskalo20:11:52

is there a cljs equivalent to bound-fn?

dnolen20:11:38

there is not

Joshua Suskalo20:11:56

That's unfortunate. Thanks anyway.