Fork me on GitHub
#clojurescript
<
2015-09-08
>
joost-diepenmaat06:09:00

@venantius: well, there are the various react bindings, of course.

jaen06:09:44

@venantius: I have not seen anything apart from sablono (hiccup-like) and kioo (enlive-like) templating so far. The closest you might get to what you describe is to use middleman (either with boot-middleman or standalone Ruby) to generate HTML templates from your preferred templating and then use that with kioo.

jaen06:09:21

My current project started out like that, but then I realised it's too much of a hassle until we get proper designers and we decided to stick with hiccup for now.

Niki06:09:43

@val_waeselynck: no, it’s not normal. Would be great if you can share you setup (in GH issue maybe?)

venantius07:09:21

Thanks @joost-diepenmaat and @jaen! I think what I had in mind was more some way doing something like Jade -> Kioo -> Om

val_waeselynck08:09:27

@tonsky: thanks, when I've got time I'll try to give you enough to recreate the problem. I've been experimenting a bit, I think recursive rules are a major slowdown

Niki08:09:42

@val_waeselynck: maybe just post the query then? Yes they can be slow

val_waeselynck08:09:08

@tonsky: can't do it right now (I'll need to make it readable a little bit), how about I PM this to you when I have some time ? simple_smile

Niki08:09:22

Sure, great!

aspra10:09:42

Hi everyone. I want to create some simple data plots in ClojureScript. Are strokes and C2 outdated? Any other preferably native options?

donmullen11:09:55

@aspra: Just posted over in #C03S1KBA2 - I have not used it - but looks interesting: https://github.com/thi-ng/geom/blob/develop/geom-viz/src/core.org

aspra12:09:08

@donmullen: thanks! seems like a cool lib, I will have a look. However I am still curious to know what is the “standard” these days for ClojureScript. Plus I just need a few simple charts, maybe the above is an overkill.

delaguardo12:09:23

I use https://gionkunz.github.io/chartist-js/ for simple charts. Works great with clojurescript

delaguardo12:09:12

And has react component if you prefer React-based wrappers

borkdude12:09:19

any idea how to open a download in a new window + having a spinner while the download is being processed?

borkdude12:09:46

Wrong number of args (3) passed to: core/-DOT--DOT- This is valid right? (.. w -document -body)

joost-diepenmaat12:09:52

@borkdude any reason you’re not doing (-> w .-document-body) ?

borkdude12:09:15

@joost-diepenmaat: I tried (-> w .document .body)

borkdude12:09:37

but (.. w -prop1 -prop2) should work normally

joost-diepenmaat12:09:40

I mean (-> w .-document .-body)

joost-diepenmaat12:09:54

assuming that’s clojurescript

borkdude12:09:54

ah yes, that's what I normally do, (-> x .-prop1 .-prop2)

joost-diepenmaat12:09:57

but I think (.. w -document -body) should work yes

borkdude12:09:27

other question: it's possible to assign a data uri to a new window, right? I'm trying this with a PDF

borkdude12:09:18

but it says invalid url... I tried the same as in this example: http://stackoverflow.com/a/25068020

borkdude12:09:42

I think I'll abandon this road and just open the pdf in a new window the 'normal' way

jvuillermet13:09:37

Hi, can someone explains what is ^boolean goog.DEBUG what is the ^boolean used for ?

jvuillermet13:09:10

OK, in which case ommiting it would change something ?

dnolen13:09:33

@jvuillermet: won’t change the runtime behavior of the program, but dead code elimination won’t work as effectively.

dnolen13:09:48

this problem is entirely limited to Google Closure boolean defines

jvuillermet13:09:06

ok got it thanks

dnolen13:09:10

@jvuillermet: it’s a known issue with a ticket, hopefully get addressed in the near future

bensu13:09:00

@venantius: jade -> kioo -> om is exactly what I do. It works great as long as you keep the size of the templates small (just what is needed) otherwise kioo generates a lot of js code.

jaen13:09:43

