From 66ff6ccb826a4621b5566f3f94e302a98e9c3c3b Mon Sep 17 00:00:00 2001 From: Juho Teperi Date: Sun, 19 Apr 2020 14:51:12 +0300 Subject: [PATCH] Fix #438, fix raf call in Firefox extenstion context RAF call needs to have Window object bound as `this`. --- CHANGELOG.md | 14 ++++++++++---- src/reagent/impl/batching.cljs | 17 +++++++++-------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d7095dc..8a13a25 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,16 +2,22 @@ ## Unreleased -- Fixed merge-props adding `:class` property to result even if no argument -defined `:class` ([#479](https://github.com/reagent-project/reagent/pull/479)) -- Fix using `:className` property together with keyword class shortcut ([#433](https://github.com/reagent-project/reagent/issues/433)) -- Fix incorrect missing React key warnings with `:>` ([#399](https://github.com/reagent-project/reagent/issues/399)) +### Features and changes + - Change RAtom (all types) print format to be readable using ClojureScript reader, similar to normal Atom ([#439](https://github.com/reagent-project/reagent/issues/439)) - Old print output: `#` - New print output: `#object[clojure.ratom.RAtom {:val 0}]` - Still not readable by default, requires custom reader for `object` tag. +### Bugfixes + +- Fixed merge-props adding `:class` property to result even if no argument +defined `:class` ([#479](https://github.com/reagent-project/reagent/pull/479)) +- Fix using `:className` property together with keyword class shortcut ([#433](https://github.com/reagent-project/reagent/issues/433)) +- Fix incorrect missing React key warnings with `:>` ([#399](https://github.com/reagent-project/reagent/issues/399)) +- Fix `requestAnimationFrame` call in Firefox extension context ([#438](https://github.com/reagent-project/reagent/issues/438)) + ## 0.10.0 (2020-03-06) Main feature of this release is to deprecate functions that are going to be diff --git a/src/reagent/impl/batching.cljs b/src/reagent/impl/batching.cljs index 03b4d46..9afc89e 100644 --- a/src/reagent/impl/batching.cljs +++ b/src/reagent/impl/batching.cljs @@ -14,14 +14,15 @@ (js/setTimeout f 16)) (def next-tick - (if-not is-client - fake-raf - (let [w js/window] - (or (.-requestAnimationFrame w) - (.-webkitRequestAnimationFrame w) - (.-mozRequestAnimationFrame w) - (.-msRequestAnimationFrame w) - fake-raf)))) + (.bind (if-not is-client + fake-raf + (let [w js/window] + (or (.-requestAnimationFrame w) + (.-webkitRequestAnimationFrame w) + (.-mozRequestAnimationFrame w) + (.-msRequestAnimationFrame w) + fake-raf))) + js/window)) (defn compare-mount-order [^clj c1 ^clj c2]