Fork me on GitHub
#re-frame
<
2016-02-07
>
samueldev14:02:02

morning re-framers

samueldev14:02:08

is there a way to debug this: #object[SyntheticKeyboardEvent [object Object]] // #object[SyntheticEvent [object Object]] without needing to install clairvoyant or clj-devtools?

samueldev14:02:05

Now my question is why my events are empty 😞

samueldev14:02:56

That input component is producing empty events on the :on-change and I'm not super clear on why

samueldev14:02:06

I'm copying the example in re-frame/examples/todomvc

samueldev14:02:32

But my events seem to be entirely null: http://puu.sh/mZafj/6e20662e01.png

samueldev14:02:04

also typing in the input field doesn't actually allow me to type

paulspencerwilliams17:02:19

Anyone able to advise how to use lein ring uberjar with a project created with the re-frame lein template?

paulspencerwilliams17:02:51

I’ve tried added :hooks [leiningen.cljsbuild] but lein appears to be attempting to compile CLJS twice, and the resultant uberjar contains sourcecode like project.clj, but app.js is returning a 404?

roberto17:02:01

how does your project.clj look?

roberto17:02:45

here is an example that works for me:

:profiles {:dev            {:plugins       [[lein-figwheel "0.5.0-SNAPSHOT" :exclusions [org.clojure/clojure
                                                                                           org.codehaus.plexus/plexus-utils]]]
                              :dependencies  [[reloaded.repl "0.2.1"]]
                              :env           {:dev? true}
                              :repl-options {:init-ns user}
                              :source-paths  ["dev" "src/zoom_recordings/server"]
                              :cljsbuild     {:builds [{:source-paths ["src/zoom_recordings/ui"]
                                                        :figwheel     true
                                                        :compiler     {:output-to            "target/classes/public/js/app.js"
                                                                       :output-dir           "target/classes/public/js/out"
                                                                       :asset-path           "js/out"
                                                                       :optimizations        :none
                                                                       :recompile-dependents true
                                                                       :main                 "zoom-recordings.ui.core"
                                                                       :source-map           true}}]}}

             :uberjar {:aot          :all
                       :omit-source  true
                       :source-paths ["src/zoom_recordings/server"]
                       :main         zoom-recordings.server.core
                       :prep-tasks   ["compile" ["cljsbuild" "once"]]
                       :cljsbuild    {:builds [{:source-paths ["src/zoom_recordings/ui"]
                                                :jar          true
                                                :figwheel     false
                                                :compiler     {:optimizations  :advanced
                                                               :main           ^{:skip-aot true} zoom-recordings.ui.core
                                                               :output-wrapper false
                                                               :asset-path     "js/out"
                                                               :output-to      "target/classes/public/js/app.js"}}]}}}

paulspencerwilliams17:02:52

@roberto: far more basic than that; just one single commit on top of a lein reframe generated template -> https://github.com/paulspencerwilliams/reframeonheroku

paulspencerwilliams17:02:24

@roberto: It would look like I’m missing something along the lines of : :output-to      "target/classes/public/js/app.js but reading around, I didn’t believe this kind of step was needed; using the target path 😕

nberger17:02:37

@samueldev the null events might happen because of the react event pooling. Take a look at https://facebook.github.io/react/docs/events.html. I can't see why it would affect you from your snippet though...

paulspencerwilliams18:02:19

@roberto: cheers for your file. I’m reevaluating my approach now based on a combination of your, and the reagent + reframe templates.

samueldev18:02:01

if you try and just log out the entire event object, everything is null

samueldev18:02:05

but if you access an individual property, they have values

nberger22:02:29

@samueldev oh ok, good to know

samueldev22:02:54

but it's a thing

nberger23:02:42

@samueldev it turns out the quirk is due to the event pooling, because console log is asynchronous, and by the time it logs, the event has been recycled

kamn23:02:56

@samueldev: Funny that I ran into this issue just Friday

samueldev23:02:26

@nberger: yup I saw that haha

samueldev23:02:30

Gotta love working in JS land simple_smile

nberger23:02:44

Yeah... Y ran into a similar issue when building a debouncer, which needs to cache the event

samueldev23:02:49

has anybody used cljs-time?

samueldev23:02:22

[cljs-time.core :as time] can't be found for me

pdlug23:02:47

@sam.roberton: yes, no problems for me