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 ❓
@superstructor try to look into this: https://github.com/binaryage/dirac/blob/master/src/runtime/dirac/runtime/repl.cljs#L266
you should probably have a test for bootstrapped?
and call this only after REPL is successfully initialized
nice, thanks! Looks like it should be possible with that 🙂 @darwin
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
yep, only for dev builds :thumbsup: awesome!
wait bootstrapped> is not the thing I thought
@superstructor wait a bit, I will look into the nREPL config if this is possible in a better waty
:thumbsup: @darwin
what about tweaking this config option? https://github.com/binaryage/dirac/blob/master/src/nrepl/dirac/nrepl/config.clj#L20 https://github.com/binaryage/dirac/blob/master/src/nrepl/dirac/nrepl/config_helpers.clj#L8-L12
this code gets called exactly as cljs REPL init step (bootstrapping) - but that means different bootstrapping than that function in runtime api
sounds sensible, so just write my own extension of standard-repl-init-code
right ?
follow this FAQ entry: https://github.com/binaryage/dirac/blob/master/docs/faq.md#how-do-i-reveal-source-files-via-nrepl
and replace :reveal-url-script-path
with :repl-init-code
nrepl-config can be configured per cljs build
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
that env variable would be something like env DIRAC_NREPL__REPL_INIT_CODE=“(something …)” boot build-my-project
I guess
thats awesome, thanks again @darwin 🙂 your a legend!