diff --git a/demo/reagentdemo/intro.cljs b/demo/reagentdemo/intro.cljs index d6dd058..8f51335 100644 --- a/demo/reagentdemo/intro.cljs +++ b/demo/reagentdemo/intro.cljs @@ -276,7 +276,7 @@ [:p "Incidentally, this page also uses another React trick: the entire page is pre-rendered using Node, and " - [:code "reagent.core/render-component-to-string"] ". When it is loaded + [:code "reagent.dom.server/render-to-string"] ". When it is loaded into the browser, React automatically attaches event-handlers to the already present DOM tree."]]) @@ -335,8 +335,3 @@ ;; Show heavy examples on load, to make html file smaller (when @show-all [complete-simple-demo]) (when @show-all [todomvc-demo])]))) - - -#_(dotimes [_ 30] - (time - (r/render-to-string [main]))) diff --git a/demo/sitetools/core.cljs b/demo/sitetools/core.cljs index ce4e9ba..7bdfe12 100644 --- a/demo/sitetools/core.cljs +++ b/demo/sitetools/core.cljs @@ -2,6 +2,7 @@ (:require [clojure.string :as string] [goog.events :as evt] [reagent.core :as r] + [reagent.dom.server :as server] [reagent.debug :refer-macros [dbg log dev?]] [reagent.interop :as i :refer-macros [$ $!]]) (:import goog.History @@ -115,7 +116,7 @@ (defn html-template [{:keys [title body-html timestamp page-conf js-file css-file main-div]}] (let [main (str js-file timestamp)] - (r/render-to-static-markup + (server/render-to-static-markup [:html [:head [:meta {:charset 'utf-8}] @@ -134,7 +135,7 @@ (emit [:set-page page-path]) (let [conf (merge conf @config) b (:body conf) - bhtml (r/render-component-to-string b)] + bhtml (server/render-to-string b)] (str "\n" (html-template (assoc conf :page-conf {:page-path page-path} diff --git a/test/reagenttest/testreagent.cljs b/test/reagenttest/testreagent.cljs index fbc23ca..6e1dab0 100644 --- a/test/reagenttest/testreagent.cljs +++ b/test/reagenttest/testreagent.cljs @@ -4,6 +4,7 @@ [reagent.debug :as debug :refer-macros [dbg println log dev?]] [reagent.interop :refer-macros [$ $!]] [reagent.core :as r] + [reagent.dom.server :as server] [reagent.impl.util :as util])) (def tests-done (atom {})) @@ -269,7 +270,7 @@ (is (= 2 @ran))))) (defn as-string [comp] - (r/render-component-to-string comp)) + (server/render-to-string comp)) (deftest to-string-test [] (let [comp (fn [props] @@ -361,13 +362,13 @@ (deftest test-static-markup (is (= "
foobar
"}} ])))) @@ -432,7 +433,7 @@ (is (= 4 @ran))))))) (defn rstr [react-elem] - (r/render-to-static-markup react-elem)) + (server/render-to-static-markup react-elem)) (deftest test-create-element (let [ae r/as-element