klipse

Yehonathan Sharvit 2024-10-01T09:00:54.659749Z

@penryu I had to downgrade ClojureScript and CodeMirror since the https://github.com/viebel/klipse/blob/master/contributing.md failed. See https://github.com/viebel/klipse/commit/167b661b4a5a2c90a3b901ee6d0e018f848add95

👍 2
penryu 2024-10-03T08:56:11.787829Z

I had another run at bumping (this time with testing!). CodeMirror With codemirror at 5.65.16-0, I saw issues with the codemirror fields being sized incorrectly, and having scrollbars when they shouldn't. I'm guessing this is what you saw. At 5.31.0-0, these artifacts did not appear, and all the examples looked normal (to me). So that seems like a safe bump... if you're interested.

penryu 2024-10-03T13:58:34.417129Z

Bumping cljs caused lots of "Use of undeclared Var" for cljs.analyzer/cljs-seq? and cljs.analyzer/cljs-map? — these functions moved to cljs.analyzer.impl. Unfortunately these were references from the klipse-clj library... I kept bumping dep versions in klipse-clj until the build errors disappeared. (Mostly around goog API changes.) Also, js-interop changed namespace a few years ago so bumped that. No functional changes in klipse-clj library, but enough changes around deps that it might warrant a major version bump. I'll leave that up to you.

penryu 2024-10-03T13:59:00.571559Z

Anyway, more detail (and fixes) in: • https://github.com/viebel/klipse-clj/pull/10https://github.com/viebel/klipse/pull/410

penryu 2024-10-03T06:28:57.679119Z

D'oh! That's on me. Sorry 😞

penryu 2024-10-01T09:59:35.669299Z

Is there any way to require libraries in a Lua klipse?

Yehonathan Sharvit 2024-10-01T10:02:12.384819Z

Not for the moment

Markus Agwin 2024-10-01T11:52:32.567839Z

Thank you for the upgrade! Wile the old stopped working for me, I updated to and it works splendid.

penryu 2024-10-01T02:35:22.334509Z

