If I’m in a namespace and I set up an alias for dev purposes, like
(require '[cljs.spec.test.alpha :as st])
so that I can do
(st/check `my-fn)
if I change and save my file, it blows away the st
alias. I’ve added ^:figwheel-no-load
to my ns
form, which does indeed cause it to not automatically load changes to my code, but it still removes the alias.
Has anyone solved this one, short of putting the dev-time namespace and alias directly in my ns
form?@mfikes that's interesting, I'm not familiar with the mechanism behind require aliasing, I thought it was just a compiler state thing. Ahhhhh ... the file gets compiled ... so it changes the compiler state and thus the alias is gone.
So in terms of a solution how about a tooling namespace that you reuse???
@bhauman When you do a require
in a REPL, and it has an alias, it essentially adds that alias to whatever aliases you might already have.
(tl/check)
gotcha 🙂
It is no big deal to come up with a clean solution to this use case. Perhaps it might become more commonly used with Spec adoption.
yeah so there is definitely a problem with doing repl driven versus save driven development here
but you can stop and start figwheel from the repl
to jump between the two modes
Yeah… I’m actually working on the “non-UI” part of my app, where I suppose “traditional” REPL experience is fine.
I didn’t know you can turn Figwheel off. Cool.
yeah the REPL keeps running
but the watch auto compile can be turned off
That’s definitely good enough for what I’m doing.
(I really just wanted to use Spec but without actually requiring some of those namespaces.)
I gotcha ... its an interesting hitch though
The workaround I’ve settled on for now, is to simply fully qualify
(cljs.spec.test.alpha/check `my-fn)