dirac

Dirac v1.7.2 is out: https://github.com/binaryage/dirac/releases/tag/v1.7.2
richiardiandrea 2016-05-29T17:55:27.000426Z

Hey darwin, I was checking my own issue here

richiardiandrea 2016-05-29T17:55:32.000427Z

https://github.com/jupl/boot-cljs-devtools/issues/8

richiardiandrea 2016-05-29T17:56:05.000429Z

and I was wondering if there is a way to detect if the runtime is already installed for both dirac and cljs-devtools

2016-05-29T17:59:15.000430Z

Hi Richard, well, there are some “runtime” functions which will give you the answer, but I’m afraid it won’t be that easy, because boot task cannot really talk to javascript in your page, but I don’t know boot

2016-05-29T17:59:40.000431Z

this is the function in case of Dirac :repl feature: https://github.com/binaryage/dirac/blob/master/src/runtime/dirac/runtime/repl.cljs#L166

richiardiandrea 2016-05-29T17:59:56.000433Z

ahah, Andrea for friends 😄

2016-05-29T18:00:21.000434Z

ah, ok, sorry :

richiardiandrea 2016-05-29T18:00:28.000435Z

ok I'll try I think I might be able to call it at that point

richiardiandrea 2016-05-29T18:00:34.000436Z

np 😄

2016-05-29T18:01:41.000437Z

in case of custom formatters you could check this variable: https://github.com/binaryage/cljs-devtools/blob/master/src/devtools/custom_formatters.cljs#L6 but I could expose it into ‘official’ api, I think

richiardiandrea 2016-05-29T18:02:37.000439Z

that would be great, at the moment boot-cljs-devtools can call any function from dirac and devtools because the ns are on the classpath

richiardiandrea 2016-05-29T18:02:51.000440Z

so it requires and calls ['devtools.core/install! 'dirac.runtime/install!]

richiardiandrea 2016-05-29T18:02:55.000441Z

automagically

2016-05-29T18:03:28.000442Z

btw. both dirac runtime and cljs-devtools can potentially have multiple “features” independently enabled/disabled

richiardiandrea 2016-05-29T18:03:51.000443Z

yes I have noticed that -> https://github.com/jupl/boot-cljs-devtools/issues/6

2016-05-29T18:04:10.000445Z

are you really calling javascript or you are just generating some code which will be emitted into javascript files produced by boot?

richiardiandrea 2016-05-29T18:04:46.000446Z

no it works this way: there is a artifact.cljs.edn that is called by boot for compiling the js

richiardiandrea 2016-05-29T18:05:06.000447Z

that file contains :require and :init-fns keys

richiardiandrea 2016-05-29T18:05:26.000448Z

which are symbols called beforehand

2016-05-29T18:06:03.000449Z

ok, I will add, public api for detecting if given feature key is currently installed

richiardiandrea 2016-05-29T18:06:53.000450Z

in boot-cljs-devtools there are going to be default set of features

richiardiandrea 2016-05-29T18:07:02.000451Z

+ configurable from the command line

richiardiandrea 2016-05-29T18:07:17.000452Z

:repl :custom-formatters are default

2016-05-29T18:07:46.000453Z

I’m also going to add :all features key, so you will be able install all, without specifying them as list

richiardiandrea 2016-05-29T18:08:01.000454Z

oh awesome

2016-05-29T18:08:02.000455Z

also :default, which will behave like now when you don’t specify any parameter to install

richiardiandrea 2016-05-29T18:08:17.000456Z

perfect that saves me some work 😄

2016-05-29T18:08:57.000457Z

with sanity-hints it is tricky, I didn’t want to enable it by default, because it does monkey patching and that could cause some compatibility issues for some people

2016-05-29T18:09:05.000458Z

so it is explicit opt-in

richiardiandrea 2016-05-29T18:09:16.000459Z

I always personally opt-in

richiardiandrea 2016-05-29T18:09:23.000460Z

but I did not know that 😄