Fork me on GitHub
#clojurescript
<
2017-04-25
>
melindazheng08:04:04

Any Clojurian from Singapore, please do join #clojure-sg channel:grinning:

dnolen13:04:58

@oahner that’s ok then just file a JIRA ticket then so we don’t lose track of it

alexwheeler16:04:02

anyone familiar with vim-fireplace, I have nrepl running with lein repl, I can execute commands from within vim w/ cpr. When I go to that repl and use piggieback I try to require namespaces in my project but I can't

alexwheeler16:04:28

I'm using cljs.repl.node as my repl-env

alexwheeler16:04:19

maybe I'm missing something on requiring clojurescript namespaces in a repl

dominicm16:04:43

@alexwheeler are you using :Require (`(require 'myns :reload)`) or :Eval (require 'myns)?

alexwheeler16:04:05

I'm using the first in that example. So with vim-fireplace, cpr will call (load-file whatever-current-file-is). If I manually type (load-file whatever-current-file-is) into my repl then I can succesfully require the namespace

alexwheeler16:04:00

it seems that maybe vim-fireplace isn't connecting to piggieback correctly when I start it, because when I try to connect to it from vim with :Connect I get an error

dominicm16:04:11

I didn't know it could do that. Cool.

dominicm16:04:17

load-file doesn't seem likely to work in a piggieback.

dominicm16:04:52

Try doing :Eval (require 'blah)

oahner16:04:06

@alexwheeler how are you starting the cljs repl?

alexwheeler16:04:15

(cemerick.piggieback/cljs-repl (cljs.repl.node/repl-env))

alexwheeler16:04:21

from within lein repl

alexwheeler16:04:44

so it seems that vim-fireplace isn't communicating correctly with my cljs repl. I can use the repl fine without vim

oahner16:04:45

ahh, so you're not calling :Piggieback from vim

dominicm16:04:56

This is the problem I think

oahner16:04:42

try :Piggieback (cljs.repl.node/repl-env) in vim

oahner16:04:54

has to be done in a .clj file

oahner16:04:12

and then move to a cljs file that sits under your project and try to eval something

alexwheeler16:04:23

you guys have solved my problem!

alexwheeler16:04:17

that totally makes sense thank you so much. I was trying to :Connect to the port piggieback was running but seeing an error

oahner16:04:27

yeah, the readme doesn't quite tell the whole story, :help fireplace is a bit clearer on that point

dominicm16:04:45

:help is love, :help is life. 😁

oahner16:04:33

@alexwheeler there's a vim-fireplace channel btw, for all things vim/closure

alexwheeler16:04:20

ah okay great to know, thanks for the help

luxbock17:04:28

I have a large EDN value that I would like to define to a var, but it's so large that it's making my editor slow down if I include it inline. can I save it to a file and load it to a var via a macro?

luxbock17:04:42

I feel like I knew how to do this a long time ago but none of the most obvious attempts I tried worked

jr17:04:34

yeah you can define a macro that reads the edn value at compile time

jr17:04:00

(defmacro defvar [var-name edn-file] `(def ~var-name ~(clojure.edn/read-string (slurp edn-file))))

luxbock17:04:35

thanks, I'll give it a go

mikepence17:04:50

looking for opinions about what tool to use for browser-based tests

mikepence17:04:03

I have historically used selenium via ruby

curlyfry19:04:47

@mikepence https://github.com/bensu/doo is nice for cljs.test. Haven't used it myself, but https://github.com/xeqi/kerodon seems cool for interaction-style tests.

jimmy22:04:57

@mikepence try lein doo with karma-cljs.