Fork me on GitHub
#clojurescript
<
2021-05-29
>
max minoS02:05:22

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-himik07:05:10

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

thheller07:05:15

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

max minoS13:05:42

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?

thheller16:05:50

no, there is no option for that

👍 3
Schpaa07:05:19

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-himik07:05:28

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.

Schpaa07:05:44

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

Schpaa07:05:24

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-himik08:05:44

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()).

Schpaa08:05:52

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

Schpaa08:05:55

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

Njeri16:05:28

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?

lread17:05:53

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] 

lread17:05:24

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

borkdude20:05:32

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

lread20:05:48

just the tests under figwheel

lread20:05:47

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

borkdude20:05:54

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

lread20:05:32

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

lread20:05:00

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

borkdude21:05:54

could also try a message in #cljs-dev

lread21:05:09

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

borkdude22:05:03

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

lread11:05:17

Maybe... but I think I’ll leave this one to @U064J0EFR and @U04VDQDDY to sort out.

lread11:05:44

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