Update Om to fix production build issues

This commit is contained in:
Nicholas Kariniemi 2015-07-05 10:09:11 +03:00
parent 9e6d900596
commit 6ca589e3e6
7 changed files with 22 additions and 38785 deletions

View file

@ -6,7 +6,7 @@
:dependencies [[org.clojure/clojure "1.7.0"]
[org.clojure/clojurescript "0.0-3308"]
[org.clojure/core.async "0.1.346.0-17112a-alpha"]
[om "0.7.3"]
[org.omcljs/om "0.8.8"]
[http-kit "2.1.19"]
[ring/ring-core "1.3.2" :exclusions [org.clojure/tools.reader]]
[hiccup "1.0.5"]
@ -27,17 +27,15 @@
:min-lein-version "2.1.2"
:plugins [[lein-cljsbuild "1.0.3"]
[lein-ring "0.8.6"]]
:cljsbuild {:builds {:dev {:source-paths ["src/cljs" "src/cljc"]
:compiler {:output-dir "resources/public/js/out"
:output-to "resources/public/js/grub.js"
:optimizations :none
:source-map true}}
:cljsbuild {:builds {:dev {:source-paths ["src/cljs" "src/cljc"]
:compiler {:output-dir "resources/public/js/out"
:output-to "resources/public/js/grub.js"
:optimizations :none
:source-map true}}
:prod {:source-paths ["src/cljs" "src/cljc"]
:compiler {:output-to "resources/public/js/grub.min.js"
:optimizations :advanced
:pretty-print false
:preamble ["react/react.min.js"]
:externs ["react/externs/react.js"]}}}}
:compiler {:output-to "resources/public/js/grub.min.js"
:optimizations :advanced
:pretty-print false}}}}
:source-paths ["src/clj" "src/cljc" "target/classes"]
:test-paths ["src/test"]
:ring {:handler grub.core/app}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -32,7 +32,6 @@
(hiccup/include-css "./css/styles.css")]
[:body
[:div#container]
(hiccup/include-js "./js/react-0.11.2-with-addons.js")
(hiccup/include-js "./js/out/goog/base.js")
(hiccup/include-js "./js/grub.js")
[:script {:type "text/javascript"} "goog.require(\"grub.core\")"]]))

View file

@ -60,7 +60,7 @@
(when (= edit-state :editing) "edit")]
:on-click (fn [e] (when (#{:waiting :pressed} edit-state)
(om/transact! grub nil #(assoc % :completed (not completed)) :local)
(.blur (om/get-node owner :grub-input))))
(.blur (om/get-node owner "grub-input"))))
:on-mouse-down #(transition-state owner :mouse-down)
:on-mouse-up #(transition-state owner :mouse-up)
:on-mouse-leave #(transition-state owner :mouse-leave)
@ -70,7 +70,7 @@
[:input.grub-input
{:type "text"
:readOnly (if (= edit-state :editing) "" "readonly")
:ref :grub-input
:ref "grub-input"
:value (:grub-text state)
:on-change #(om/set-state! owner :grub-text (.. % -target -value))
:on-key-up #(when (dom/enter-pressed? %) (transition-state owner :enter))}]

View file

@ -79,8 +79,8 @@
(html
[:div.panel.panel-default.recipe-panel
{:on-click
#(when (not (or (dom/click-on-elem? % (om/get-node owner :add-grubs-btn))
(dom/click-on-elem? % (om/get-node owner :save-btn))))
#(when (not (or (dom/click-on-elem? % (om/get-node owner "add-grubs-btn"))
(dom/click-on-elem? % (om/get-node owner "save-btn"))))
(transition-state owner :click))}
[:div.panel-heading.recipe-header
{:class (when (= edit-state :editing) "edit")}
@ -90,9 +90,9 @@
:value name
:on-change #(om/set-state! owner :name (dom/event-val %))}]
[:button.btn.btn-primary.btn-sm.recipe-add-grubs-btn
{:type "button"
:class (when (= edit-state :editing) "hidden")
:ref :add-grubs-btn
{:type "button"
:class (when (= edit-state :editing) "hidden")
:ref "add-grubs-btn"
:on-click #(add-grubs (om/get-shared owner :add-grubs-ch) grubs)}
[:span.glyphicon.glyphicon-plus]
" Grubs"]]
@ -115,8 +115,8 @@
:on-click #(put! remove-recipe-ch id)}
[:span.glyphicon.glyphicon-trash]]
[:button.btn.btn-primary.pull-right.recipe-done-btn
{:type "button"
:ref :save-btn
{:type "button"
:ref "save-btn"
:on-click #(transition-state owner :save)}
[:span.glyphicon.glyphicon-ok]]]])))

View file

@ -49,8 +49,8 @@
(render-state [this {:keys [edit-state new-recipe-name new-recipe-grubs new-recipe-directions]}]
(html
[:div.panel.panel-default.recipe-panel
{:on-click #(when (not (dom/click-on-elem? % (om/get-node owner :save-btn)))
(transition-state owner :click))}
{:on-click #(when (not (dom/click-on-elem? % (om/get-node owner "save-btn")))
(transition-state owner :click))}
[:div.panel-heading.recipe-header.new
[:input.form-control.recipe-header-input
{:id "new-recipe-name"
@ -73,8 +73,8 @@
:placeholder "Directions"
:on-change #(om/set-state! owner :new-recipe-directions (dom/event-val %))}]
[:button.btn.btn-primary.pull-right.recipe-done-btn
{:type "button"
:ref :save-btn
{:type "button"
:ref "save-btn"
:on-click #(transition-state owner :save)}
[:span.glyphicon.glyphicon-ok#save-recipe-btn]]]]))