# Uncomment something if you want
# USAGE:
#
#   eval      <template>   REQUIRED. %CODE% -> the form as a Clojure string
#                          literal, %NS% -> the namespace. e.g.
#                          (dev/cljs-eval %CODE% (quote %NS%))          ; figwheel
#                          (shadow.cljs.devtools.api/cljs-eval :app %CODE% {}) ; shadow
#                            %CODE%                                       ; plain clj
#   rerender  <form>       optional. evaled (through the same template) after
#                          each request, to repaint — e.g. (p2p.render/render!)
#   upgrade   <form>       optional. evaled ONCE on connect, for backends whose
#                          session must be upgraded first (piggieback etc.)
#   port-file <path/to/.nrepl-port>


# !!!!!!!!!!!!!!!!!!!!!
# IN THESE EXAMPLES HAVE NEWLINES IN THEM BUT THE PARSER IS REALLY DUMB
# AND DOESN'T SUPPORT NEWLINES IN THE KEY PAIRS. ONCE YOU UNCOMMENT IT
# REMOVE ALL NEWLINES
# !!!!!!!!!!!!!!!!!!!!!


# Plain Clojure (JVM)
# eval  %CODE%
# eval  (binding [*ns* (the-ns (quote %NS%))] (eval (read-string %CODE%)))

# figwheel-main (what p2p uses)
# eval      (dev/cljs-eval %CODE% (quote %NS%))
# rerender  (p2p.render/render!)
# Relies on the dev/cljs-eval helper in dev.clj. Default port-file (.nrepl-port) is correct.

# shadow-cljs (what sked-app uses)
# port-file .shadow-cljs/nrepl.port
# eval      (let [{:keys [results out err]} (shadow.cljs.devtools.api/cljs-eval :app %CODE% {:ns (quote %NS%)})] (when (seq out) (print out)) (when (seq err) (print err)) (dose
#  [x results] (println x)) nil)
#  rerender  (do (set! reagent.impl.util/*always-update* true) (swap! sked-app.js.rn/dev-reload inc))
#  Swap :app for your build id. The port-file line is essential — shadow doesn't write .nrepl-port.

# shadow-cljs, browser (reagent)
#  port-file .shadow-cljs/nrepl.port
#  eval      (let [{:keys [results out err]}
#                  (shadow.cljs.devtools.api/cljs-eval :app %CODE% {:ns (quote %NS%)})]
#              (when (seq out) (print out))
#              (when (seq err) (print err))
#              (doseq [x results] (println x))
#              nil)
#  rerender  (reagent.dom/force-update-all)

#  piggieback-upgraded session (generic cljs over nREPL)
#  upgrade  (cider.piggieback/cljs-repl (figwheel.main.api/repl-env "dev"))
#  eval     %CODE%

#  nbb / babashka (SCI-based)
#  port-file .nrepl-port
#  eval      %CODE%

