lein-figwheel

mfikes 2017-06-21T13:03:25.102591Z

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?

bhauman 2017-06-21T17:25:07.239704Z

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

bhauman 2017-06-21T17:26:24.267255Z

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

mfikes 2017-06-21T17:26:35.271684Z

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

bhauman 2017-06-21T17:26:37.272695Z

(tl/check)

bhauman 2017-06-21T17:26:53.278207Z

gotcha 🙂

mfikes 2017-06-21T17:27:59.302485Z

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.

bhauman 2017-06-21T17:28:04.304525Z

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

bhauman 2017-06-21T17:28:39.318110Z

but you can stop and start figwheel from the repl

bhauman 2017-06-21T17:28:55.323842Z

to jump between the two modes

mfikes 2017-06-21T17:29:21.332951Z

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

mfikes 2017-06-21T17:29:32.337812Z

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

bhauman 2017-06-21T17:29:49.344079Z

yeah the REPL keeps running

bhauman 2017-06-21T17:30:09.351818Z

but the watch auto compile can be turned off

mfikes 2017-06-21T17:30:21.356774Z

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

mfikes 2017-06-21T17:30:40.364179Z

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

bhauman 2017-06-21T17:31:19.378865Z

I gotcha ... its an interesting hitch though

mfikes 2017-06-21T17:41:00.592612Z

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

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