Fork me on GitHub
#clojurescript
<
2017-12-18
>
tomaas12:12:50

hi, I can't get how to make :render-calendar-info foo prop work

tomaas12:12:18

i get this error react-dom.inc.js:17985 Uncaught Error: Objects are not valid as a React child (found: :div). If you meant to render a collection of children, use an array instead or wrap the object using createFragment(object) from the React add-ons. Check the render method of OutsideClickHandler`.`

rauh12:12:48

@tomaas You're missing an argumetn on your map-indexed

tomaas12:12:34

(map-indexed f coll)

rauh12:12:32

@tomaas Sorry, my slack often doesn't expand the lines even if I click "expand" and I only saw the first 5 lines. šŸ˜•

antonpaisov14:12:29

I've been following this tutorial https://github.com/magomimmo/modern-cljs/blob/master/doc/second-edition/tutorial-02.md and it doesn't work for me , I mean it kind of works, but instead of my clojurescript code I believe in console I have not mine, but default Hello, world! therefore when I change the hello world text, it does not change in the console. maybe that's too much details and anyone knows a better clojurescript tutorial that I could follow? šŸ™‚

michaels14:12:05

@antonpaisov did you be sure to refresh the browser after restarting it at that point?

michaels14:12:14

(Iā€™m doing that tutorial myself right now.

antonpaisov15:12:39

@michael528 what lesson are you on?

michaels15:12:05

So Iā€™m barely ahead of you. šŸ˜‰ I had to mess around in 1 with clojurescript/clojure/boot versions to get it to work with whatever I had installed already as well. (Maybe java 9?)

antonpaisov15:12:03

yeah, I think that the setup is the problem

antonpaisov16:12:53

I played around with different lib versions myself and I think problems appeared after that šŸ™‚

antonpaisov16:12:18

even though I've reversed back to versions from the tutorial

michaels16:12:48

(set-env!
 :source-paths #{"src/cljs"}
 :resource-paths #{"html"}
 :dependencies '[[org.clojure/clojurescript"1.9.946"][adzerk/boot-cljs "2.1.4"]])

michaels16:12:54

Thatā€™s what I used in #1.

antonpaisov16:12:23

with clojure 1.9 and java 9?

michaels16:12:10

Looks like boot is using clojure 1.7.0 (šŸ˜³ ), and my java says 1.8

antonpaisov16:12:39

my java is 1.8 too

michaels16:12:45

So I may have been speculating there.

antonpaisov16:12:47

yeah, seems that 1.7.0 it is

antonpaisov16:12:42

but I'm trying out clojurescript and boot-cljs version that you have suggested šŸ™‚

justinlee16:12:45

@antonpaisov @wmichaelshirk I started going down that tutorial too but in the end I found it somewhat in-the-weeds and not that easy to follow. For what it is worth, I quit it and just started playing around with the resources on the reagent website directly and have made a lot more progress.

michaels16:12:04

Iā€™m 100% in love with what clojure itself iā€™ve done. But the tooling (which I know is improving!) is not the most transparent to a noob. šŸ¤“

michaels16:12:40

Iā€™ll keep circling back ā€™till I get it.

justinlee16:12:48

Iā€™m coming from javascript and clojure really deserves a Dan Abramov like character to push hard for the developer experience.

michaels16:12:09

I blame java for most of the difficulties. šŸ˜‰ They plague me in my day-job also.

justinlee16:12:19

So far Iā€™ve found that once you get things working, the actual code is amazing and it Just Works (tm), but getting there is painful.

michaels16:12:24

I know every ecosystem has their own pain. (ā€œJS fatigueā€ and all that.)

antonpaisov16:12:02

yeah, I'm really interested in cljs when it will be java independent šŸ™‚

antonpaisov16:12:45

a have 0 java experience, so when I get exceptions it hurt my eyes šŸ™‚

antonpaisov16:12:53

@lee.justin.m I'm thinking about doing something like that too šŸ™‚ but I really want to understand why my local setup behaves like it does right now

michaels16:12:50

In school - weā€™d generate java exceptions that had like 2 or 3 stack frames. Then I started using the Spring Framework. Now my stack traces are 50 or more deep. So while the clojure ones are ugly - I just sigh and say, ā€œThatā€™s Java!ā€

justinlee16:12:50

stackframes can be super useful, but I donā€™t understand why the tools tend to spit a stackframe at you when something trivial happens like a missing dependency

justinlee16:12:28

@antonpaisov I also ended up using tenzing to get my environment going. The guy who maintains it hangs around on slack and is helpful in answering questions. It is a really nice tool.

antonpaisov17:12:47

thank you, will check it out

romain17:12:22

When you need a server-side API for your SPA app, what do you use?

justinlee17:12:19

you mean like serializing json over http on the client side or actually implementing the api on the server side?

romain17:12:56

@lee.justin.m woops sorry, I edited my message. I mean server-side API (like uploading files, query a database...)

justinlee17:12:11

my backend is javascript on node, so others will have to answer. iā€™m focused on using clojurescript for the front end. i assume that most people implementing backends do it with clojure on the jvm, but maybe people run clojurescript on node (?)

antonpaisov18:12:15

I currently write Ruby, and for the front-end it React on ES6 and on another project it's Elm

antonpaisov18:12:26

I want to give Clojure a serious try since 2013, but somehow still haven't found time for it, but maybe now's the time. given that I'm not so interested in Clojure for the back-end just yet, a friend suggested that I start with CLJS šŸ™‚

justinlee18:12:30

I am currently trying to learn the language and port a frontend written in es6/react/redux project to cljs. The tenzing tool got me going, and reagent seems pretty intuitive. So far everything is going pretty smoothly, though I am not looking forward to the day when I have a use a library that hasnā€™t been wrapped up and have to figure out how to do that myself.

romain18:12:41

I'm curious about a clojure backend solution

noisesmith18:12:43

@justinlee interop is pretty painless and its one of the best features of clojure, it shouldnā€™t take more than 30 minutes exploring in a cljs repl to understand most of it

justinlee18:12:22

@noisesmith Interacting with JS objects and methods is super easy. Iā€™m just worried that making some complex react library work with the closure compiler (or whatever it is that needs to be done) is going to be a nightmare. Hereā€™s to hoping it wonā€™t be!

noisesmith18:12:52

Iā€™ve been working on a clj/cljs app for years now at the day job, and itā€™s never more difficult than adding some externs and reading some docs (worst case reading some js or following an example). And with newer releases I hear tell we might not even have to write extern files any more.

noisesmith18:12:47

it can be a little tricky when the mainstream way to use a library uses syntactic features Iā€™m unfamiliar with, but thatā€™s a js difficulty, not a cljs one

justinlee18:12:45

thatā€™s great to hear