Fork me on GitHub
#clojurescript
<
2015-09-26
>
venantius00:09:19

Anybody have any wisdom on working with ring-anti-forgery from the ClojureScript side?

venantius00:09:07

I’m just noodling here, but it seems you could get something working by making an authenticated GET against some endpoint that returns the anti-forgery token, which can then be put in a header for post requests

venantius00:09:27

is that crazy?

asolovyov06:09:42

anybody using goog-define here? I defined a variable, but my :closure-defines seemingly have no effect on it...

borkdude07:09:53

@venantius: that's how I've done it

borkdude07:09:12

@venantius: but if your index page is dynamic, you could put it in there?

martinklepsch09:09:32

@asolovyov: also which optimization mode?

martinklepsch10:09:02

I’m curious, what do people use Facebook’s css-layout for? https://github.com/facebook/css-layout

zharinov12:09:20

But i think, most common use case is flexbox implementation on mobile devices

lukemorton13:09:36

Does anyone know how I can parse a markdown file into a quiescent component? Preferably not parsing markdown in the browser.

bhauman13:09:19

@lukemorton: you can use a macro for this. Find some clojure or java markdown library and transform the markdown in the macro expansion. You could give the macro a filename and open it and transform it all in the macro

lukemorton14:09:25

Thanks I'll look into clojurescript macros

bbss15:09:15

Well written.

lukemorton16:09:52

Thanks for the pointer @bhauman

asolovyov18:09:51

@martinklepsch: lein, figwheel, optimizations :none

martinklepsch18:09:16

@asolovyov: try using a string key if you aren’t already

martinklepsch18:09:26

also there’s no quoting required in project.clj

asolovyov19:09:41

@martinklepsch: I tried string key... and I'm running figwheel by hand (since composing lein plugins doesn't really work), so it's in project.clj

martinklepsch19:09:15

@asolovyov: grep in target for CLOSURE_UNCOMPILED_DEFINES

asolovyov19:09:50

main.js
27:goog.global.CLOSURE_UNCOMPILED_DEFINES = {"mk.fe.vars.target":"nodejs","cljs.core._STAR_target_STAR_":"nodejs"};

asolovyov19:09:46

but then in my vars.js:

mk.fe.vars.target;

/** @define {string} */
goog.define("mk.fe.vars.target","browser");

asolovyov19:09:55

what's the difference?..

martinklepsch19:09:22

@asolovyov: difference between what?

martinklepsch19:09:32

can you show the vars namespace?

asolovyov19:09:40

cljs version?

asolovyov19:09:46

(ns mk.fe.vars)

(goog-define api-url "/api/v2")
(goog-define target "browser")

asolovyov19:09:43

here is part of my compiler-options: :closure-defines {"mk.fe.vars.target" "nodejs"}

martinklepsch19:09:07

Not sure what’s going on here

martinklepsch19:09:17

gtg unfortunately, talk later!

martinklepsch19:09:28

def. weird 😜

asolovyov19:09:08

thanks though, I can use *target* for now, hehe