clojurescript

ClojureScript, a dialect of Clojure that compiles to JavaScript http://clojurescript.org | Currently at 1.10.879
william 2020-11-23T10:56:37.362100Z

Hey, I'm going through the Etudes for Clojurescript book, and would like to know the general consensus now on which parts of the described ecosystem are up to date

william 2020-11-23T10:57:16.363Z

for example, the book mentions the libraries (`dommy`, domina, enfocus) but the last commit for these one are ~6 years ago

thheller 2020-11-23T10:57:59.363500Z

I don't know the book but that sounds rather outdated. clojurescript hasn't changed much though so those generic parts will still be accurate. Just some libs have changed.

thheller 2020-11-23T11:00:16.364300Z

mostly react based these days. so reagent/re-frame/fulcro/etc

p-himik 2020-11-23T11:01:40.365100Z

I've used dommy and domina a few years ago. Eventually rewrote everything to use clojure.browser.dom where needed.

p-himik 2020-11-23T11:02:02.365400Z

And there's also goog.dom which clojure.browser.dom itself uses.

william 2020-11-23T11:26:49.366500Z

thanks! Could you also suggest a library for interactively displaying graphs (by which I mean, DAGs, not charts)? Is binding to d3 the current choice?

hanDerPeder 2020-11-23T20:14:52.370900Z

I find Vega really pleasant to work with. Theres a project called Oz by metasoarous that wraps it and works on both clojure and clojurescript.

2020-11-23T21:19:24.372400Z

When i switch from clojurescript 1.10.741 to 1.10.773 I started getting this error:

Uncaught Error: find-ns-obj not supported for target bundle
Whenever I try to use cljs.js, does anyone have any idea why this might be happening?

2020-11-23T21:19:35.372700Z

The debug trace isn't particularly helpful:

2020-11-23T21:20:17.373200Z

core.cljs:11642 Uncaught Error: find-ns-obj not supported for target bundle
    at Object.cljs$core$find_ns_obj [as find_ns_obj] (core.cljs:11642)
    at Function.cljs$core$IFn$_invoke$arity$1 (core.cljs:11660)
    at cljs$core$create_ns (core.cljs:11657)
    at Function.cljs$js$compile_str_STAR__$_compile_loop (js.cljs?rel=1606166244828:918)
    at Function.cljs$core$IFn$_invoke$arity$3 (core.cljs:3918)
    at Function.cljs$core$IFn$_invoke$arity$2 (core.cljs:3913)
    at Function.cljs$core$IFn$_invoke$arity$2 (core.cljs:3948)
    at core.cljs:10831
    at Function.cljs$core$IFn$_invoke$arity$1 (core.cljs:10826)
    at Function.cljs$core$IFn$_invoke$arity$variadic (core.cljs:10831)
react-dom.development.js:327 Uncaught Error: find-ns-obj not supported for target bundle
    at Object.cljs$core$find_ns_obj [as find_ns_obj] (core.cljs:11642)
    at Function.cljs$core$IFn$_invoke$arity$1 (core.cljs:11660)
    at cljs$core$create_ns (core.cljs:11657)
    at Function.cljs$js$compile_str_STAR__$_compile_loop (js.cljs?rel=1606166244828:918)
    at Function.cljs$core$IFn$_invoke$arity$3 (core.cljs:3918)
    at Function.cljs$core$IFn$_invoke$arity$2 (core.cljs:3913)
    at Function.cljs$core$IFn$_invoke$arity$2 (core.cljs:3948)
    at core.cljs:10831
    at Function.cljs$core$IFn$_invoke$arity$1 (core.cljs:10826)
    at Function.cljs$core$IFn$_invoke$arity$variadic (core.cljs:10831)

p-himik 2020-11-24T17:08:52.402100Z

@dnolen It's my first time debugging something like this so please excuse me if I spurt out some nonsense but it seems that 0c557550 has broken this scenario. It works in 1.10.758 and doesn't in 1.10.764. The former has *target* bound to "default" while the latter has it bound to "bundle".

p-himik 2020-11-23T21:31:22.373500Z

I don't think you can dynamically created namespaces in a non-boostrapped CLJS.

2020-11-23T21:32:06.373700Z

I thought I was in bootstrapped CLJS?

p-himik 2020-11-23T21:33:08.374Z

target bundle says otherwise.

2020-11-23T21:33:17.374200Z

Like, I'm evaluating this with cljs.js/compile.str

2020-11-23T21:33:20.374400Z

I see.

2020-11-23T21:33:28.374600Z

So may I ask why it used to work?

2020-11-23T21:33:45.374800Z

Or was that just some bug that happened to make it work just fine?

p-himik 2020-11-23T21:35:51.375Z

Dunno. Seems like the code of find-ns-obj hasn't changed in years. Maybe someone with more knowledge will chime in.

2020-11-23T21:36:24.375200Z

I see.

p-himik 2020-11-23T21:36:41.375400Z

If you have the time, I would create a minimal reproducible example.

2020-11-23T21:36:50.375600Z

Sure, I can do that.

2020-11-23T23:15:34.376300Z

Okay, I've made a fairly minimal example of this problem: https://github.com/LeifAndersen/cljs-find-ns-example

2020-11-23T23:16:48.377500Z

When you move the comment from line 3 to line 4 (switching from 1.10.773 to 1.10.741) the program works.

2020-11-23T23:17:11.378100Z

(Run lein figwheel and 3 will appear in the browser console.

2020-11-23T23:17:15.378400Z

)

2020-11-23T23:17:25.378700Z

But when you don't, you'll get that error.

2020-11-23T23:17:33.379Z

Oh, tagging @p-himik again

phronmophobic 2020-11-23T23:32:34.379100Z

hmmm. I was able to reproduce the issue (works with one version, but not with the other). there is a #bootstrapped-cljs channel that you can try for issues relating to bootstrapping

phronmophobic 2020-11-23T23:53:18.379300Z

fwiw, I was able to get it to "work" with the :target set to nodejs

bash-3.2$ node js/development/app.js                                                                                                           
{:ns cljs.user, :value 3}