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!
sorry to topically hijack… but… you can build WordPress front-ends with shadow-cljs?
#mind-blown
Of course, when I think about it, of course you can. But wow… so cool.
yeah, I'm trying to figure out how to write blocks in the wordpress gutenberg backend, too. it mostly works, a few bugs
@djblue was right, we miscommunicated & didn't have the page loaded in a browser at the time. everything works normally
How is the local wordpress docker instance loading the app from the shadow-cljs dev server?
"no available JS runtime."
usually means the app isn't loaded in any browser window
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' );
maybe we didn't have the app open in a browser at the time, though. I'll double-check
I’ve seen this happen when the cider middleware isn’t on the class path
hmm! I'll check on this too. thanks
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.
as far as I understand, despite the name, it is not a replacement for js/dispatchEvent