Fork me on GitHub
#clojurescript
<
2017-02-26
>
qqq03:02:10

does goog.net.Jsonp expect a json response ?

qqq03:02:21

i.e. if the response is not json, does it throw an "Uncaught SyntaxError: UNexpected token : " ?

qqq05:02:33

when using cljs-ajax, I am getting (in my :handler) something like this:

["^ " "~:attributes" ... ]
when I'm expetcing something like
{:attributes ... }
I have tried specifing the :format as :json and as :transit

qqq05:02:37

What am I doing wrong?

qqq05:02:55

apaprently (. resp setContent TYpe "application/transit+json") fixed it , though no idea why

briank4209:02:52

am i doing something wrong with re-frame here: https://hastebin.com/ofaruyewiq.lisp ? only the inner function in post is re-rendered when post-ids is updated which leads to the wrong data being showed in

@post
.

mikethompson09:02:25

Try this:

(defn post 
  [post-id]
  (let [post (re-frame/subscribe [:post post-id])]
      [:div (:id @post)]))

mikethompson09:02:16

If that fixes the problem, see this issue and note the explanation for "Corner Case #1" https://github.com/Day8/re-frame/issues/218#issuecomment-252470445

briank4209:02:11

this worked. thanks a lot! i will read the explanation to better understand what i did wrong.

qqq10:02:09

besides :optimizations ;advanced, are there any other mode that outputs just one .js file instead of a bunch of .js files ?

mikethompson10:02:45

@briank42 there is a #re-frame channel

lgessler17:02:27

is it alright for me to ask newbie questions here?

val_waeselynck17:02:23

@lgessler have you checked #beginners ?

lgessler18:02:34

thank you 馃檪 I'll go there

qqq19:02:17

has anyone managed to use re-com's GUI components from inside Om/Next ?

raspasov21:02:40

hey guys, has anyone tried the latest clojurescript + core.async under :advanced? I鈥檓 pretty positive it is broken, I made a minimal case https://github.com/raspasov/cljs-1.9.494-core-async-broken

anmonteiro21:02:37

it has been reported, but thanks for putting a minimal case together

anmonteiro21:02:07

Please use 1.9.473 for now

conaw21:02:20

Hey, does anyone know if it is possible to use spec/instrument in cljs

conaw21:02:14

I鈥檓 not successfully able to get any errors when I pass functions bad arguments, and can鈥檛 find any examples of folks using spec in cljs

darwin22:02:48

FYI, if anyone has a library dependent on core.async, you could throw in a code like this to warn unsuspecting people upgrading to .494: https://github.com/binaryage/chromex/commit/e904441b73e9c5db12a56d4d0fd86ffecfb1fb3a

anmonteiro22:02:50

I'm not sure that would work with Boot

anmonteiro22:02:02

why not just check *clojurescript-version*?!

darwin22:02:22

ah, good point 馃檪

darwin22:02:00

I just googled for detecting clojure library dependency version and this was the first thing that came out, didn鈥檛 think about it more

anmonteiro22:02:46

here's how we do it from a macro in Om

raspasov22:02:58

@anmonteiro thanks! got it 馃檪

sova-soars-the-sora22:02:09

Hi I have a question about the eventual deployment of my app. Do most people simply do lein uberjar, move the jar over, and lein it? I am wondering what people do when they update their cljs (so the javascript file) but the backend does not change...

qqq23:02:24

can someone pls patch #js so that: :stroke-width -> strokeWidth :font-size -> fontSize :pointer-events -> pointerEvents otherwise, #js is forcing me to use camelCase 馃槥

anmonteiro23:02:58

@qqq not gonna happen

anmonteiro23:02:18

what if you actually want a JS object with font-size or something?

qqq23:02:34

isn't this against fundamental cljs naming schemes?

anmonteiro23:02:45

#js is about interop

qqq23:02:48

then you use "font-size"

qqq23:02:57

:font-size ==> fontSize "font-size" ==> "font-size"

anmonteiro23:02:11

keywords and strings mean the same in #js

anmonteiro23:02:23

they're ultimately converted to strings

anmonteiro23:02:44

#js {:a 1} is just sugar for (js-obj "a" 1)

anmonteiro23:02:59

if you want that behavior in e.g. Om you can use https://github.com/plumatic/om-tools