From 531c8e790feae29eb9b407485d828abd355742e9 Mon Sep 17 00:00:00 2001 From: Filipe Silva Date: Sun, 7 Jun 2020 14:38:10 +0100 Subject: [PATCH] feat: update reagent and devcards --- template/package.json | 12 ++++++------ template/shadow-cljs.edn | 8 ++++++-- template/src/app/core.cljs | 4 ++-- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/template/package.json b/template/package.json index 04cdbdd..b521c99 100644 --- a/template/package.json +++ b/template/package.json @@ -18,22 +18,22 @@ }, "devDependencies": { "@testing-library/dom": "^7.7.3", - "@testing-library/react": "^10.0.4", + "@testing-library/react": "^10.0.4", "clj-kondo": "2020.01.13", "highlight.js": "10.0.3", "jsdom": "^16.2.2", "jsdom-global": "^3.0.2", - "marked": "^1.1.0", + "marked": "^1.1.0", "rimraf": "~3.0.2", "serve-handler": "~6.1.2", - "shadow-cljs": "~2.9.10", + "shadow-cljs": "~2.10.4", "taiko": "~1.0.11", "taiko-diagnostics": "~0.4.0", "zprint-clj": "~0.8.0" }, "dependencies": { - "create-react-class": "~15.6.3", - "react": "~16.8.0", - "react-dom": "~16.8.0" + "create-react-class": "15.6.3", + "react": "~16.13.1", + "react-dom": "~16.13.1" } } diff --git a/template/shadow-cljs.edn b/template/shadow-cljs.edn index e2bd215..fa38aa5 100644 --- a/template/shadow-cljs.edn +++ b/template/shadow-cljs.edn @@ -7,6 +7,10 @@ :modules {:main {:init-fn app.cards/main}} :compiler-options {:devcards true} :output-dir "public/js" + ;; Workaround for https://github.com/bhauman/devcards/issues/168 + :js-options {:resolve {"devcards-marked" {:target :npm :require "marked"} + "devcards-syntax-highlighter" {:target :npm :require "highlight.js"} + }} :target :browser} :test {:ns-regexp "app.cards" :output-to "out/test.js" @@ -14,8 +18,8 @@ :e2e {:ns-regexp "e2e.*" :output-to "out/e2e.js" :target :node-test}} - :dependencies [[reagent "0.8.1"] - [devcards "0.2.6"]] + :dependencies [[reagent "0.10.0"] + [devcards "0.2.7"]] :dev-http {3000 "public"} :nrepl {:port 3333} :source-paths ["src"]} \ No newline at end of file diff --git a/template/src/app/core.cljs b/template/src/app/core.cljs index aba1d3c..ecad447 100644 --- a/template/src/app/core.cljs +++ b/template/src/app/core.cljs @@ -1,12 +1,12 @@ (ns app.core "This namespace contains your application and is the entrypoint for 'yarn start'." - (:require [reagent.core :as r] + (:require [reagent.dom :as rd] [app.hello :refer [hello]])) (defn ^:dev/after-load render "Render the toplevel component for this app." [] - (r/render [hello] (.getElementById js/document "app"))) + (rd/render [hello] (.getElementById js/document "app"))) (defn ^:export main "Run application startup logic."