Fork me on GitHub
#clojurescript
<
2021-04-15
>
km00:04:31

Hey everyone, setup question: I'm working with some non-sighted programmers who run emacs on a text-only machine, no desktop environment. Using shadow-cljs (via cider-jack-in) to build a reagent app, and hosting it on a local wordpress docker. We can visit the wordpress from another machine in a standard browser, and the shadow-cljs frontend is there. What doesn't work is interactive repl commands - entering (println "hello world") to the cider-repl in emacs will throw "no available JS runtime." I'm looking through lein, shadow and CIDER docs. Seems like there should be a one-liner to connect a remote repl this way, but it's evaded me so far. If anyone could give me an obvious hint, I'd really appreciate. Thanks!

djblue01:04:01

How is the local wordpress docker instance loading the app from the shadow-cljs dev server?

djblue01:04:26

"no available JS runtime." usually means the app isn't loaded in any browser window

3
km01:04:41

after starting cider-jack-in to "watch" the build, then I mount the whole project into the docker as a wordpress plugin, and enqueue it from the plugin.php: function plugin_init() { wp_enqueue_script( 'cljs-frotend-script', plugins_url( 'build/frontend.js', __FILE__ ), array(), '', true ); } add_action( 'wp_enqueue_scripts', 'plugin_init' );

km01:04:21

maybe we didn't have the app open in a browser at the time, though. I'll double-check

👌 3
dpsutton02:04:45

I’ve seen this happen when the cider middleware isn’t on the class path

km02:04:36

hmm! I'll check on this too. thanks

macrobartfast04:04:40

sorry to topically hijack… but… you can build WordPress front-ends with shadow-cljs?

macrobartfast04:04:52

Of course, when I think about it, of course you can. But wow… so cool.

km21:04:22

yeah, I'm trying to figure out how to write blocks in the wordpress gutenberg backend, too. it mostly works, a few bugs

km21:04:25

@U1G869VNV was right, we miscommunicated & didn't have the page loaded in a browser at the time. everything works normally

💯 3
ribelo23:04:44

I don't know if this is the right place, but how can I use goog.events.DispatchEvent? The rest of the goog is totally clear, but that's what I'm having trouble with

Assertion failed: Can not use goog.events.dispatchEvent with non-goog.events.Listenable instance.

ribelo23:04:03

as far as I understand, despite the name, it is not a replacement for js/dispatchEvent