diff --git a/demo/reagentdemo/core.cljs b/demo/reagentdemo/core.cljs index fbf57af..d846f7f 100644 --- a/demo/reagentdemo/core.cljs +++ b/demo/reagentdemo/core.cljs @@ -1,4 +1,4 @@ -(ns ^:figwheel-always reagentdemo.core +(ns reagentdemo.core (:require [reagent.core :as reagent :refer [atom]] [reagent.interop :as i :refer-macros [.' .!]] [clojure.string :as string] @@ -39,6 +39,9 @@ [tools/page-content] [github-badge]]) -(tools/start! {:body [#'demo] - :css-infiles ["site/public/css/examples.css" - "site/public/css/main.css"]}) +(defn init! [] + (tools/start! {:body [#'demo] + :css-infiles ["site/public/css/examples.css" + "site/public/css/main.css"]})) + +(init!) diff --git a/env/dev/reagentdemo/dev.cljs b/env/dev/reagentdemo/dev.cljs index fe61a3f..d2e84fe 100644 --- a/env/dev/reagentdemo/dev.cljs +++ b/env/dev/reagentdemo/dev.cljs @@ -1,9 +1,14 @@ (ns reagentdemo.dev - (:require [reagentdemo.core] - [reagenttest.runtests] + (:require [reagentdemo.core :as demo] + [reagenttest.runtests :as tests] [reagent.core :as r] [figwheel.client :as fw])) +(defn reload [] + (demo/init!) + (tests/init!)) + (when r/is-client (fw/start - {:websocket-url "ws://localhost:3449/figwheel-ws"})) + {:on-jsload reload + :websocket-url "ws://localhost:3449/figwheel-ws"})) diff --git a/project.clj b/project.clj index f2ba928..d0e74d4 100644 --- a/project.clj +++ b/project.clj @@ -4,10 +4,10 @@ :description "A simple ClojureScript interface to React" :dependencies [[org.clojure/clojure "1.6.0"] - [org.clojure/clojurescript "0.0-2816"] + [org.clojure/clojurescript "0.0-3126"] [cljsjs/react "0.12.2-5"]] - :plugins [[lein-cljsbuild "1.0.4"]] + :plugins [[lein-cljsbuild "1.0.5"]] :source-paths ["src"] @@ -15,8 +15,8 @@ {:builds {:client {:source-paths ["test"]}}}} :dev [:test - {:dependencies [[figwheel "0.2.3-SNAPSHOT"]] - :plugins [[lein-figwheel "0.2.3-SNAPSHOT"]] + {:dependencies [[figwheel "0.2.5"]] + :plugins [[lein-figwheel "0.2.5"]] :source-paths ["demo"] ;; for lighttable :resource-paths ["site" "outsite"] :figwheel {:css-dirs ["site/public/css"]} @@ -69,4 +69,5 @@ :compiler {:output-to "outsite/public/js/main.js"}}}} :figwheel {:http-server-root "public" ;; assumes "resources" - :repl false}) + ;; broken in figwheel 0.2.5: :repl false + }) diff --git a/test/reagenttest/runtests.cljs b/test/reagenttest/runtests.cljs index 68d2553..1241918 100644 --- a/test/reagenttest/runtests.cljs +++ b/test/reagenttest/runtests.cljs @@ -1,4 +1,4 @@ -(ns ^:figwheel-always reagenttest.runtests +(ns reagenttest.runtests (:require [reagenttest.testreagent] [reagenttest.testcursor] [reagenttest.testinterop] @@ -44,7 +44,10 @@ (js/setTimeout all-tests 100) (all-tests))) -(when (some? (test/deftest empty-test)) - ;; Only run with :load-tests true - (reset! demo/test-results [#'test-output-mini]) - (run-tests)) +(defn init! [] + (when (some? (test/deftest empty-test)) + ;; Only run with :load-tests true + (reset! demo/test-results [#'test-output-mini]) + (run-tests))) + +(init!)