@bensu: what do you use to turn jade into html before feeding it to kioo? Also do you do anything to touch relevant kioo snippets so they automatically recompile when you change the jade source? I was doing something similar a while back and I'm curious how do you deal with those things.

bhauman14:09:35

@aspra I used c3js the other day and it was super quick to get going. It's on cljsjs so it's really easy to pull in.

aspra14:09:44

@bhauman: will have a look thanks. @delaguardo @donmullen So I suppose there is not a “standard” or mostly used lib atm and definitely not a clojurescript one.

aspra14:09:04

and how about dimple?

Petrus Theron14:09:51

I have got secretary working for url routing in my reagent app, but I can't get it working on initial URL load. I call this hook-browser-navigation! on app init:

(defn hook-browser-navigation! []
  (let [user (subscribe [:user])]
    (doto history
      (events/listen
        EventType/NAVIGATE
        (fn [event]
          (let [uri   (.-token event)]
            (secretary/dispatch! uri))))
      (.setEnabled true))))
I have tried calling it before and after calling reagent/render, with no success.

timgilbert15:09:19

@petrus, that’s about what I have although I seem to be instantiating the History instance on every call: (doto (History.) …)

bensu15:09:30

@jaen: I'm using jade as a grunt task in autobuild, and then in kioo consuming the html templates from a resources/templates folder. I haven't solved automatic cljs compilation when changing the jade source 😞 I just change a line break to activate figwheel.

Petrus Theron15:09:59

Yayyy! Got it working. Turns out I was calling init on page load, and boot was calling it on init as well.

jaen15:09:46

@bensu: I see, thanks. Similar to what I've been doing then if you s/jade/haml, s/grunt/boot-middleman and s/figwheel/boot-reload. Right now I'm back to just using sablono/hiccup, since we don't really have any designers yet to benefit from the separation kioo gives, but at some point we'll probably move back to that. Hopefully I figure something for autoreloading by then.

venantius16:09:27

@bensu that’s awesome! I don’t suppose you have any open source instances of that I could take a look at?

bensu16:09:34

@venantius: no... that's application code and it is probably not a good idea to make all those choices in a library. In any case, try to set it up and if you run into trouble we'll help.

dnolen16:09:44

Interesting read @venantius http://blog.venanti.us/clojurescript-blues/, I don’t agree with most of it since some of it is just lack of experience, and a lot of is stuff I don’t use in order to avoid the said issues simple_smile That said I don’t really have a solution for problem created by 3rd party tooling.

dnolen16:09:36

In general I don’t care for the the OSS “free-loader” culture at large, where people use stuff but don’t contribute stuff and then complain about it.

dnolen16:09:53

The Clojure community as much as any OSS community suffers from a lot of this.

dnolen16:09:43

Still worth chewing on - newcomer experiences are important and there’s probably no way to make it better but more blood, sweat, tears.

nullptr16:09:40

agreed, worth chewing on -- in particular, i think it's worthwhile to consider the new user profile -- he describes the Dependencies wiki page as "incredibly hostile" to new users, which it probably is, but not at all what who i was writing it for!

nullptr16:09:25

some new user focused documentation could be quite helpful for a number of these points -- how to avoid landmines if nothing else

angusiguess16:09:32

Some of the issues strike chords, I definitely ended up abandoning most of my clojure habits when developing cljs. Still think that the vim problem will always have to do with the awkwardness of implementing a repl with a single thread. I ended up moving off of lein for cljs projects because all I really wanted was deps management, most of lein's other functionality didn't appear to apply.

angusiguess16:09:44

The quickstart document nudged me away from using lein and templates.

jaen16:09:24

FWIW boot's cljs workflow seems to be a lot less rough around the edges than figuring a proper combination of figwheels, austins, piggiebacks and compilation options. At least when I first started trying clojurescript it was dark magic how to exactly set up lein for cljs compilation and I ended up aping various project.cljs I found online with middling level of understanding of what I'm doing. Boot makes it considerably easier to start off the bat.

angusiguess16:09:15

