Fork me on GitHub
#cursive
<
2017-05-16
>
stijn07:05:06

@carocad Not sure if this is ok for your use case: use piggieback to upgrade a jvm repl to a clojurescript one

stijn07:05:17

e.g. in dev/user.clj

stijn07:05:20

(ns user
  (:require [cljs.repl :as repl]
            [cemerick.piggieback]
            [cljs.repl.node]))

(defn start-cljs
  []
  (cemerick.piggieback/cljs-repl (cljs.repl.node/repl-env)))

stijn07:05:39

and after starting the jvm repl, (start-cljs)

stijn07:05:37

and you need something like

stijn07:05:40

:profiles {:dev {:dependencies [[com.cemerick/piggieback "0.2.0"]
                                  [org.clojure/tools.nrepl "0.2.10"]]
                   :source-paths ["dev"]
                   :main         user
                   :repl-options {:nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]}}}

stijn07:05:44

in your project.clj

carocad08:05:40

@stijn thanks for the info. At the end I went with a simple clojure.main configuration in cursive which executes the following script:

(require 'cljs.repl)
(require 'cljs.build.api)
(require 'cljs.repl.node)

(cljs.build.api/build "src"
                      {:output-to "index.android.js"
                       :optimizations :simple})

(cljs.repl/repl (cljs.repl.node/repl-env)
                :watch "src"
                :output-to     "index.android.js"
                :output-dir    "target/android")
                ;:main "env.android.main")

sandbags13:05:16

@cfleming question: when you type ";" accidentally instead of "l" is it expected that when you Cmd+Z to undo instead of simplying undoing the insert comment it undoes the whole previous editing sequence?

nwjsmith14:05:40

Is there a way to cycle from string -> keyword -> symbol?

nwjsmith14:05:51

analogous to the "Cycle Data Structure" action?

nwjsmith14:05:32

I'm doing some testing around marshalling maps to and from JSON and it would be a big time saver

zylox15:05:43

huh, hadn't seen that cycle data structure command before

zylox15:05:50

thats pretty neat