[ClojureScript] Re: shadow-cljs and lein ring uberjar

2020-06-24 Thread Thomas Heller
Hard to say what you are doing without seeing the config. Your config is 
doing this, neither lein or shadow-cljs will do this on their own.

I typically recommend keeping things separate since that make things much 
easier to understand and debug.

shadow-cljs release app && lein ring uberjar

lein or ring don't need to do anything with CLJS other than taking the 
files shadow-cljs produced and putting them into the .jar they create. That 
typically happens automatically if you output to some folder on your 
classpath (eg. resources/public/js).


On Monday, June 22, 2020 at 9:01:35 PM UTC+2, Scott Klarenbach wrote:
>
> When I run "lein ring uberjar", after it builds the jar file it triggers 
> the shadow-cljs :app build and rebuilds all client code.
>
> I was wanting it to just build the jar file, since the client build is 
> triggered using lein prod.
>
> Is this default behavior or have I screwed something up?
>

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojurescript/a34d7b56-397a-47e8-8833-4edce7ef191co%40googlegroups.com.


[ClojureScript] Re: Maximum Stack Size exceeding in clojurescript when using with Google Maps API

2020-06-24 Thread Thomas Heller
You are passing a CLJS map into the js/google.maps.Map. call. Convert it 
via (clj->js {:center ...}) first or use the #js literal.


On Wednesday, June 24, 2020 at 8:35:14 AM UTC+2, Casey Sparrow wrote:
>
> I have the following function that loads the google maps api:
>
> ```
> (defn load-google-maps-api []
> (js/console.log "script element is " script)
>
> (set! (.-src script) "
> https://maps.googleapis.com/maps/api/js?key=AIzaSyD1r7IEMfQzY&callback=init_delivery_map
> ")
>
> (set! (.-defer script) true)
> (set! (.-async script) true)
> (set! (.-init-delivery-map js/window)
>   (fn []
> (prn "setting delivery-map")
> (reset! delivery-map
>   (js/google.maps.Map. (js/document.getElementById 
> "delivery-map")
>{:center {:lat 37.0 :lng 
> -122.0}}
>
> (.append (js/jQuery "head") script)
>
> )
>
> ```
>
> which I call when an event is triggered. However, the line ```(.append 
> (js/jQuery "head") script)``` in conjunction with the line. (set! (.-src 
> script) "
> https://maps.googleapis.com/maps/api/js?key=AIzaSyD1r7IEMfQzY&callback=init_delivery_map
> ")
>
>  ``
>
> cause the error:
>
> ```
> Uncaught (in promise) RangeError: Maximum call stack size exceeded
> at Object.cljs$core$array_index_of [as array_index_of] (core.cljs:6592)
> at Object.cljs$core$array_map_index_of [as array_map_index_of] 
> (core.cljs:6607)
> at ni.eval [as cljs$core$ILookup$_lookup$arity$3] (core.cljs:6892)
> at ni.eval [as get] (core.cljs:6822)
> at ni.streetView_changed 
> (js?key=AIzaSyD1r7IwW4_MfQzY&callback=init_delivery_map&_=1592974955286:217)
> at $d 
> (js?key=AIzaSyD1r_MfQzY&callback=init_delivery_map&_=1592974955286:63)
> at ni._.O.set 
> (js?key=AIzaSyD1r7IEvvf6w8FlMfQzY&callback=init_delivery_map&_=1592974955286:181)
> at ni.streetView_changed 
> (js?key=AIzaSyD1r7IEvMfQzY&callback=init_delivery_map&_=1592974955286:217)
> at $d 
> (js?key=AIzaSyD1r7IEvvf6w8FlHu3k_hP_oJwW4_MfQzY&callback=init_delivery_map&_=1592974955286:63)
> at ni._.O.set 
> (js?key=AI_MfQzY&callback=init_delivery_map&_=1592974955286:181)
>
> ```
>
> Suggesting that the maximum call stack is less than what it should be. 
> Because the javascript version of this code doesn't give this error and 
> works:
>
> ```
> function loadGoogleMapsApi() {
> var script = document.createElement('script');
> script.src = '
> https://maps.googleapis.com/maps/api/js?key=AIzaSyD1r7IEvvf6w8FlHu3k_hP_oJwW4_MfQzY&callback=initDeliveryMap
> ';
> script.defer = true;
> script.async = true;
>
> window.initDeliveryMap = function() {
> console.log("init map");
> console.log("Element is ", 
> document.getElementById("delivery-map"));
> deliveryMap = new 
> google.maps.Map(document.getElementById("delivery-map"), {
> center: { lat: 37.7749, lng: -122.4194 },
> zoom: 8
> });
> };
>
> document.head.appendChild(script);
>
> }
>
>
> ```
>

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojurescript/835d8078-afac-4340-8c16-f1022d2cb7fdo%40googlegroups.com.