Fork me on GitHub
#conjure
<
2020-04-18
>
nate03:04:19

totally agree!

thheller08:04:02

@olical I fixed the ns resulting in multiple results issue in 2.8.97. you mentioned something else related to in-ns?

Olical08:04:18

Oh in-ns wasn't working unless it was top level which did work on other repls but that's a non issue. Thank you so much for the quick fix. I'll have a play about and make sure everything is in order now.

Olical08:04:23

Well, after breakfast

thheller08:04:09

how did you use in-ns? that should really only work at the top-level in other CLJS REPLs too?

Olical08:04:33

I had it inside a do for a while, maybe it didn't work at all.

thheller08:04:44

clj -m cljs.main -r
ClojureScript 1.10.520
cljs.user=> (do (in-ns 'cljs.core) ::foo)
WARNING: Use of undeclared Var cljs.user/in-ns at line 1 <cljs repl>
Execution error (Error) at (<cljs repl>:1).
Cannot read property 'call' of undefined                                                                                                                          

thheller08:04:04

in-ns is a REPL special form so it should only work at the top level for CLJS

Olical09:04:51

Wondering if I should use ns or in-ns since I think in-ns to something that hasn't been defined yet causes weird issues :thinking_face:

Olical09:04:07

The annoying thing with them both is that swapping namespaces messes with *1 *2 *3

thheller09:04:35

well in the case of shadow-cljs you can just send :ns as part of the nrepl message to ensure the namespace things get eval'd in

thheller09:04:48

but other CLJS repls do not support that

Olical09:04:57

I was about to ask, amazed

Olical09:04:00

I reaaaaly want that

Olical09:04:05

It seems kind of essential for tooling.

thheller09:04:44

yeah, lots of essential things are missing for CLJS REPLs

Olical09:04:56

Well, CLJ too

Olical09:04:05

Don't think :ns is a thing in normal nREPL

thheller09:04:28

I think CLJ supports it?

thheller09:04:06

definitely has a ns msg key

Olical09:04:02

Not in the docs 😭

Olical09:04:10

It returns an :ns key.

Olical10:04:39

Ah so :ns does work on eval, just undocumented. Buuuut it won't let you set it to a namespace that isn't defined yet, so you'd have to do a little dance of "oh it didn't work, eval (ns ...) then try again"

Olical10:04:01

(in a clj nrepl)

Olical15:04:10

Evaluating namespaces works great now! Thank you!

Olical10:04:16

I can go to the definition of ClojureScript's defn now 😍

Olical10:04:45

Also because Conjure reconnects to ongoing sessions by default, if I lose connection to a CLJS REPL and reconnect it will still be CLJS, I won't have to jack in again.

Olical11:04:04

(this includes restarting nvim)

Olical11:04:03

Rewriting the testing tools to lean on CIDER now too.

Olical11:04:08

(if it works in cljs land)

Olical12:04:54

How detailed would you like your test output :thinking_face: would you like to know each namespace and var that passed / failed on individual lines? Or just failures.

Olical12:04:13

Maybe I'll keep it quiet if everything passed and just show counts.

Olical15:04:43

Implemented testing through CIDER today but didn't test it with CLJS until I was done, oops. It doesn't work which is understandable, CLJS testing is very different. Might just roll back a day though 😅

Olical15:04:59

The original code was suuuuper simple and just relied on Clojure's stdout of test results.

Olical15:04:58

Git reverted. If CIDER adds cljs support to the testing operations I'll just dig that commit back out.

Olical16:04:53

I don't want to end the day without adding a feature so I'm adding fully configurable namespace refreshing.

Olical16:04:11

Done. Damn Aniseed and the framework I've built make this pretty simple 😄 <localleader>rr refreshes changed, ra refreshes all, rc clears the cache. All mappings configurable and optional config options available to provide a before, after and dirs option.

Olical16:04:34

Errors should all be shown to you although I'd love to know if there's any oddities with some projects.

Olical16:04:54

You could use a local vimrc file or something to run ConjureConfig clojure.nrepl/refresh.after "dev.sandbox/after-refresh" when you enter your project. Hook that up to your system restart function and away you go.