is there a way I can manually connect to a remote running figwheel repl? Basically, I want to set `:connect-url` dynamically in my cljs runtime, and manually trigger the connect, rather than automatically and hardcoded connect-url in the build
seems I should be able to use figwheel.repl/connect
somehow to do this, from https://github.com/bhauman/figwheel-repl/blob/master/src/figwheel/repl/preload.cljs
This isn't exactly what you had in mind and so maybe won't scratch your particular itch but I run Figwheel on a remote server. My solution is to run Node, use that as the 'default' client and then set all Figwheel to broadcast all messages to all clients.
Here's my Node script: https://github.com/pyrmont/pondent/blob/master/fig.js
Hm, I see. Yeah, not sure if it's helpful. Basically, what I want to be able to do, is stop figwheel from making the client > server connection automatically, and make it on-demand, so I can ship it to our staging environment as well, and if testers/product team finds issues, they can click one button for me to get a live repl session into their browser session. If that makes sense
No, it does. It's an interesting idea. I never thought about trying to do it that way.
Yeah, currently have a kind of manual step, where there is a debug bar with a button that takes the app-db re-frame is using, serializes it and POST it to a server that stores it and gives a ID back, then testers/product send me that ID and I can inject the session locally. Just want to make it a bit smoother and with a live env as well
I might just open a issue in figwheel-main instead, get more eyes and maybe someone has a solution already. Thanks a lot though @mike858 🙂
Here's my dev environment:
^{:watch-dirs ["src", "test"]
:broadcast true
:css-dirs ["resources/public/css"]
:cljs-devtools false
:launch-js ["node" "fig.js" :open-url]
:open-url "<http://[%5Bserver-hostname%5D]:%5B%5Bserver-port%5D%5D/index.html|http://[[server-hostname]]:[[server-port]]/index.html>"
:ring-server-options {:host <server URL> :port 8000}}
{:main pondent.core}}
If you had your testers run this on their machines, you'd be able to connect to their instances.
It wouldn't give you the REPL session, though. So isn't quite what you want.
Oh, well, no, it would give you that on the staging server. You'd have to SSH into that and access the REPL remotely. The problem would be that every tester would be receiving all messages from every other connected user which I think might bork things if you have more than one tester at a time.
Anyway, something to think about! Good luck!
Hm, interesting. Yeah, might be able to turn it around somehow with what you gave me. Thanks a lot!