From 106e5d86ca1e3258ba9146064541d207aea85796 Mon Sep 17 00:00:00 2001 From: Juho Teperi Date: Tue, 17 Dec 2019 15:40:51 +0200 Subject: [PATCH] Deprecate component-path in core ns --- src/reagent/core.cljs | 11 ++++++----- test/reagenttest/testreagent.cljs | 9 +++++---- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/reagent/core.cljs b/src/reagent/core.cljs index ed8503e..e898c13 100644 --- a/src/reagent/core.cljs +++ b/src/reagent/core.cljs @@ -83,8 +83,8 @@ (dom/unmount-component-at-node container)) ;; For backward compatibility -(def ^{:deprecated true} as-component as-element) -(def ^{:deprecated true} render-component render) +(def ^{:deprecated "0.10.0"} as-component as-element) +(def ^{:deprecated "0.10.0"} render-component render) (defn force-update-all "Force re-rendering of all mounted Reagent components. This is @@ -390,8 +390,9 @@ (util/make-partial-fn f args)) (defn component-path - ;; Try to return the path of component c as a string. - ;; Maybe useful for debugging and error reporting, but may break - ;; with future versions of React (and return nil). + "Try to return the path of component c as a string. + Maybe useful for debugging and error reporting, but may break + with future versions of React (and return nil)." + {:deprecated "0.10.0"} [c] (comp/component-path c)) diff --git a/test/reagenttest/testreagent.cljs b/test/reagenttest/testreagent.cljs index cac2767..1cd1493 100644 --- a/test/reagenttest/testreagent.cljs +++ b/test/reagenttest/testreagent.cljs @@ -5,6 +5,7 @@ [reagent.debug :as debug :refer-macros [dev?]] [reagent.core :as r] [reagent.dom.server :as server] + [reagent.impl.component :as comp] [reagenttest.utils :as u :refer [with-mounted-component]] [clojure.string :as string] [goog.string :as gstr] @@ -660,10 +661,10 @@ (deftest test-component-path (let [a (atom nil) tc (r/create-class {:display-name "atestcomponent" - :render (fn [] - (let [c (r/current-component)] - (reset! a (r/component-path c)) - [:div]))})] + :render (fn [] + (let [c (r/current-component)] + (reset! a (comp/component-path c)) + [:div]))})] (with-mounted-component [tc] (fn [c] (is (seq @a))