Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Global-exports to require React and support node modules #127

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions project.clj
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
(defproject devcards "0.2.4-SNAPSHOT"
(defproject devcards "0.3.0-SNAPSHOT"
:description "Devcards is a ClojureScript library that provides a lab space in which you can develop your UI components independently and interactively."
:url "http://github.com/bhauman/devcards"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}

:dependencies [[org.clojure/clojure "1.8.0"]
[org.clojure/clojurescript "1.9.229"]
[org.clojure/core.async "0.3.442" :exclusions [org.clojure/tools.reader]]
[cljsjs/react "15.3.1-0"]
[cljsjs/react-dom "15.3.1-0"]
[sablono "0.7.4"]
[org.clojure/clojurescript "1.9.908"]
[org.clojure/core.async "0.3.443" :exclusions [org.clojure/tools.reader]]
[cljsjs/react "15.6.1-1"]
[cljsjs/react-dom "15.6.1-1"]
[sablono "0.8.0-SNAPSHOT"]
[cljs-react-reload "0.1.1"]
[cljsjs/showdown "0.4.0-1"]]

Expand Down Expand Up @@ -59,8 +59,8 @@
:repl-options {:init (set! *print-length* 50)}}
:dev {
:dependencies [;[org.omcljs/om "0.9.0"]
[org.omcljs/om "1.0.0-alpha46"]
[reagent "0.6.0"]
[org.omcljs/om "1.1.0-SNAPSHOT"]
[reagent "0.8.0-alpha1"]
[figwheel-sidecar "0.5.8"]
[com.cemerick/piggieback "0.2.1"]
[org.clojure/tools.nrepl "0.2.12"]]
Expand Down
18 changes: 9 additions & 9 deletions src/devcards/system.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
[goog.history.EventType :as EventType]
[goog.labs.userAgent.device :as device]
[devcards.util.utils :as utils :refer-macros [define-react-class]]
[cljsjs.react]
[cljsjs.react.dom])
[react :as react]
[react-dom :as react-dom])
(:require-macros
[cljs.core.async.macros :refer [go go-loop]]
[devcards.system :refer [inline-resouce-file]])
Expand Down Expand Up @@ -326,8 +326,8 @@

(defn renderer [state-atom]
#_(prn "Rendering")
(js/ReactDOM.render
(js/React.createElement DevcardsRoot)
(react-dom/render
(react/createElement DevcardsRoot)
#_(sab/html [:div
(main-template state-atom)
#_(edn-rend/html-edn @state-atom)])
Expand Down Expand Up @@ -417,8 +417,8 @@
(defn start-ui-with-renderer [channel renderer]
(defonce devcards-ui-setup
(do
(when (exists? js/React.initializeTouchEvents)
(js/React.initializeTouchEvents true))
(when (exists? react/initializeTouchEvents)
(react/initializeTouchEvents true))
(go
(<! (load-data-from-channel! channel))

Expand All @@ -440,8 +440,8 @@
(defn start-ui [channel]
(defonce devcards-ui-setup
(do
(when (exists? js/React.initializeTouchEvents)
(js/React.initializeTouchEvents true))
(when (exists? react/initializeTouchEvents)
(react/initializeTouchEvents true))
(render-base-if-necessary!)
(go
;; initial load
Expand Down Expand Up @@ -501,7 +501,7 @@
</svg>")

(defn cljs-logo []
(.span (.-DOM js/React)
(react/DOM.span
(clj->js { :key "cljs-logo"
:dangerouslySetInnerHTML
{ :__html
Expand Down