Skip to content

Needs clojure ^1.9 for shadow-cljs 2.8.37  #5

@njordhov

Description

@njordhov

Shadow-cljs 2.8.37 uses functionality introduced in Clojure 1.9. However, without a project.clj file present, proto-repl will use its default which has clojure 1.8 as dependency.

A work-around is to add a project.clj to shadow-reagent:

(defproject shadow-reagent-proto-repl "0.1.0-SNAPSHOT"
  :description "A leiningen project to use proto repl with shadow-cljs."
  :dependencies [[org.clojure/clojure "1.10.0"]
                 [thheller/shadow-cljs "2.8.37"]
                 [reagent "0.8.1"]
                 [proto-repl-charts "0.3.1"]
                 [proto-repl "0.3.1"]]
  :repl-options {:nrepl-middleware
                 [shadow.cljs.devtools.server.nrepl/cljs-load-file
                  shadow.cljs.devtools.server.nrepl/cljs-eval
                  shadow.cljs.devtools.server.nrepl/cljs-select]}
  :profiles
  {:dev {:source-paths ["src"]}})

Stop eventual shadow workers already running in the shell.
In proto-repl evaluate:

(require '[shadow.cljs.devtools.server :as server])
(require '[shadow.cljs.devtools.api :as shadow])
(server/start!)
(shadow/watch :app)
(shadow/nrepl-select :app)

This should give you a new prompt in proto-repl.
Load the app/page in the web browser, then evaluate:
cljs.user=> (js/alert "Hello")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions