Fork me on GitHub
#clojurescript
<
2020-11-23
>
Carlo10:11:37

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

Carlo10:11:16

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

thheller10:11:59

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.

thheller11:11:16

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

p-himik11:11:40

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

p-himik11:11:02

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

Carlo11:11:49

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?

hanDerPeder20:11:52

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.

leif21:11:24

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?

leif21:11:35

The debug trace isn't particularly helpful:

leif21:11:17

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-himik21:11:22

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

leif21:11:06

I thought I was in bootstrapped CLJS?

p-himik21:11:08

target bundle says otherwise.

leif21:11:17

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

leif21:11:28

So may I ask why it used to work?

leif21:11:45

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

p-himik21:11:51

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

p-himik21:11:41

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

leif21:11:50

Sure, I can do that.

phronmophobic23:11:34

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

phronmophobic23:11:18

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}

leif00:11:29

@U7RJTCH6J Hmm...that channel seems empty?

phronmophobic00:11:57

bootstrapping is pain and it's not done very often

phronmophobic00:11:44

I have posted odd questions and gotten responses from mike fikes within a few days

leif00:11:34

@U7RJTCH6J Ah, okay then. I'll ask there. Thanks.

phronmophobic00:11:05

his blog is also a good resource, but you may have to do some digging, https://blog.fikesfarm.com/tags/Bootstrap.html

phronmophobic00:11:43

I would try to help more, but I'm pretty unfamiliar with npm and bundle

phronmophobic00:11:15

and it seems like the issue might be related to using the bundle target

leif00:11:08

@U7RJTCH6J No worries. I'll dig a bit on his blog then ask.

leif00:11:14

I do appreciate the help. 🙂

leif00:11:25

(Or at least the attempt and the resources. 😉 )

👍 3
p-himik17:11:52

@U050B88UR 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".

leif23:11:34

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

leif23:11:48

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

leif23:11:11

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

leif23:11:25

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

leif23:11:33

Oh, tagging @p-himik again