clojurescript

ClojureScript, a dialect of Clojure that compiles to JavaScript http://clojurescript.org | Currently at 1.10.879
Donnie West 2021-05-29T00:16:42.410400Z

Finally figured this out with shadow-cljs, but I'm really curious how this would be done w/ clojurescript's build tools. I'm guessing that it's going to mesh better with what I'm trying to accomplish too

2021-05-29T02:22:24.410700Z

Yep, emccue mentioned that one. I was hoping there was a way to do it without having to reimplement the entire type for such a tiny change, but It looks like there isn't.

max minoS 2021-05-29T02:52:22.412800Z

does anyone know whether or not I can change where shadow-cljs looks for the local maven ~/.m2 repository? I cant find it in the documentation but I would like for it to use a different path if I could

p-himik 2021-05-29T07:34:10.413600Z

If you don't get an answer here, there's #shadow-cljs

thheller 2021-05-29T07:47:15.414Z

if you only use shadow-cljs.edn then :maven {:local-repo "foo"}

max minoS 2021-05-29T13:05:42.416Z

that works! now is there a way for me to place it as a user configuration like ~/.shadow-cljs/config.edn as written in the users guide but redefine the path of ~/.shadow-cljs?

thheller 2021-05-29T16:52:50.416400Z

no, there is no option for that

đź‘Ť 1
Schpaa 2021-05-29T07:01:19.413400Z

Why do these two produce so different result? (The top one does not work)

(let [a (. (. firebase -auth) -GoogleAuthProvider)]
  (-> (a.) (js/console.dir)))
=> nil
(let [a (. (. firebase -auth) -GoogleAuthProvider.)]
  (-> a (js/console.dir)))
=> nil

p-himik 2021-05-29T07:43:28.413800Z

What exactly do you mean by "does not work"? The difference is that in the below code the last . is simply ignored. You end up getting that class (assuming it's a class) and not instantiating it.

Schpaa 2021-05-29T07:53:44.414200Z

does not work, as in, produces no instance, the below does. What do you mean with “ignoring the last .”

Schpaa 2021-05-29T07:55:24.414400Z

Where this is used

(defn sign-in [auth-provider opts]
  (-> (auth)
      (.signInWithPopup (auth-provider.))
      (.then (fn [^js result]))
      ;don't need to do anything

      (.catch (fn [e]
                (if-let [handler (:error-handler opts)]
                  (handler e)
                  (js/alert e))))))

(defn google-sign-in [opts]
  (sign-in (.. firebase -auth -GoogleAuthProvider) opts))

p-himik 2021-05-29T08:02:44.415100Z

Try to see the compiled output of (. (. firebase -auth) -GoogleAuthProvider.) - I'm pretty sure the last dot won't result in new. In your example, you have (auth-provider.) inside. You already have that new there. If you use the very first statement from the code block in the OP, you'll end up with new (new GoogleAuthProvider()).

Schpaa 2021-05-29T08:03:52.415300Z

Thanks for the response and expl. Will have to digest this

Schpaa 2021-05-29T08:07:55.415500Z

What you first say makes sense now, I have of course swapped the first and second forms in the OP

Njeri 2021-05-29T16:45:28.416300Z

I have a function that needs to run before the Figwheel server starts. Is there a way to run the function without having to install lein-ring and use its :init key?

lread 2021-05-29T17:02:53.419200Z

I’ve already asked over at #figwheel-main, but am wondering if anybody else is having issues with ClojureScript 1.10.866 when running tests under figwheel main. My tests run fine under figwheel main with ClojureScript 1.10.844 but don’t seem to even compile when using 1.10.866.

2021-05-29 11:38:13.987:INFO::main: Logging initialized @3794ms to org.eclipse.jetty.util.log.StdErrLog
[Figwheel:WARNING] Making target directory "target" and re-adding it to the classpath (this only needs to be done when the target directory doesn't exist)
[Figwheel] Compiling build fig to "target/public/cljs-out/fig-main.js"
[Figwheel] Failed to compile build fig in 0.22 seconds.
[Figwheel:WARNING] Compile Exception: Assert failed: Namespace rewrite-clj.node-test does not exist
(ana-api/find-ns ns)  
[Figwheel:SEVERE] 

lread 2021-05-29T17:04:24.419700Z

Cljs tests run fine under shadow-cljs, planck and cljs-test-runner.

borkdude 2021-05-29T20:15:32.424900Z

@lee does the project work when requiring the code or is it only about the tests?

lread 2021-05-29T20:16:48.425500Z

just the tests under figwheel

lread 2021-05-29T20:18:47.427300Z

found a similar usage of figwheel in another project that fails in same way, have described in #figwheel-main

borkdude 2021-05-29T20:19:54.428Z

interesting. do the tests of figwheel-main proper pass with cljs newest? log an issue with figwheel-main I'd say?

lread 2021-05-29T20:48:32.430400Z

yeah, seems like ClojureScript has changed in some way that figwheel main might need to adapt to.

lread 2021-05-29T20:52:00.431300Z

Wasn’t sure if it was a ClojureScript or figwheel main issue, will start with raising an issue over at figwheel main

borkdude 2021-05-29T21:04:54.431500Z

could also try a message in #cljs-dev

lread 2021-05-29T21:30:09.432400Z

Yeah true, probably should, I’ve started with an https://github.com/bhauman/figwheel-main/issues/295.

borkdude 2021-05-29T22:06:03.433500Z

Perhaps it should be using cljs.analyzer.api/parse-ns

lread 2021-05-30T11:38:17.436600Z

Maybe... but I think I’ll leave this one to @bhauman and @mfikes to sort out.

lread 2021-05-30T11:41:44.438300Z

I wonder if adding some figwheel-main tests to cljs canary tests would be helpful moving forward,

mfikes 2021-05-30T14:39:02.438600Z

https://clojure.atlassian.net/browse/CLJS-3311

❤️ 2