@thheller First, I find shadow-cljs to be an amazing piece of software, thank you! I like to turn autobuild off, but then I would like it to recompile if I reload the browser. Is there a simple way to achive that?
I imagine some kind of before-load function on the java side that can call compile!
@maxt you can toggle the autobuild from a CLJ REPL via (shadow/watch-set-autobuild! :the-build false)
and then trigger a compile via (shadow/watch-compile! :the-build)
.
a compile trigger when you reload the browser does not exist
Hello @thheller, I've just created a pull request to add a shim file to the shadow-cljsjs library, whould you be so kind as to review the changes and accept. This is my first shim file created and any pointers would be appriciated, Thanks
why did you create it? I can't find the keycloak-js package here https://github.com/cljsjs/packages
also which library is using the cljsjs.keycloak-js?
I want to expose the Keycloak global variable after installing keyclaok-js (using yarn add keycloak-js), as our code is not able to access it using js/Keycloak
why do you want to access it via js/Keycloak
? if this is just for your code and not a public library then put the shim file onto your classpath. no need for it to be in shadow-cljsjs
just (:require ["keycloak-js" :as keycloak-js]
in your code and use keycloak-js
instead of js/Keycloak
?
no need for this cljsjs indirection if its your code anyways and not some official cljsjs package you are trying to replace
OK thanks for the prompt reply, I will let you know if there are any further issues 🙂
@thheller to create a compile-on-reload trigger, could I write a cljs :before-load function that somehow signals the shadow server to recompile?
no, before-load is triggered after a compile completes. not when the browser reloads.
if you have a custom server, that could trigger the recompile when the request comes in
ok, make sense.
ah, right.
Yes that would solve it, thanks!
I use keycloak with shadow-cljs regularly. Pulling it in through NPM and using it with (:require ["keycloak-js" :as keycloak-js])
works great for me. If you have any specific questions about it I'd be glad to answer them.