clojurescript

ClojureScript, a dialect of Clojure that compiles to JavaScript http://clojurescript.org | Currently at 1.10.879
km 2021-04-15T00:43:31.193200Z

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!

macrobartfast 2021-04-16T04:30:40.204800Z

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

macrobartfast 2021-04-16T04:30:45.205Z

#mind-blown

macrobartfast 2021-04-16T04:32:52.205200Z

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

km 2021-04-16T21:21:22.214700Z

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

km 2021-04-16T21:29:25.215Z

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

💯 1
djblue 2021-04-15T01:07:01.193400Z

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

djblue 2021-04-15T01:07:26.193600Z

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

✅ 1
km 2021-04-15T01:43:41.193800Z

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' );

km 2021-04-15T01:52:21.194Z

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

👌 1
dpsutton 2021-04-15T02:04:45.194800Z

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

km 2021-04-15T02:54:36.195Z

hmm! I'll check on this too. thanks

2021-04-15T23:37:44.197500Z

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.

2021-04-15T23:41:03.197900Z

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