Breaking change: Require react.js to be included separately

This makes the project.clj a little messier, but makes it a lot
easier to use a different version or a custom build of React.
This commit is contained in:
Dan Holmsand 2014-01-10 11:10:09 +01:00
parent 3a943b0ad2
commit 7bbe917285
8 changed files with 14512 additions and 36 deletions

View File

@ -9,7 +9,7 @@ PROF = dev,test
CLJSBUILD = client CLJSBUILD = client
CLJSDIRS = src test CLJSDIRS = src test
VERSION = 0.0.4-SNAPSHOT VERSION = 0.1.0-SNAPSHOT
all: buildrun all: buildrun
@ -44,10 +44,13 @@ veryclean: clean
bower_components: bower_components:
bower install react#v0.8.0 bower install react#v0.8.0
src/cloact/impl/react.min.js: bower_components/react/react-with-addons.min.js Makefile src/cloact/react.min.js: bower_components/react/react.min.js Makefile
cp $< $@ cp $< $@
copyjs: bower_components src/cloact/impl/react.min.js src/cloact/react.js: bower_components/react/react.js Makefile
cp $< $@
copyjs: bower_components src/cloact/react.min.js src/cloact/react.js
gensite: gensite:
node bin/gen-site.js node bin/gen-site.js

View File

@ -1,15 +1,16 @@
(defproject simple-cloact "0.0.3" (defproject simple-cloact "0.1.0-SNAPSHOT"
:dependencies [[org.clojure/clojure "1.5.1"] :dependencies [[org.clojure/clojure "1.5.1"]
[org.clojure/clojurescript "0.0-2120"] [org.clojure/clojurescript "0.0-2138"]
[cloact "0.0.3"]] [cloact "0.1.0-SNAPSHOT"]]
:plugins [[lein-cljsbuild "1.0.1"]] :plugins [[lein-cljsbuild "1.0.1"]]
:hooks [leiningen.cljsbuild] :hooks [leiningen.cljsbuild]
:profiles {:prod {:cljsbuild :profiles {:prod {:cljsbuild
{:builds {:builds
{:client {:compiler {:client {:compiler
{:optimizations :advanced {:optimizations :advanced
:preamble ^:replace ["cloact/react.min.js"]
:pretty-print false}}}}} :pretty-print false}}}}}
:srcmap {:cljsbuild :srcmap {:cljsbuild
{:builds {:builds
@ -21,6 +22,7 @@
{:builds {:builds
{:client {:source-paths ["src"] {:client {:source-paths ["src"]
:compiler :compiler
{:output-dir "target/client" {:preamble ["cloact/react.js"]
:output-dir "target/client"
:output-to "target/client.js" :output-to "target/client.js"
:pretty-print true}}}}) :pretty-print true}}}})

View File

@ -1,15 +1,16 @@
(defproject todomvc-cloact "0.0.3" (defproject todomvc-cloact "0.1.0-SNAPSHOT"
:dependencies [[org.clojure/clojure "1.5.1"] :dependencies [[org.clojure/clojure "1.5.1"]
[org.clojure/clojurescript "0.0-2120"] [org.clojure/clojurescript "0.0-2138"]
[cloact "0.0.3"]] [cloact "0.1.0-SNAPSHOT"]]
:plugins [[lein-cljsbuild "1.0.1"]] :plugins [[lein-cljsbuild "1.0.1"]]
:hooks [leiningen.cljsbuild] :hooks [leiningen.cljsbuild]
:profiles {:prod {:cljsbuild :profiles {:prod {:cljsbuild
{:builds {:builds
{:client {:compiler {:client {:compiler
{:optimizations :advanced {:optimizations :advanced
:preamble ^:replace ["cloact/react.min.js"]
:pretty-print false}}}}} :pretty-print false}}}}}
:srcmap {:cljsbuild :srcmap {:cljsbuild
{:builds {:builds
@ -21,6 +22,7 @@
{:builds {:builds
{:client {:source-paths ["src"] {:client {:source-paths ["src"]
:compiler :compiler
{:output-dir "target/client" {:preamble ["cloact/react.js"]
:output-dir "target/client"
:output-to "target/client.js" :output-to "target/client.js"
:pretty-print true}}}}) :pretty-print true}}}})

View File

@ -1,17 +1,17 @@
(defproject cloact "0.0.4-SNAPSHOT" (defproject cloact "0.1.0-SNAPSHOT"
:url "http://github.com/holmsand/cloact" :url "http://github.com/holmsand/cloact"
:license {:name "MIT"} :license {:name "MIT"}
:description "A simple ClojureScript interface to React" :description "A simple ClojureScript interface to React"
:dependencies [[org.clojure/clojure "1.5.1"] :dependencies [[org.clojure/clojure "1.5.1"]
[org.clojure/clojurescript "0.0-2138"]] [org.clojure/clojurescript "0.0-2138"]]
:plugins [[lein-cljsbuild "1.0.1"]] :plugins [[lein-cljsbuild "1.0.1"]]
;; :hooks [leiningen.cljsbuild]
:profiles {:prod {:cljsbuild :profiles {:prod {:cljsbuild
{:builds {:builds
{:client {:compiler {:client {:compiler
{:optimizations :advanced {:optimizations :advanced
:preamble ^:replace ["cloact/react.min.js"]
:pretty-print false}}}}} :pretty-print false}}}}}
:test {:plugins [[com.cemerick/clojurescript.test "0.2.1"]] :test {:plugins [[com.cemerick/clojurescript.test "0.2.1"]]
:cljsbuild :cljsbuild
@ -30,6 +30,7 @@
{:builds {:builds
{:client {:source-paths ["src"] {:client {:source-paths ["src"]
:compiler :compiler
{:output-dir "target/client" {:preamble ["cloact/react.js"]
:output-dir "target/client"
:output-to "target/cljs-client.js" :output-to "target/cljs-client.js"
:pretty-print true}}}}) :pretty-print true}}}})

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
(ns cloact.impl.reactimport (ns cloact.impl.reactimport
(:require-macros [cloact.impl.util :refer [import-js expose-vars]])) (:require-macros [cloact.impl.util :refer [import-js expose-vars]]))
(import-js "cloact/impl/react.min.js") ;; (import-js "cloact/impl/react.min.js")
(def React js/React) (def React js/React)

14469
src/cloact/react.js vendored Normal file

File diff suppressed because it is too large Load Diff

20
src/cloact/react.min.js vendored Normal file

File diff suppressed because one or more lines are too long