diff --git a/CHANGES.md b/CHANGES.md index 491ade1..d5d1f27 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,7 +1,8 @@ -## 0.7.0 (2016-01-XXXX) +## 0.7.0 (2016-NN-NN) Improvements: - - works with reagent 0.6.0 (while remaining backwards compatible with previous versions) + - added one tick of extra pause when events have `:flush=dom` metadata. Previously, there were odd times when the pause wasn't enough. + - compatable with reagent 0.6.0 (untested) while remaining backwards compatible with previous versions - [#138](https://github.com/Day8/re-frame/pull/138) Switch to using CircleCI and automated testing with Karma Fixed: diff --git a/examples/simple/project.clj b/examples/simple/project.clj index 06d9fb5..0afed90 100644 --- a/examples/simple/project.clj +++ b/examples/simple/project.clj @@ -1,8 +1,8 @@ (defproject simple-re-frame "0.7.0-alpha" :dependencies [[org.clojure/clojure "1.7.0"] [org.clojure/clojurescript "1.7.170"] - [reagent "0.6.0-alpha"] - [re-frame "0.7.0-alpha"]] + [reagent "0.5.1"] + [re-frame "0.7.0-alpha-3"]] :plugins [[lein-cljsbuild "1.1.1"] [lein-figwheel "0.5.0-2"]] diff --git a/examples/todomvc/project.clj b/examples/todomvc/project.clj index 4f511f4..f442da2 100644 --- a/examples/todomvc/project.clj +++ b/examples/todomvc/project.clj @@ -1,8 +1,8 @@ (defproject todomvc-re-frame "0.7.0-alpha" :dependencies [[org.clojure/clojure "1.7.0"] [org.clojure/clojurescript "1.7.170"] - [reagent "0.6.0-alpha"] - [re-frame "0.7.0-alpha"] + [reagent "0.5.1"] + [re-frame "0.7.0-alpha-3"] [secretary "1.2.3"] [prismatic/schema "1.0.3"]] diff --git a/project.clj b/project.clj index cf0a6d7..bcc7190 100644 --- a/project.clj +++ b/project.clj @@ -1,10 +1,10 @@ -(defproject re-frame "0.7.0-alpha-2" +(defproject re-frame "0.7.0-alpha-3" :description "A Clojurescript MVC-like Framework For Writing SPAs Using Reagent." :url "https://github.com/Day8/re-frame.git" :license {:name "MIT"} :dependencies [[org.clojure/clojure "1.7.0"] [org.clojure/clojurescript "1.7.170"] - [reagent "0.6.0-alpha"]] + [reagent "0.5.1"]] :profiles {:debug {:debug true} :dev {:dependencies [[karma-reporter "0.3.0"]] @@ -22,6 +22,7 @@ :deploy-repositories [["releases" :clojars] ["snapshots" :clojars]] + ;; because of https://github.com/karma-runner/karma/issues/1746 we include our own fork of karma :npm {:dependencies [[karma "https://github.com/danielcompton/karma/archive/v0.13.19.tar.gz"] [karma-cljs-test "0.1.0"] [karma-chrome-launcher "0.2.0"] diff --git a/src/re_frame/router.cljs b/src/re_frame/router.cljs index 8056ff8..d2580c8 100644 --- a/src/re_frame/router.cljs +++ b/src/re_frame/router.cljs @@ -57,13 +57,15 @@ ;; which will run event processing after the next reagent animation frame. ;; +(def run-after-next-annimation-frame + (if (exists? reagent.core/after-render) + (.-after-render reagent.core) ;; reagent >= 0.6.0 + (.-do-later reagent.impl.batching))) ;; reagent < 0.6.0 ;; A map from event metadata keys to the corresponding "run later" functions (def later-fns - {:flush-dom (if (exists? reagent.core/after-render) ;; after next annimation frame - (.-after-render reagent.core) ;; reagent >= 0.6.0 - (.-do-later reagent.impl.batching)) ;; reagent < 0.6.0 - :yield goog.async.nextTick}) ;; almost immediately + {:flush-dom (fn [f] (run-after-next-annimation-frame #(goog.async.nextTick f))) ;; a tick after the next annimation frame + :yield goog.async.nextTick}) ;; almost immediately (defprotocol IEventQueue (enqueue [this event])