dirac

Dirac v1.7.2 is out: https://github.com/binaryage/dirac/releases/tag/v1.7.2
baptiste-from-paris 2017-03-11T17:16:05.367876Z

hey @darwin , how are you ?

baptiste-from-paris 2017-03-11T17:16:20.369085Z

Front-end question for you if you have some time to answer ^^

baptiste-from-paris 2017-03-11T17:16:51.371456Z

do you use cljs and react, if yes, what cljs lib do you use

2017-03-11T17:16:52.371540Z

yep

2017-03-11T17:17:05.372409Z

reagent for smaller things

2017-03-11T17:17:14.373043Z

would use om.next for something serious

baptiste-from-paris 2017-03-11T17:17:24.373764Z

ok

baptiste-from-paris 2017-03-11T17:17:40.374972Z

have you done some om.next jobs yet ?

2017-03-11T17:18:03.376676Z

not yet, just a mid-size om project a few years back

baptiste-from-paris 2017-03-11T17:18:21.377849Z

ok

2017-03-11T17:18:25.378132Z

https://github.com/darwin/faceboard

baptiste-from-paris 2017-03-11T17:19:07.381167Z

nice !

2017-03-11T17:19:40.383580Z

that’s why I needed cljs-devtools 🙂

2017-03-11T17:19:52.384365Z

… to build something like

baptiste-from-paris 2017-03-11T17:20:38.388524Z

and dirac story ?

baptiste-from-paris 2017-03-11T17:20:45.388952Z

after building devtools ^^

baptiste-from-paris 2017-03-11T17:20:46.389015Z

?

2017-03-11T17:21:19.391235Z

started with this figwheel PR: https://github.com/bhauman/lein-figwheel/pull/309

2017-03-11T17:21:41.392867Z

I thought I could do that on top of figwheel

baptiste-from-paris 2017-03-11T17:22:07.394771Z

by the way, have you checked this => https://github.com/cgrand/unrepl

2017-03-11T17:22:30.396466Z

not aware of it, thanks

baptiste-from-paris 2017-03-11T17:23:35.401084Z

really new, like few weeks ago

2017-03-11T17:33:15.444877Z

not sure what problem that unrepl project is exactly trying to solve, will watch it

2017-03-11T17:34:00.448276Z

also it looks like the guy is focused clojure, not on cljs at all

2017-03-11T17:35:08.453538Z

part of the problem with complexity of cljs tooling is that it stems from clojure tools, often as hacks on top of clojure-way IMO

2017-03-11T17:35:30.455310Z

at least the cljs REPL/piggieback story 🙂

baptiste-from-paris 2017-03-11T17:49:47.518061Z

I am not at home but I'll send you the link which explains the reasons

1✅
yalu 2017-03-11T18:27:16.687768Z

in my namespace I have required [goog.i18n.uChar :as u]. In Dirac repl if I do (u/toCharCode "a") I get ReferenceError: u is not defined. am I missing something? I am sure I am in my namespace in the repl. Other than that everywhere in my source file where I have used u/toCharCode is working as expected.

2017-03-11T20:09:12.144894Z

@yalu you are correct, this broke - I have just tested it in the dirac-sample project

2017-03-11T20:09:49.147551Z

generated javascript is u.toCharCode which is wrong

yalu 2017-03-11T20:13:59.165634Z

Thanks @darwin I'm in no hurry I can live with it for now and wait for it to be resolved later. I'm barely getting into Clojure(Script) and must admit I enjoy Dirac very much. Thanks!!!

2017-03-11T20:14:28.167872Z

cool, this is not a blocking issue, just a nuisance I guess

2017-03-11T20:15:16.171264Z

goog.i18n.uChar/toCharCode works as expected, this is just a problem that the alias is for some reason not respected

yalu 2017-03-11T20:17:06.179293Z

Thanks I'll use that workaround for now.

2017-03-11T20:17:32.181218Z

@yalu ah, found the reason, it is not a bug, but feature

2017-03-11T20:17:59.183071Z

you have to first (require ‘your.ns) in the REPL

2017-03-11T20:18:18.184455Z

otherwise repl environment doesn’t know anything about your ns form and your aliases

2017-03-11T20:18:35.185543Z

go through this section: https://github.com/binaryage/dirac-sample#hello-world

yalu 2017-03-11T20:21:36.198226Z

Oh, I got it.. makes sense. Come to think of it that it probably is the same with in other repls as well. I'll go through that sample. Thanks for explaining.

2017-03-11T20:23:17.205104Z

This is traditional REPL behaviour. Dirac does not try to be smart here and try to require the files for you. REPL environment is a separate environment from your runtime. It lives in nREPL server and starts empty.

2017-03-11T20:23:52.207393Z

Figwheel is a bit smarter here and you get access to compiler state which is the result of compiling your cljs project + all incremental builds

2017-03-11T20:24:03.208127Z

that is why you don’t have to do it with Figwheel REPL (AFAIK)

yalu 2017-03-11T20:27:34.222166Z

Ah! got it. I'm using boot - that's without Figwheel. I do reload stuff with boot-reload.

2017-03-11T20:28:33.226071Z

ok, what editor/IDE do you use?

yalu 2017-03-11T20:29:09.228354Z

Emacs

2017-03-11T20:29:56.231755Z

ok, so I won’t help you here, but IDEs which have support for nREPL have usually commands for loading files in repl, in-ns and other things as keyboard shortcuts

2017-03-11T20:30:21.234050Z

this can be done with Dirac as well: https://github.com/binaryage/dirac/blob/master/docs/integration.md

yalu 2017-03-11T20:31:33.238969Z

I have now run into another problem. My foreign-libs require in my namespace is not loading when i do (require 'my.nammespace).

yalu 2017-03-11T20:33:23.245815Z

I see, I'll study the integration doc. Seems like a little bit more tweaks are in order when not using leiningen and figwheel.

2017-03-11T20:33:53.247654Z

I don’t know much about foreign-libs

2017-03-11T20:34:54.251675Z

but if you spend time to setup a repro case in dirac-sample project, I would look into it

yalu 2017-03-11T20:41:40.278912Z

Thanks for an amazing support. I'll come around to setting up a repo to replicate the type of error, and file an issue with explanations. Support on Boot side of things may improve with things like this.

1👌