good morning, we are using :repl {:runtime-select :latest}
in our project and like it. Now I’ve added an iframe that also runs a cljs target that’s built with shadow. Is there a way to opt out of shadow considering this iframe for the repl? I’d like shadow to use the latest main window for the repl…
both of these use the same build but a different module.
trying to switch this manually with shadow.cljs.devtools.api
I noticed that my repl-runtimes are missing the :runtime-id
key that’s needed for me to switch this or am I misunderstanding the api?
(repl-runtimes :website)
;; => [{:since #inst "2020-11-25T07:44:05.319-00:00", :proc-id "68613cad-86ad-44ea-a950-32dac30914ec", :connection-info {:remote true, :websocket true}, :client-id 45, :user-agent "Chrome 537.36 [MacIntel]", :type :runtime, :lang :cljs, :build-id :website, :host :browser, :dom true} {:since #inst "2020-11-25T07:44:07.842-00:00", :proc-id "68613cad-86ad-44ea-a950-32dac30914ec", :connection-info {:remote true, :websocket true}, :client-id 46, :user-agent "Chrome 537.36 [MacIntel]", :type :runtime, :lang :cljs, :build-id :website, :host :browser, :dom true}]
@mkvlr switching that way is currently not supported. https://github.com/thheller/shadow-cljs/issues/776
I'll see about fixing that. not many people use it so I forgot 🙂
cool, thanks a lot!
do you think adding a flag to not consider a certain frame from becoming the active repl might also make sense?
not likely that a lot of people run into this problem though…
the problem is that there is no easy way to identify something
and iframe looks just like any other normal document
sure, maybe a js global to opt out?
it does identify workers but even with multiple workers it can't identify between them
sure that would work. must be something coming out of the document loading the JS
that would work for our case
@mkvlr in 2.11.8
you can set <script>var SHADOW_CONFIG = { repl: false };</script>
in the HTML (before the actual script
) to opt-out of the REPL for that page
the actual manual REPL select logic I'll need to think about for a bit
@thheller wow, thanks so much!
hey, I'm new to clojurescript, could you guide me in the process of adding the cytoscape-cola library to a project using shadowjs?
Here's what I know: I can't use cljsjs
because shadow-clj
doesn't support that, so I think I have to install the library via npm install cytoscape-cola
Then I added (:require ["cytoscape-cola" :as cyto])
I seem to have solved my problem now, thanks 🙂