Greetings! I'm integrating klipse into my site, and have it working well! Then I got ambitious and thought I'd build my own to incorporate recent clojure (1.12.0), cljs (1.11.132), and core.async versions, by bumping the versions in deps.edn, and that seems to be working as well! (Or at least, *clojurescript-version* returns "1.11.132"... in my snippets; I haven't done extensive testing.) Now I'm going through https://clojurescript.org/guides/promise-interop#using-promises-with-core-async But when I try this using the cljs REPL directly, I get:

% clj -M --main cljs.main --repl-env node
ClojureScript 1.11.132
cljs.user=> (require '[cljs.core.async.interop :refer-macros [<p!]])
I see code snippets of other people referencing that lib being used in this channel, but not in a while, so I'm wondering if it's been removed, or if I'm just missing something?

Yehonathan Sharvit 2024-10-01T02:37:09.449319Z

What error are you seeing?

penryu 2024-10-01T02:45:06.411109Z

Sorry, was trying to get a more complete info. The error I'm getting in the out container is:

Execution error.
No such namespace: cljs.core.async.interop, could not locate cljs/core/async/interop.cljs, cljs/core/async/interop.cljc, or JavaScript source providing "cljs.core.async.interop"

Yehonathan Sharvit 2024-10-01T02:48:52.720779Z

Do you get the same errors without bumping the libs?

penryu 2024-10-01T02:48:56.236859Z

Which almost sounds like core.async is missing entirely, except that I can require (require '[cljs.core.async :refer [<! chan go put!]]) without problem.

Yehonathan Sharvit 2024-10-01T02:49:42.840339Z

Why are you using :refer-macros instead of :refer?

penryu 2024-10-01T02:55:38.362719Z

Only because that's what the original article had. It doesn't work with :refer either. (Still fetching data to answer your other question(s).)

Yehonathan Sharvit 2024-10-01T02:57:48.069779Z

I think I get it

penryu 2024-10-01T02:58:07.626159Z

This is with the unbumped libs, using the google cdn listed in the README:

(require '[cljs.core.async :refer [<! chan go put!]])
(require '[cljs.core.async.interop :refer [<p!]])

(def ch (chan))

(go (let [ver *clojurescript-version*
          name (<! ch)]
      (println "Hello," name ver)))

(put! ch "ClojureScript")
-------
Execution error.
No such namespace: cljs.core.async.interop, could not locate cljs/core/async/interop.cljs, cljs/core/async/interop.cljc, or JavaScript source providing "cljs.core.async.interop"

Yehonathan Sharvit 2024-10-01T02:58:14.472029Z

You need to bump the libs in this repo https://github.com/viebel/cljs-analysis-cache since Klipse fetches libs dynamically over the wire

penryu 2024-10-03T13:17:11.772579Z

I'm still not able to access the cljs.core.async.interop namespace, because https://viebel.github.io/cljs-analysis-cache/cache//cljs_SLASH_core_SLASH_async_SLASH_interop.js is still yielding an HTTP 404 😞 If I'm reading https://github.com/clojure/core.async/commit/4b71889e1ba2c909ff30e75af37f7c41e0b75fc7 right, it looks like the interop namespace was added in core.async 1.1.582 (4years ago), which was well before the 1.3.610 that shadow-cljs required before (3 years ago) 1.5.648 that the newer shadow-cljs had. So it seems like it should be available.... and probably even should have been available before. Everything keeps coming back to shadow-cljs: it's simply not generating the interop namespace. • It does generate several files from that namespace, including https://github.com/viebel/cljs-analysis-cache/blob/master/cache/cljs_SLASH_core_SLASH_async.js. • But any attempt to compile the rest of the namespace by adding it to :entries in shadow-cljs.edn triggers a build error: > The required namespace "cljs.tagged_literals.JSValue" is not available, it was required by "cljs/core/async/impl/ioc_macros$macros.cljc". You can https://clojurians.slack.com/archives/C6N245JGG/p1727960924792429, or I can just let you know what I find out. 🙂

Yehonathan Sharvit 2024-10-01T08:21:32.540039Z

Merged and deployed cljs-analysis-cache. Let me know if it works now

penryu 2024-10-01T04:07:05.558079Z

So shadow-cljs.edn doesn't mention clojure, cljs, nor core.async versions. But after updating them in klipse, the klipse build failed due to a missing (new?) dep on data.json, so I added that to cljs-analysis-cache while I was at it. And since it was missing the sublib in core.async, I added that to the shadow-cljs.edn as well. But when I went to build it, this warning was in the output:

WARNING: The org.clojure/core.async dependency in shadow-cljs.edn was ignored. Default version is used and override is not allowed to ensure compatibility.
The versions provided by shadow-cljs can be found here: 
Checking that URL, I find that shadow-cljs has a hard dep on org.clojure/core.async 1.3.610, and apparently refuses to even let us generate code from a different version. Bumping shadow-cljs in package.json and re-running yarn changes that warning to mention https://clojars.org/thheller/shadow-cljs/versions/2.28.16 instead, which now lists the hard-dep as org.clojure/core.async 1.5.648... Which might be enough for this?

Yehonathan Sharvit 2024-10-01T04:30:44.367719Z

Let's hope so

penryu 2024-10-01T04:37:14.116019Z

Is this something you want a PR for?

Yehonathan Sharvit 2024-10-01T04:39:57.276369Z

Absolutely

penryu 2024-10-01T04:40:10.745159Z

Excellent. Coming up.

penryu 2024-10-01T05:06:52.631949Z

PRs: • https://github.com/viebel/klipse/pull/409https://github.com/viebel/cljs-analysis-cache/pull/4 I tried to follow directions and best practices, but I might have missed something. Also, looks like joker was a little aggressive with the EDN formatting.

Yehonathan Sharvit 2024-10-01T02:58:40.767819Z

(Going offline for a couple of hours)

penryu 2024-10-01T03:04:18.965849Z

Ah, that makes sense. Thanks!

Yehonathan Sharvit 2024-10-01T04:40:24.854919Z

Can you share a link to your blog?

penryu 2024-10-01T05:37:09.843809Z

Will do as soon as I iron out all the CSP exclusions. 🙂