closure-defines control nothing related to source maps. CLJS currently does not support this I believe. there are a couple open issues in Jira regarding this IIRC. shadow-cljs does support this and does it by default.
thanks, I came to the same conclusion
Hi, I’m implementing Apple Sign In in React Native using this library: https://github.com/invertase/react-native-apple-authentication And there’s a handler for the onPress event of the Apple Sign-In button given like so: https://gist.github.com/zendevil/704508e46017910cfcdfda28768e89ec However, when I convert this to clojurescript like so: https://gist.github.com/zendevil/9b6a6f7a65351ead4cac5759eb051cdd I’m getting the following error: https://gist.github.com/zendevil/f2fa1d09f3946cdbf2bdb04f8d687612 How can I fix this error?
I also tried doing this: https://gist.github.com/zendevil/86ed457dea608d3a2c5cde04b40b4b8f But that gives: “RNAppleAuth.AppleAutRequestOptions ‘requestedScopes’ must be an array value if provided.” And removing ‘requestedScopes’ gives a “Promise error”.
hello, does anyone know if there a way to detect the compiler version (or closure version) and branch code depending on that? i'm trying to work out how to cope with the https://clojurescript.org/news/2021-04-06-release in a backwards compatible way, namely decide whether to use goog.debug.Logger.Level.SEVERE
or goog.Logger.Level.SEVERE
without knowing the cljs/closure compiler specifics, I’d assume (exists? goog.Logger)
could be one way to find out if you are on the newer version
I think you were close with this solution
you need to add a #js
in front of the the [
bracket in
[(.. appleAuth -Scope -Email)
(.. appleAuth -Scope -FULL_NAME)]
right now it's sending a CLJS vector, when it expects a js array. a way you create one is via #js []
this looks like the clj->js
call is coercing the EMAIL and other special values into invalid things. writing out the JS data structure by hand is probably the smartest thing to do
That is probably more robust than reading the version anyway.
ah perfect, thank you i didn't know about exists?
. it looks to be exactly what i want
Take a look in figwheel-core repo. I believe bhauman just solved the problem your looking at. Could be insightful
@lilactown I tried this:
(.performRequest appleAuth
#js {:requestedOperation (.. appleAuth -Operation -LOGIN)
:requestedScopes #js [(.. appleAuth -Scope -Email)
(.. appleAuth -Scope -FULL_NAME)]})
But that still gives me NSMutableDictionary cannot be converted to ASAutorizationAppleIDRequestInteresting, he used the clojurescript version (which is available, it turns out). But presumably, although unlikely, the Google closure version can differ from the default one if someone excludes the dep and uses their own version. Here's the code in figwheel-core for anyone interested https://github.com/bhauman/figwheel-core/commit/c51aee22b7d28221df67b7d7848fd2ed80df2528#diff-9714a71e9563e0ef626cd84f6f767ebefe31aa5cead69c25bf4ce8c0f3e634fbR122
have a rum component that displays 3 strings from a collection of strings. in my on-click for the component,
{:on-click (fn [_] (do
(reset! names-wedge (take 3 (shuffle names-quiz-terms)))))}
this will cause an infinite loop where the reset! happens over and over again. can i prevent such loops from happening? I run into this behavior sometimes, could someone help clarify how to prevent this or what's going on?do you have any other resets to names-wedge? this doesn't seem like it should cause an infinite loop.
ooh yes there is.
Thank you that was it ! 😃
there was a (reset!) in the body of the component ... just hanging out