Clojurians
#dirac
<
2017-03-21
>

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

superstructor20:03:43

Is it possible with Dirac REPL to configure or hook in via code some forms to eval every time the REPL starts; e.g. I always want certain requires/:refers/:as etc and it would be massive time saver to have it all done automatically @darwin :question:

darwin20:03:32

you should probably have a test for bootstrapped? and call this only after REPL is successfully initialized

superstructor20:03:44

nice, thanks! Looks like it should be possible with that :slightly_smiling_face: @darwin

darwin20:03:29

assuming this is only for dev build, you can have js/setInterval in your app watching bootstrapped? and then call it as soon as you detect that REPL is avail

superstructor20:03:55

yep, only for dev builds :thumbsup: awesome!

darwin20:03:56

wait bootstrapped> is not the thing I thought

darwin20:03:01

@superstructor wait a bit, I will look into the nREPL config if this is possible in a better waty

superstructor20:03:57

:thumbsup: @darwin

darwin20:03:37

this code gets called exactly as cljs REPL init step (bootstrapping) - but that means different bootstrapping than that function in runtime api

superstructor20:03:11

sounds sensible, so just write my own extension of standard-repl-init-code right ?

darwin20:03:57

and replace :reveal-url-script-path with :repl-init-code

darwin20:03:18

nrepl-config can be configured per cljs build

darwin20:03:57

as shown there (preferred) or you can simply define an environmental variable if it is more convenient a you just want one global config for all your builds

darwin21:03:04

that env variable would be something like env DIRAC_NREPL__REPL_INIT_CODE=“(something …)” boot build-my-project I guess

superstructor21:03:05

thats awesome, thanks again @darwin :slightly_smiling_face: your a legend!