From 846712cc12b1a3e1cdafc8d78b6b53a44e284041 Mon Sep 17 00:00:00 2001 From: Artur Girenko Date: Wed, 4 Oct 2017 22:09:51 +0200 Subject: [PATCH] use figwheel.client/start API instead of watch-and-reload --- resources/cljs-om-next/main_dev.cljs | 10 +++++----- resources/cljs-reagent/main_dev.cljs | 14 +++++++------- resources/cljs-reagent6/main_dev.cljs | 18 +++++++++--------- resources/cljs-rum/main_dev.cljs | 12 ++++++------ 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/resources/cljs-om-next/main_dev.cljs b/resources/cljs-om-next/main_dev.cljs index a72016a..c548aa0 100644 --- a/resources/cljs-om-next/main_dev.cljs +++ b/resources/cljs-om-next/main_dev.cljs @@ -2,17 +2,17 @@ (:require [om.next :as om] [$PROJECT_NAME_HYPHENATED$.$PLATFORM$.core :as core] [$PROJECT_NAME_HYPHENATED$.state :as state] - [figwheel.client :as figwheel :include-macros true])) + [figwheel.client :as fw])) (enable-console-print!) (assert (exists? core/init) "Fatal Error - Your core.cljs file doesn't define an 'init' function!!! - Perhaps there was a compilation failure?") (assert (exists? core/app-root) "Fatal Error - Your core.cljs file doesn't define an 'app-root' function!!! - Perhaps there was a compilation failure?") -(figwheel/watch-and-reload - :websocket-url "ws://localhost:3449/figwheel-ws" - :heads-up-display false - :jsload-callback #(om/add-root! state/reconciler core/AppRoot 1)) +(fw/start { + :websocket-url "ws://$DEV_HOST$:3449/figwheel-ws" + :heads-up-display false + :jsload-callback #(om/add-root! state/reconciler core/AppRoot 1)}) (core/init) diff --git a/resources/cljs-reagent/main_dev.cljs b/resources/cljs-reagent/main_dev.cljs index 59b9738..e0afa8a 100644 --- a/resources/cljs-reagent/main_dev.cljs +++ b/resources/cljs-reagent/main_dev.cljs @@ -1,9 +1,9 @@ - (ns ^:figwheel-no-load env.$PLATFORM$.main +(ns ^:figwheel-no-load env.$PLATFORM$.main (:require [reagent.core :as r] [$PROJECT_NAME_HYPHENATED$.$PLATFORM$.core :as core] - [figwheel.client :as figwheel :include-macros true])) + [figwheel.client :as fw])) - (enable-console-print!) +(enable-console-print!) (assert (exists? core/init) "Fatal Error - Your core.cljs file doesn't define an 'init' function!!! - Perhaps there was a compilation failure?") (assert (exists? core/app-root) "Fatal Error - Your core.cljs file doesn't define an 'app-root' function!!! - Perhaps there was a compilation failure?") @@ -14,9 +14,9 @@ ;; Do not delete, root-el is used by the figwheel-bridge.js (def root-el (r/as-element [reloader])) -(figwheel/watch-and-reload - :websocket-url "ws://$DEV_HOST$:3449/figwheel-ws" - :heads-up-display false - :jsload-callback #(swap! cnt inc)) +(fw/start { + :websocket-url "ws://$DEV_HOST$:3449/figwheel-ws" + :heads-up-display false + :jsload-callback #(swap! cnt inc)}) (core/init) diff --git a/resources/cljs-reagent6/main_dev.cljs b/resources/cljs-reagent6/main_dev.cljs index 0161078..571ac77 100644 --- a/resources/cljs-reagent6/main_dev.cljs +++ b/resources/cljs-reagent6/main_dev.cljs @@ -1,10 +1,10 @@ - (ns ^:figwheel-no-load env.$PLATFORM$.main +(ns ^:figwheel-no-load env.$PLATFORM$.main (:require [reagent.core :as r] [re-frame.core :refer [clear-subscription-cache!]] [$PROJECT_NAME_HYPHENATED$.$PLATFORM$.core :as core] - [figwheel.client :as figwheel :include-macros true])) + [figwheel.client :as fw])) - (enable-console-print!) +(enable-console-print!) (assert (exists? core/init) "Fatal Error - Your core.cljs file doesn't define an 'init' function!!! - Perhaps there was a compilation failure?") (assert (exists? core/app-root) "Fatal Error - Your core.cljs file doesn't define an 'app-root' function!!! - Perhaps there was a compilation failure?") @@ -16,12 +16,12 @@ (def root-el (r/as-element [reloader])) (defn force-reload! [] - (clear-subscription-cache!) - (swap! cnt inc)) + (clear-subscription-cache!) + (swap! cnt inc)) -(figwheel/watch-and-reload - :websocket-url "ws://$DEV_HOST$:3449/figwheel-ws" - :heads-up-display false - :jsload-callback force-reload!) +(fw/start { + :websocket-url "ws://$DEV_HOST$:3449/figwheel-ws" + :heads-up-display false + :jsload-callback force-reload!}) (core/init) diff --git a/resources/cljs-rum/main_dev.cljs b/resources/cljs-rum/main_dev.cljs index feb6826..ae84083 100644 --- a/resources/cljs-rum/main_dev.cljs +++ b/resources/cljs-rum/main_dev.cljs @@ -1,6 +1,6 @@ (ns ^:figwheel-no-load env.$PLATFORM$.main (:require [$PROJECT_NAME_HYPHENATED$.$PLATFORM$.core :as core] - [figwheel.client :as figwheel :include-macros true])) + [figwheel.client :as fw])) (assert (exists? core/init) "Fatal Error - Your core.cljs file doesn't define an 'init' function!!! - Perhaps there was a compilation failure?") (assert (exists? core/root-component-factory) "Fatal Error - Your core.cljs file doesn't define an 'root-component-factory' function!!! - Perhaps there was a compilation failure?") @@ -8,11 +8,11 @@ (enable-console-print!) -(figwheel/watch-and-reload - :websocket-url "ws://localhost:3449/figwheel-ws" - :heads-up-display false - ;; TODO make this Rum something - :jsload-callback #(#'core/mount-app)) +(fw/start { + :websocket-url "ws://$DEV_HOST$:3449/figwheel-ws" + :heads-up-display false + ;; TODO make this Rum something + :jsload-callback #(#'core/mount-app)}) (core/init)