From 8d622b120bc19549a3c1fbe7159c48c22458765e Mon Sep 17 00:00:00 2001 From: Dan Holmsand Date: Thu, 9 Jun 2016 15:51:04 +0200 Subject: [PATCH] Add news about 0.6.0-rc --- demo/reagentdemo/news.cljs | 2 + demo/reagentdemo/news/news060release.cljs | 70 +++++++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 demo/reagentdemo/news/news060release.cljs diff --git a/demo/reagentdemo/news.cljs b/demo/reagentdemo/news.cljs index 2e5f22f..84f3567 100644 --- a/demo/reagentdemo/news.cljs +++ b/demo/reagentdemo/news.cljs @@ -6,10 +6,12 @@ [reagentdemo.news.news050 :as news050] [reagentdemo.news.news051 :as news051] [reagentdemo.news.news060 :as news060] + [reagentdemo.news.news060release :as news060r] [sitetools.core :as tools])) (defn main [] [:div + [news060r/main {:summary true}] [news060/main {:summary true}] [news051/main {:summary true}] [news050/main {:summary true}] diff --git a/demo/reagentdemo/news/news060release.cljs b/demo/reagentdemo/news/news060release.cljs new file mode 100644 index 0000000..2b2b0c0 --- /dev/null +++ b/demo/reagentdemo/news/news060release.cljs @@ -0,0 +1,70 @@ +(ns reagentdemo.news.news060release + (:require [reagent.core :as r] + [reagent.debug :refer-macros [dbg println]] + [reagentdemo.syntax :as s] + [sitetools.core :as tools :refer [link]] + [reagentdemo.news.news060 :as news060] + [reagentdemo.common :as common :refer [demo-component]])) + +(def url "/news/news060.html") +(def title "Reagent 0.6.0-rc") + +(def ns-src (s/syntaxed "(ns example.core + (:require [reagent.core :as r]))")) + +(defn mixed [] + [:div + "Symbols are " 'ok " as well as " :keywords "."]) + +(def some-atom (r/atom 0)) + +(defn confusion-avoided [] + [:div "This is some atom: " some-atom]) + + +(defn main [{:keys [summary]}] + [:div.reagent-demo + [:h1 [link {:href url} title]] + [:div.demo-text + [:p "Reagent 0.6.0-rc has been given a lot of testing, a new + version of React (15.1.0), bug fixing and some small general + improvements since 0.6.0-alpha. It has one new feature: general + ClojureScript objects can now be used anywhere in markup + content."] + + (if summary + [link {:href url :class 'news-read-more} "Read more"] + [:div.demo-text + [:section.demo-text + [:p "See " [link {:href news060/url} "this + article"] " for more information about Reagent 0.6.0."] + + [:h2 "Generalized markup"] + + [:p "Symbols and keywords can now be used in markup content + like this: "] + + [demo-component {:comp mixed + :src (s/src-of [:mixed])}] + + [:p "This makes content conversions behave the same as in + attributes, where symbols and keywords have been supported + before. "] + + [:p "But mainly it avoids confusing error messages when you + happen to drop an arbitrary ClojureScript object into the + markup, like this: "] + + [demo-component {:comp confusion-avoided + :src (s/src-of [:some-atom + :confusion-avoided])}] + + [:p "This may not be particularly useful, but it is at least a + lot better than getting a quite confusing error message from + React, that no longer accepts unknown objects…"] + + [:p "Any object hat satisfies IPrintWithWriter is allowed, and + is converted to a string using " [:code "pr-str" "."]]]])]]) + + +(tools/register-page url [#'main] title)