@jaen Once I discovered that the real gap was dep management I went with boot, which after a bit of a curve turned out to be really pleasant!

venantius16:09:31

@dnolen: thanks for the feedback; fwiw I think I’ve got a decent resume as far as contributing back to the Clojure community re: 3rd party tooling, which is what I think makes me somewhat qualified to complain 😛

venantius16:09:50

But in general I agree; I’m not interested in being the sort of person who’s only throwing stones and not offering solutions

venantius16:09:28

And I’m sure much of my complaints at the moment are lack of experience; the post was in a very different state before Daniel Woelfel took at look at it and told me half of the things I was simply doing wrong

venantius16:09:52

I think documentation is a particularly important part of the newcomer experience, and at the moment (at least as a stranger) it still feels like ClojureScript is figuring out its “one true way” of doing things. But then, I suppose I’ve felt similarly about most programming communities at some point or another, so maybe that’s not a helpful criticism.

venantius16:09:05

@jaen I’d love to see a sample boot project for ClojureScript. I’ve written quite a few Lein plugins at this point so I’m pretty familiar with its peculiarities, but if Boot has a way of just making everything simple I’d love to see what that experience is like

angusiguess16:09:51

I used this to build out my boot files.

angusiguess16:09:06

oops, this isn't the example ap.

jaen16:09:07

@venantius: out of curiosity, what did you mean when you said but if I wanted to keep my templating logic apart from my application logic there's still little support for that? Maybe I'm looking at it wrong, but enlive/kioo always seemed to me like the ultimate templating library in terms of separation of logic from template.

venantius16:09:05

@jaen this is a personal problem, but I really dislike writing Enlive/Hiccup in code. I’d prefer to have standalone templates outside of my clj/cljs src tree that I can pull in

venantius16:09:50

so the separation for me is there: I want the templating logic to sit in a file in /resources, and I just want kioo/etc to help me bring that into the app (along with some sort of nice cljs/template interface)

jaen16:09:48

Ah, I see. So not separation of logic from template, but separation of template from Clojurescript, yes?

jeluard16:09:41

@venantius: hiccup is a great pivot format. You don’t have to use it directly in your code, just load some resources and convert it to hiccup (e.g. html -> hiccup via hickory)

venantius16:09:54

@jaen that’s correct

venantius17:09:24

@jeluard: like that, but for the richer templating languages simple_smile

venantius17:09:36

(where I don’t have to write my closing tags!)

jaen17:09:44

Ah, so there's nothing really like that as far as I know.

venantius17:09:25

I want this sort of connector but with an idiomatic Clojure(Script) interface https://github.com/jadejs/react-jade

jaen17:09:08

BTW if you end up switching to boot I can't endorse boot-middleman enough - http://hashrocket.com/blog/posts/the-front-end-development-environment-of-my-dreams - it can get you partially where you want - you can easily write HTML templates in HAML or Jade or something, and then transform that with kioo.

jaen17:09:24

Still not quite what you want, but at least you have pleasant templating syntax

venantius17:09:51

the magic of multiplatform simple_smile

jaen17:09:03

Yeah, as long as libraries don't clash (I had to run a slightly hacked version of boot-middleman, because otherwise JRuby clashed with buddy).

jaen17:09:27

I didn't take it all the way through, because I realised that as long as there's no real designers on the project writing hiccup is just faster

jaen17:09:32

But what I wanted to do

jaen17:09:06

Is to create HTML mockups with Middleman using HAML and SASS and then in Clojurescript have kioo snippets in a separate namespace, so they could be easily reloaded if templates changed with a simple touch.

jaen17:09:15

I imagine this could make for quite pleasant experience

dnolen17:09:57

@venantius: I think we’re long past the point of ClojureScript trying to find the “one true way”. I actually think part of the actual struggle is the vast array of options even though the community is quite small.

dnolen17:09:25

@venantius: but this is also why the criticisms about templating options ring hollow to me. If you want to do it a different way - then go do it yourself simple_smile

dnolen17:09:36

