Fork me on GitHub
#planck
<
2016-09-09
>
ghufran17:09:45

Hi all! I’m trying to get a planck repl working with cursive, I’d like to be able to send code from a cljs namespace in my project to the repl. I feel like I must be missing something pretty simple I can get the cursive repl to connect to planck, and send basic cljs forms to the repl and have them evaluated in the planck repl. However, when I try to require a library in the cljs namespace (e.g. "(ns guestbook.core (:require [reagent.core :as reagent :refer [atom]]))” , I get a “no such namespace error...”. I am starting planck with the -c option: “planck -c src -n 7777”. My directory structure is src clj <project-name> cljc cljs <project-name> core.cljs If you need more info, I’ll post a gist later, but I’m hoping I’m just missing something obvious 🙂

ghufran17:09:59

I should have mentioned, when I do lein cljsbuild.. , the same cljs source files compile fine, so I think the dependencies are actually in the project

ghufran17:09:30

also, I’m using the instructions here: http://planck-repl.org/ides.html

mfikes19:09:32

@ghufran I’d suggest trying it outside of Cursive first, but that doesn’t seem to be a problem. I’m wondering if Reagent works at all in self-hosted ClojureScript, and if the problem is related to that. What is the specific error you get?

ghufran21:09:24

ok, so I managed to get planck (outside of cursive) working with a source directory using the instructions at http://planck-repl.org/source-dev.html . I can define a function ‘hello’ in a namespace (‘guestbook.core’), then (require ‘guestbook.core) in planck and then call the function. However, if there are (:require ) forms in the namespace declaration in guestbook.core,then I get an error in planck:

ghufran21:09:00

guestbook.core=> (require 'guestbook.core :reload) foo nil guestbook.core=> (hello "foo") "Hello, foo” ;; then added (:require [datascript.core :as ds]) to the guestbook.core namespace declaration. Then when I try it again, I get the following: (require 'guestbook.core) No such namespace: datascript.core, could not locate datascript/core.cljs, datascript/core.cljc, or Closure namespace “datascript.core" (require 'guestbook.core :reload) No such namespace: datascript.core, could not locate datascript/core.cljs, datascript/core.cljc, or Closure namespace "datascript.core" nil cljs.user=>

mfikes21:09:45

Do you have datascript in the classpath?

ghufran21:09:46

I guess I implicitly expected that planck would be able to magically find it as long as it was in the project.clj and I had called lein deps… 🙂

mfikes21:09:51

Planck will indeed honor whatever classpath you pass to it, so it is probably worth taking a peek at that

ghufran21:09:51

Sorry for the super noob questions..is there a way to say “use the classpaths used /defined in this leiningen project”?

mfikes21:09:30

You can

planck -c`lein classpath`

ghufran21:09:03

thanks+++, I will go rtfm.. 🙂

ghufran21:09:10

great docs btw!

mfikes22:09:31

Thanks. Appreciate it!