Fork me on GitHub
#lein-figwheel
<
2017-06-21
>
mfikes13:06:25

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?

bhauman17:06:07

@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.

bhauman17:06:24

So in terms of a solution how about a tooling namespace that you reuse???

mfikes17:06:35

@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.

bhauman17:06:37

(tl/check)

bhauman17:06:53

gotcha 🙂

mfikes17:06:59

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.

bhauman17:06:04

yeah so there is definitely a problem with doing repl driven versus save driven development here

bhauman17:06:39

but you can stop and start figwheel from the repl

bhauman17:06:55

to jump between the two modes

mfikes17:06:21

Yeah… I’m actually working on the “non-UI” part of my app, where I suppose “traditional” REPL experience is fine.

mfikes17:06:32

I didn’t know you can turn Figwheel off. Cool.

bhauman17:06:49

yeah the REPL keeps running

bhauman17:06:09

but the watch auto compile can be turned off

mfikes17:06:21

That’s definitely good enough for what I’m doing.

mfikes17:06:40

(I really just wanted to use Spec but without actually requiring some of those namespaces.)

bhauman17:06:19

I gotcha ... its an interesting hitch though

mfikes17:06:00

The workaround I’ve settled on for now, is to simply fully qualify

(cljs.spec.test.alpha/check `my-fn)