@venantius: as far documentation, I only agree that Clojure(Script) is no better or worse than any other community. Pretty terrible all around, maybe you feel it a bit more in ClojureScript since the community is much smaller.

venantius17:09:01

I think points 1 and 3 are closely related. It took me a long time to figure out which libraries to use in Clojure, and how to stitch them together, and that was through the fortunate experience of working at both CircleCI and Standard Treasury, where we were using it full-time.

venantius17:09:37

To your second point - as I’ve said, it’s definitely an issue of personal preference. And I’m not precluding the possibility of writing things.

angusiguess17:09:46

Clojure, I think, has the benefit of a few very well maintained and evangelized community offerings, poss. because the community is larger? Conjecture though.

venantius17:09:02

At the moment the place where I felt the suffering the most was not having all of the knowledge of Chestnut encapsulated as a plugin

angusiguess17:09:02

It doesn't feel to me like clj has one true way, but rather a bunch of well-trodden paths.

venantius17:09:55

something like “just put this plugin in your profiles.clj and you’ll get everything compiled properly and figwheel will just work. if you want to override parts of this, here are your escape hatches"

venantius17:09:36

which is the sort of thing I might tackle, though not until I feel I understand how the compiler works better

venantius17:09:41

which will take time, since, new.

dnolen17:09:23

@venantius: the problem is no one with any amount of serious experience wants templates. So you don’t get people with tons of expertise spending lots of time on helping out with them.

dnolen17:09:44

to be fair, one year ago things were so bad you absolutely had to have a template to get anything done.

dnolen17:09:02

so I contributed to a few … but things are quite different now.

dnolen17:09:27

as I’ve said on many occasions I personally don’t use anything more sophisticated than the Quick Start.

dnolen17:09:46

I make an exception for Figwheel as it’s getting really solid now

angusiguess17:09:12

@dnolen How do you handle deps?

dnolen17:09:29

@angusiguess: Maven or something that talks Maven (aka Lein)

dnolen17:09:55

My fear of XML has long departed. I don’t have any more time to waste on understanding why tool dep X isn’t working with Y.

venantius17:09:51

@dnolen: ++ to everything you just said

nullptr17:09:45

my happiness with cljs has increased as i’ve simplified my toolset, part of the problem is i came to cljs from clj and expected the same stuff (cider magic, for example) to work, and it’s just not there yet — would have saved time and frustration had somebody just slapped me and said “don’t expect that stuff to work"

nullptr17:09:57

that said, i think making lein [cljsbuild] work nicely and reliably would be a big help for newbies — we’d lose a lot of people if we suggested hacking on POMs

dnolen17:09:50

@nullptr: agreed on all that

roberto17:09:33

I had the same experience. When I stopped trying to make cljs work with cider, I became more productive. And honestly, I feel very little need for that when I’m using figwheel. It also helped to just focus on a small set of tools and not try to spend too much time on tooling. For example, I settled for lein instead of boot, friend instead of buddy, reagent instead of wandering between all the different front end options, clj test instead of midje….

donmullen18:09:06

@venantius: the #C053K90BR channel is active and lots of folks there to help get you going.

troyclevenger18:09:58

If anyone has a few min to look at this bug I'm getting and let me know if they think it's a compiler issue or not. https://github.com/Prismatic/om-tools/issues/81#issuecomment-138642906 It involves Om but I think the problem is more general.

bhauman18:09:28

@nullptr @roberto I wish more folks would listen your experience :) It's almost like everyone wants to make the experience much harder than it needs to be. Everyone seems to feel compelled to make nREPL and cider work.

bhauman18:09:17

In the beginning

arohner18:09:37

to be fair, that’s the recommended course of action in CLJ. And, it is nicer once it’s working

sgrove18:09:24

Yes, nrepl/cider is significantly nicer, and the muscle memory is also quite important

dnolen18:09:30

Pffft. Long live SLIME+swank-clojure!

jaen18:09:25

Then I suppose I must be a hipster, using Cursive and all? Wouldn't trade the debugging support for anything.

venantius18:09:18

