This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-07-05
Channels
- # admin-announcements (10)
- # beginners (18)
- # boot (29)
- # capetown (2)
- # cider (46)
- # cljs-dev (1)
- # cljsrn (69)
- # clojure (126)
- # clojure-android (9)
- # clojure-gamedev (3)
- # clojure-greece (16)
- # clojure-poland (13)
- # clojure-russia (45)
- # clojure-spec (27)
- # clojure-uk (21)
- # clojurescript (99)
- # cursive (1)
- # datascript (1)
- # datomic (42)
- # functionalprogramming (10)
- # hoplon (47)
- # instaparse (12)
- # jobs (5)
- # jobs-rus (9)
- # keechma (22)
- # lein-figwheel (8)
- # leiningen (5)
- # luminus (1)
- # mount (7)
- # off-topic (1)
- # om (15)
- # onyx (47)
- # other-languages (14)
- # planck (28)
- # proton (8)
- # re-frame (30)
- # reagent (15)
- # remote-jobs (3)
- # slack-help (2)
- # untangled (9)
- # yada (6)
Could someone with >1500 points on Stackoverflow go in and tag this question with cljsrn
? A custom tag for react native in clojurescript would help our small community to share knowledge a bit more efficiently: http://stackoverflow.com/questions/38198511/how-to-prevent-node-from-running-out-of-memory-when-bundling-js-for-react-native/38198512#38198512
Can I do this more elegantly #(= (type (goog.date.Date.)) (type %))
?
#(instance? goog.date.Date %)
does not work since it does not make difference between a goog.date.DateTime
and goog.date.Date
.
i am totally new to web development (but not new to clojure) and I am totally lost on where to start
@dhruv1: I’m using re-frame
and find its readme quite informative. That plus the reagent site would give you insight in some essential parts of web dev in cljs. Not really tutorials though.
https://github.com/Day8/re-frame
http://reagent-project.github.io/
And om/om.next are also very popular: https://github.com/omcljs/om
I’ve been doing modern-cljs tutorial. https://github.com/magomimmo/modern-cljs/blob/master/doc/second-edition/tutorial-01.md
@vikeri: thanks! I’ve looked at the re-frame concept and love the idea of flow of data in one direction
I’m so new to web development that there are times I have no idea to get things going. i.e: how to style things or even get started on how to style things.
@lewix: this one? https://lambdaisland.com/ thanks!
This is also a good resource; I relied on it a lot when learning CLJS. https://funcool.github.io/clojurescript-unraveled/
@stephen_turley: thanks. i read tutorial_01 and looks pretty good!
@akiva: thanks. i’ve been doing clojure for a year and i know some of the basics. FP is new to me and so far it’s damn good. i know there are some differences between clojure and clojurescript. thanks for the link!
Yeah, it’ll definitely shuffle your approach toward writing software even when you’re stuck coding in a non-FP language.
I'm not sure why or how it has been scientifically proven that it makes one more productive. I love the philosophy though
I don’t believe there are FP languages and non-FP languages. To me, FP is a style of programming.
Writing clojure for so long, when I’ve gone back to Java or Ruby, I take an entirely different approach to writing code than I had before.
sure, there are languages that are more conducive to FP
bostonaholic: which remind me last time i had to use #unshift in ruby, it was bugging my mind that there was not an equivalent method that did not return a new array. I ended up avoiding unshift and using something different so that it does not change in place
I dunno. Once I got a taste of FP with F#, it ‘infected’ how I coded C#. More Action<T>
and Func<T>
action, for example.
the pillars of FP (to me) are function purity and immutability
and those two can be followed in almost any language
@bostonaholic, yep. And I began writing data structures that were as immutable as I could make them in C#. And most of my methods returned new objects rather than modifying the one passed by reference.
well, javascript is a FP language IMO
(if you believe there are such things 😉 )
"I don’t believe there are FP languages and non-FP languages. To me, FP is a style of programming."
right, but for people that belive there are FP languages, javascript would classify as one
I’m not familiar with go
we’re a bit off-topic for #clojurescipt I think
@bostonaholic: yes in any language you can write functional code, the question is "is it idiomatic to write functional code in this language?"
agreed
I’m not suggesting that we write Java in 100% pure functions and no mutations
Gary Bernhardt has a great talk on “functional core, imperative shell” which describes a lot of what I’m talking about
also “Boundaries” https://www.destroyallsoftware.com/talks/boundaries
a language that is imperative first is going to have a gravity that pulls code in that direction, and the consequences are pretty obvious at this point
we could move some of this to #C1NTZQA5Q
hi gals/guys any idea how to increase the javascript heap size for clojurescript/node.js repl?
i am using leiningen btw to start it up, something like: rlwrap lein trampoline run -m clojure.main scripts/repl.clj
cljs.user=> (contains? js/undefined :foo)
false
cljs.user=> (contains? {:foo "bar"} :foo)
true
@peeja: how about (.hasOwnProperty obj "key")
?
@metametadata: Oh, yeah, good call! Thanks!
I’m having trouble figuring out how to get event handlers working for svg elements with reagent. I’m generating a group of circles in a for loop and attaching an on-mouse-over event to each one. I can’t seem to get this to work. The same event handler seems to work fine for other html elements so not sure what the problem is.
@peeja, @jr, @metametadata: depending on the use case, goog.object/containsKey
may be a better bit. it does a in
lookup. Doc for hasOwnProperty
is worth reading: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty
has figwheel changes behavior on which files to reload recently? seems to take much longer than before
@isak: What versions did you move from/to?
@shaun-mahood: figwheel-sidecar "0.5.2" -> "0.5.4-4"
but I also updated clojurescript and other dependencies, so it could be something else. just wondering if anyone else has noticed anything.
hi, is it possible to create react components to embed within an existing react javascript application?
[everything I have found seems to imply the opposite relationship-- i.e., using javascript components inside a clojurescript app]
@isak: 0.5.4 was a pretty massive release, but I followed pretty much the same type of upgrade and haven't noticed any issues. Based on the changes that were made I think it should have sped things up for recompilation, but I think there were a couple of edge cases discussed in #C0B22RS2Y that had some new options - probably worth asking in that channel and seeing if anyone else is seeing the same problem, I can't find the specific issues I'm thinking of in either the slack log or my memory.
@shaun-mahood: good to know, thanks
Hey y'all, it's been a long time since I've done front-end stuff, and I'm going back to it so I can build out a good-looking blog and show some of my work on it. So I'm not really going to be building an app, but it's not by any means going to be static either. What tools would you recommend to build something like this? I'm wont to avoid writing any raw HTML or CSS because they can't be manipulated well, and I'd prefer to compose CSS if possible rather than using inheritance.
I'm really keen on getting into Om in the future, but it seemed too heavy for something like this. Though, if anyone can attest otherwise, I'd definitely be interested in learning it for this. I'm just very unfamiliar with the ins and outs of the CLJS library ecosystem, so some recommendations for HTML/CSS augmenters would be great, along with advice on using basic JS for animations vs. a Clojurescript lib.
@montanonic: for a css alternative you might like this one: https://github.com/noprompt/garden
Indeed, thank you.
@montanonic: for the general app, you may want to check out some of these lein templates: https://www.google.com/#q=lein+template+clojurescript+garden
That's quite helpful. Thank you.
anyone used React’s on-paste
event handler? what’s the right syntax to retrieve the value?
upd: nvmd: figured that out (-> e .-clipboardData (.getData "Text"))
@johanatan: you want to create CLJS React-components that’d be used in js app?
it depends of what exactly you want - if you want something written in CLJS and then publish the resulting thing on npm - it’s one thing, if you want to use cljs in a javascript app, that something else
both are doable, for the second case I would probably create a few gulp tasks to manage cljs compilation
Also reagent seems to prefer lein/figwheel for compilation. Can that be made to work with gulp?
@johanatan: figwheel uses repl, for developing cljs components I would still use lein/figwheel. It’s hard to recommend something I’ve never done before, but I would probably just keep lein/figwheel and gulp task that consumes compiled javascript pieces running in parallel
What do you mean by the "running in parallel" bit tho? The project in question already uses web pack to pack together different bits of JS for each page if that's what you mean
@johanatan: so, you see feeding webpack output into CLJS (or I rather should say Google Closure compiler) pipeline is not very straightforward, whereas the opposite way (feeding output of CLJS compiler) into webpack is quite straightforward