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
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.
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
If you don't get an answer here, there's #shadow-cljs
if you only use shadow-cljs.edn
then :maven {:local-repo "foo"}
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
?
no, there is no option for that
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
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.
does not work, as in, produces no instance, the below does. What do you mean with “ignoring the last .”
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))
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())
.
Thanks for the response and expl. Will have to digest this
What you first say makes sense now, I have of course swapped the first and second forms in the OP
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?
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]
Cljs tests run fine under shadow-cljs, planck and cljs-test-runner.
@lee does the project work when requiring the code or is it only about the tests?
just the tests under figwheel
found a similar usage of figwheel in another project that fails in same way, have described in #figwheel-main
interesting. do the tests of figwheel-main proper pass with cljs newest? log an issue with figwheel-main I'd say?
yeah, seems like ClojureScript has changed in some way that figwheel main might need to adapt to.
Wasn’t sure if it was a ClojureScript or figwheel main issue, will start with raising an issue over at figwheel main
could also try a message in #cljs-dev
Yeah true, probably should, I’ve started with an https://github.com/bhauman/figwheel-main/issues/295.
@lee perhaps it's swallowing an exception here: https://github.com/bhauman/figwheel-main/blob/ead06b94b1b2747ed37e5d8c37118d6e7ae77193/src/figwheel/main/testing.cljc#L82
Perhaps it should be using cljs.analyzer.api/parse-ns
I wonder if adding some figwheel-main tests to cljs canary tests would be helpful moving forward,