It is a strange thing to adapt to @bhauman. Having all of that auto-reloading magic is very cool but there are some things I still miss when I don’t just have an instant magical nREPL connection available

venantius18:09:54

For instance, being able to nab function-under-cursor documentation is a big convenience when you’re starting out

dnolen18:09:15

@jaen: haha, that was a joke I use Cursive too.

roberto18:09:05

@venantius: if you are able to get figwheel + cider working that is great, my point was that when you are just starting out with clojure/clojurescript, spending too much time trying to do that is counter productive and can be frustrating. So starting off with little steps would be more helpful instead of trying to swallow the entire eco system from the start.

venantius18:09:31

@roberto: I’m of a mixed mind. I want the setup to be easier (and I’m using Fireplace rather than Cider, but the experience is similar), and you’re right that it’s better to get to “yay, I’m making stuff and it works!” than to spend time feeling frustrated that the toolchain doesn’t do what you want. At the same time, when I know so little about ClojureScript not having easy ways to educate myself like being able to just hit “K” when I’m over a symbol and have the documentation pop up in my Vim window also makes the experience feel really bleh

venantius18:09:19

and I know I can get to a place where this does work, but I ended up taking the path you recommended and just focused on getting stuff shipped to start 😛

venantius18:09:52

Oh! Also, @bhauman — slight change of topic, but where do you stand on the subject of REPL middleware for Figwheel?

bhauman19:09:09

@venantius: that is being worked on. I have a pull request that I have to merge.

bhauman19:09:30

I'm about to get on a plane. Leaving Montreal and heading back home to Asheville.

venantius19:09:19

@bhauman: that is extremely exciting. I look forward to writing some :)

bhauman19:09:12

@venantius oh I think I misunderstood you, I'm talking about customizing the nREPL middleware that figwheel uses.

venantius19:09:11

I'm looking for an in for me to get syntax highlighting at a cljs/ figwheel repl

xificurC21:09:26

does anyone know of a cljs project that builds a shell? I mean a typical unix shell where you would manipulate files, start/stop services etc

martinklepsch21:09:13

xifi: not sure I understand. You mean like an actual shell like bash or something that behaves like a shell?

xificurC21:09:47

well we have REPLs, right, so I mean a library that implements what you'd expect from one - filesystem manipulation, handling processes etc

martinklepsch21:09:53

I’m not aware of such project.

xificurC21:09:48

@donmullen: I'm just curious simple_smile Every language gets to the point where a shell-like thing is born

darwin22:09:28

but I guess you wanted some “functional” shell without side effects, right? 😉

darwin22:09:08

would be interesting to have some shell where you can treat a part of your filesystem as a persistent value and work with it in clojure-style, and apply effects when executing some commit! or something like that, I guess this must exist somewhere

xificurC22:09:41

@darwin: boot has things in that area, immutable filesystem etc. It even has commit!

xificurC22:09:51

well I'm often thinking why are we still joining filtering etc strings in the 21st century. I mean yes, Rich says use data to communicate, but he doesn't mean strings simple_smile

xificurC22:09:47

powershell uses objects which some people seem to like (there's even an attempt to port it to linux), but having a clj(s) shell might be interesting

xificurC22:09:20

black-screen: Note: Only OS X is currently supported :s

thosmos23:09:24

@venantius: I just made a quick boot demo project based on the boot-cljs-example to test the new UMD javascript loading in the latest clojurescript (https://github.com/thos37/cljs-d3-umd). I've been using that example project as guidance and am really liking how easy boot makes it to get up and running. Compared to the Quickstart however, Boot does feel like it's adding a layer of abstraction between me and the tooling. At this point in my experience I appreciate that, but I can imagine a day in the future where I might want to be controlling every knob in every build tool. @dnolen: I just successfully created a new test app that uses the UMD module loading in 1.7.132 that was described in Maria Geller's blog! Wow, what an exciting milestone! (https://github.com/thos37/cljs-d3-umd ) I'm looking forward to testing out loading various react JSX components, etc. This feels like a significant advancement.