This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-01-13
Channels
- # admin-announcements (6)
- # beginners (51)
- # boot (164)
- # braid-chat (49)
- # cider (10)
- # clara (17)
- # cljs-dev (13)
- # cljsjs (51)
- # cljsrn (10)
- # clojars (42)
- # clojure (195)
- # clojure-bangladesh (102)
- # clojure-berlin (8)
- # clojure-canada (1)
- # clojure-chicago (19)
- # clojure-colombia (4)
- # clojure-denmark (6)
- # clojure-russia (15)
- # clojure-ukraine (7)
- # clojurescript (257)
- # code-reviews (10)
- # community-development (292)
- # core-async (13)
- # datomic (26)
- # dirac (4)
- # dunaj (5)
- # dysphemism (5)
- # events (21)
- # funcool (15)
- # hoplon (115)
- # instaparse (31)
- # ldnclj (15)
- # mori-fork (43)
- # mount (5)
- # off-topic (18)
- # om (195)
- # onyx (13)
- # proton (9)
- # re-frame (11)
- # reagent (44)
- # slack-help (14)
- # slackpocalypse (1)
- # spacemacs (10)
- # yada (23)
I have just released first alpha version of Dirac DevTools: https://github.com/binaryage/dirac still needs a lot of polishing and I still have to write tons of docs, but you can give it a try by following the demo instructions here: https://github.com/binaryage/dirac#a-demo-time thanks for testing! @jaen, tomorrow I will write down some instructions how this^ could be potentially used with boot
So, I'm just getting started with ClojureScript, but I quickly realized that maybe I don't need to delve into Om right away. I started by creating a static page with [magnars/stasis](https://github.com/magnars/stasis) + [weavejester/hiccup](https://github.com/weavejester/hiccup). When I want to add clojurescript to the equation, what's the best way to go about it? I was using figwheel
to help me out, but now I'm all confused and lost.
@jvtrigueros: welcome
if you don't fully understand that and are skipping ahead to Om you are going to struggle
Gotcha, thanks @meow! My biggest struggle was figuring out that leiningen
would do a lot for me. I come from a JS/Node.js background.
I've stuck to lein because most tutorials use lein. Is boot any better or just different?
lein uses declarative configuration, boot uses composable code. in a naive way, it's sort of akin to grunt vs gulp
Just curious, what do Clojurians used for frontend web development before any React wrapper existed.
angularjs and sadness
^ just speaking for myself
sadness 1.x tho. that sadness 2.x is crazypants
I believe Luminus used to use something other than Reagent in earlier versions http://www.luminusweb.net/
I don’t see Cognitect using something like luminous, wonder what they used, or still use
I've only been doing clojure/script for 8 months so I kind of got in right when the react wrapper stuff was in full bloom
Why did you start using Clojure? I know, silly question, I really like Clojure and try to talk everyone I know into it, but it still feels alien for lots of developers
python since 1999 and was burned out on python and was looking for something else and "functional" kept coming up
@jplaza: we do a lot of projects at Cognitect with a lot of different approaches
@alexmiller: hey!
after a couple of months with QML I wasn't happy so I looked again and this time tried clojure and the rest is history
overcoming my OO habits was hard but awesome people like @alexmiller helped a lot
i got into clojure when my team at the time chose storm for a project (really a set of projects) and i couldn't stand the thought of writing java. got buy-in from the team, had a ton of headaches, but few if any clojure-related. when it came time to start a green field frontend project, put clojurescript against typescript and a variety of javascript solutions, and clojurescript was a clear winner in terms of tooling, libraries, and development joy
@alexmiller: I’ve been following Pedestal since you guys launched it and back then it came with a pedestal-app part that was discontinued later. So, the need for something like that was evident.
also put clj(s) garden against sass and chose garden. it's been a total joy to work with
@meow: I’ve been doing Clojure for 2 years now and it’s been great. As you said, “functional” resounded. A friend told me about it and we started hacking away.. has been an amazing experience so far.
@jplaza: yes, we built several systems using pedestal-app before React. I think we've probably had projects using all of the React wrappers at one point or another.
@alexmiller: nice to hear you are continuously experimenting
@alexmiller: with all that time under your belt... do you have a clear personal preference?
@alexmiller: just curious - how many slack channels are you subscribed to
@eyelidlessness: to be clear, I didn't work on any of those - those are in the consulting team
@meow: re channels, don't know how to tell. re reactji - I don't know what that means.
@meow: not going to tempt the fates, but wait... is there actually a policy in place that says we can't use that word? are there other words specified?
I ought to know since I've been helping with #C0CB40N8K and copy/pasted the CoC but I don't know for sure
The use of profanity is heavily discouraged. Please refrain from using language that could be deemed inappropriate. We use this Google list of bad words as a guideline for inappropriate language. Participants using inappropriate language will be asked to edit messages when it happens.
Any use of profanity is just part of my show. I'm a reactji performance artist, and we tend to be rather edgy.
well i am dissapoint at that aspect of the CoC, but it's also respectably vague
@juhoteperi, @darwin, @martinklepsch, @jaen: thanks for your help yesterday, turns out I needed to bump Om to alpha 28 to get advanced optimizations to work.
so i've been hilariously working on a clojurescript implementation of alter-var-root
because i'd like to use it in a cljc file... i'm not sure if it's been omitted from cljs on principle or for other reasons. i have an implementation that works for my purposes (but surely has edge cases i haven't accounted for), and i'm curious how i should proceed with it
@dnolen: I have a question regarding CLJS wiki. Mike Fikes suggested I should document setup of remote nodejs repl. 1) Is it OK to edit wiki pages directly or the update should be sent to you for review? 2) Where would be appropriate place to document remote repl? "Quick Start", "Running REPLs" or new page?
@jvtrigueros: I'm probably a bit late, but https://github.com/magomimmo/modern-cljs/tree/master/doc/second-edition is probably the best introduction to how set up Clojurescript in a project. It uses boot though. Like eyelidlessness mentioned it's a bit like grunt vs. gulp in the node world - one is declarative configuration, other is scriptable builds. If your build starts to get more complex boot pulls ahead IMO. One of things where it starts being noticeble is using Clojurescript - my experience with lein-based Clojurescript tooling had been fiddly at best. boot-based though was a breeze. That said it's about a years since I've tried boot, so maybe lein tooling also improved.
@eyelidlessness: I suppose it had been omitted because it can't work at runtime in Clojurescript (no real vars), but unsure why would there exist something like it for the compilation phase. If what you wrote works, then that's neat
Looking at your code though I see you're doing set!
so you seem to be modifying things at runtime. Curious if it will have any side-effects.
@juhoteperi: yeah, that's him
@jaen: thanks for the kind word. I would add that with leiningen cljs is a kind of second class citizen, which depends on the fact that when leiningen has been created cljs was not even in Rich mind.
@skardan a Remote REPLs
page with a Node.js
section is welcome, other people can fill out the other cases as they develop.
Hi Everyone, could anyone recommend a good beginners tutorial for Clojurescript? Also - could anyone explain cursors to me in Om.. I've read the docs on it, but it's not quite clicking! As far as I can see, it's some data structure that contains the value and a path back into the global atom in the page?
@mrjaba: there’s an #C06DT2YSY channel though things are more focused on Om Next these days - if you’re just starting out with ClojureScript - I would avoid Om for a least a little bit - you’ll be drowning in novelty.
I'm up to the advanced tutorial at the moment.. somehow managed to skip the quick start! Oops Definitely feel like I'm drowning in novelty
This is also a good getting started resource https://github.com/magomimmo/modern-cljs/
I guess ClojureScript Unraveled is more about ClojureScript as a language and Modern CLJS covers more practical aspects like setting up a project, how to work with the DOM etc.pp.
anyone correct me if I'm wrong
Clojurescript Unraveled talks mostly about the language itself, relegating tooling to appendices mostly, while Modern Clojurescript gets you through a boot project setup and more practical aspects of doing Clojurescript (like certain libraries).
If you didn't have any experience with Clojure then probably doing 3rd chapter of Clojure Unraveled before Modern Clojurescript would make sense (and later returning for chapter 5 and the appendix about core.async).
If you had Clojure experience then Modern Clojurescript by itsefl should be enough. But that's just my viewpoint (and I'm biased towards boot), YMMV.
I've been working with Clojure for a little while now, so perhaps just modern cljs.. I'll take a look at both and see how I get on
Hi, is there anyone who successfully configured figwheel to open a file in Intellij on windows using
:figwheel {:open-file-command "open-in-intellij"}
?@jaen: (re your comments on my cljs alter-var-root
impl) yeah it just compiles to set!
calls, the rest uses details from the compile phase to resolve a symbol passed to the macro to its var (since set!
expects a var passed directly). it's pretty hacky and would break with any changes to the compiler implementation details it exploits, so i don't really know what to do with it
Would you recommend react or om, for a new web app that needs a good ux and needs to be able to adapt quickly?
I would recommend reagent over om.prev. It's certainly simpler to start out and if you need more complex, flux-like scaffolding then there is always re-frame.
But if you anticipate your application to get complex, require complex realtime synchronisation with the backend, being able to deal with network latency and flakiness then om.next is worth looking at. The way it's structured isn't as simple as reagent+re-frame, but is certainly powerful for more complex applications.
And also has awesome documentation, including those great reagent tutorials - https://github.com/Day8/re-frame/wiki#reagent-tutorials
@eyelidlessness: yeah, that doesn't seem like something the maintainership would be interested in supporting. But if it works for you, then neat!
OK, I have looked at om next, but can't use that now for a production app unfortunately, since it's only still alpha
Well, I've heard it's fairly solid even though it has the alpha tag. Kinda like reagent - it's still 0.6.0, but people are using it in production.
So if you feel it's additional complexity is worth it for the gains in your case I'd probably go with it, but I can understand why you would be uneasy to.
https://reagent-project.github.io/news/news050.html ctrl+F "Simple React integration" for a cursory overview.
I wonder why more devs don't use tonsky's Rum for React work? When I looked at his source code it struck me as quite elegant and reasonable. I know they are using it in production apps, but I don't see it get discussed much.
Well, I agree it's pretty cool, mixins seem like a great feature and it doesn't require pixie dust on atoms like reagent does, but probably not a lot people use it because they are fairly invested in the other two wrappers.
I wanted to try it once or twice when I had to write a university project, but in the end it was just faster for me to get reagent, re-frame and re-com ; d
https://partsbox.io/ and http://uxbox.github.io/ seem to be on rum as well.
It is also a bit more rigid wrt. atoms - you can only be reactive on atoms that you pass as arguments if I understand it correctly.
My original question was actually if you'd recommend writing a react app in js or cljs ;-)
I have used rum in Dirac: https://github.com/binaryage/dirac/blob/master/src/options/dirac/options/ui.cljs just a small thing, didn’t have a single problem with the lib will definitely consider using it in my future project
I went ahead and released cljs alter-var-root
, cos why not https://github.com/eyelidlessness/alter-cljs
@slotkenov: welp, my bad; I kind of assumed you've meant reagent not the JS-React '
ES6 is reputedly pretty okayish, but it is still an imperative, mutable, prototype-based language at heart, which brings it's own problems.
On the other hand Clojurescript avoids those being functional and immutable by default, but having nice mutable state control mechanism in atoms. It also has a really high power ratio - things that seemed like endeavours in Javascript seem pretty easy to accomplish by comparison in Clojurescript.
So if you're not afraid of having to write a lot of parens and sometimes less-than-comprehensible errors/stacktraces, I would probably suggest going with Clojurescript.
Thanks jaen! I certainly prefer Clojure, obviously . Only don’t have to much experience with it yet. And getting other developers with clojure experience, or willing to obtain it, is a hurdle as well. This makes the choice for Clojure less easy
If you scroll a bit above your questions there were some recommendations for Clojurescript tutorials. Could be helpful.
@slotkenov: I think the most important question here is whether you are already using Clojure on the backend
Also yeah, I can imagine Clojurescript being a harder sell due to lack of developers and while it is a really simple language (module warts, but what language doesn't have those), the difference of paradigms between functional and imperative, immutable and mutable can be daunting to programmers new to those concepts.
@dnolen There is no backend yet either. While we have a backend developer who will be developing in java. The frontend will be one project together with the rest services. Which means I could definitely write those rest services in clojure as well. That’s a win of course.
@slotkenov: if you already using Clojure on the backend then using ClojureScript on the frontend is kind of shoe-in
@slotkenov One tradeoff is that you might have to write libraries twice rather than just once.
Another is that you probably don't use edn as a serialization format, so your data structures don't map as nicely as they would with clojure v. clojurescript.
@slotkenov: I would say that the Clojure community has realized that this whole “backend and frontend are two distinct things” is just a bunch of bull
you are building a system - being able to share code and philosophy has immeasurable benefits for system design
The clojure design philosophy already stresses separating concerns by shipping data around and transforming it, doing it from front-end to back-end is a natural extension of that.
The problem would be having a java backend then; there is no java at the frontend. You would have the tradeoffs anyway
Coupling ClojureScript with rest services written in Clojure would make sense. And our backend would contain further isolated backend (micro) services (written in Java).
@martinklepsch: Regarding incremental dom, I've been having a bit of a play with building a reagent-like wrapper if you're interested - https://github.com/tommichaelis/inkle
@meow: I cannot tell, I have used it only once for a really simple page. I have yet to discover its shortcomings
Hmm, being able to easily share code and data between the backend and the fronted using - respectively - cljs and transit when writing both in Clojure is certainly a boon, but I don't think you loose all that much when doing only the frontend in Clojurescript. I had to write a frontend part of a university project where the backend guys wrote it in Groovy.
I was still pretty glad I could've used Clojurescript, reagent and such on the front rather than Javascript. I don't have anything against the language, but it just doesn't give you as much agility as Clojure does IMO.
One thing that was pretty annoying was dealing with JSON using Schema, but it turned out in a later project I was just doing reverse coercion wrong and it's workable.
if you already know ClojureScript very well - obviously you might develop a strong preference about any project that targets JS environment
@pandeiro: I haven’t seen any real evidence of that - but pretty impossible to draw a comparison
right nothing you can do about :advanced
except make sure you are giving the JVM more RAM on the build machine
that said it’s not clear that typescript or babel + whatever optimization settings you use actually uses significantly less RAM or time
@dnolen: right, just wanted to point out "diminishing very rapidly" sounds quite discouraging, while even using just Clojurescript is a productivity bonus over Javascript (considering similar skill level in both). I certainly do agree that having Clojure on the backend as well is even better though.
I would need to adopt something anyway. Be it ClojureScript, React, ES6, Elm or Angular2
I really like Clojure and the biggest hurdle, the paradigm shift to functional programming, I have already taken (at least at a theoretical level)
Elm has great type errors (something I wish Clojure had) but no typeclasses (ain't fun writing This.map
, That.map
instead of just a generic map
). Kind of a toss up. Also forces FRP on you, which while an interesting paradigm is yet another thing to learn.
As long as you start to be comfortable with functional programming there's not all that much to writing Clojure, relatively to - say - Haskell.
The hardest thing in Clojure for me was grokking component to be honest, rest was relatively straightforward.
Also this - https://github.com/binaryage/cljs-devtools - was a lifesaver; not sure if any other compile-to-JS language has something similar.
There is a library called component that lets you manage stateful objects (like database connections, queues, whatnot).
hmm, does anyone use the figwheel repl? i can’t seem to require any of my project or third party namespaces from it, only cljs.core ones
It's mostly used in backend development, though. Both component and it's alternatives like mount and bounce have Clojurescript versions, but for better or worse I don't see people using them as much for the frontend.
@jaen @slotkenov when looking at the library called component
, be sure to also check out mount
as an alternative
is it possible to load-namespace in a figwheel repl an ns that’s not in the dep tree for the currently loaded page?
however you can’t just add a dep to your project and expect to load that w/o restarting your REPL
wow, making http requests from a REPL in cursive and inspecting them in the Chrome dev tools is pretty great 😃
I'm working on our Karma test setup, and I notice a lot of ClojureScript Karma configs include a cljs_deps.js
file, but our CLJS build doesn't appear to output one. What's that file supposed to be?
Huh, I don't use :main
in my dev (`:none`) build, but I'm not seeing a cljs_deps.js
in the :output-dir
…
Is there a trick to using a library that has .cljx
files? lein
is saying No such namespace: automat.core, could not locate automat/core.cljs, automat/core.cljc, or Closure namespace "automat.core"
and automat
has .cljx
files
hmm... "cljsbuild crossovers are deprecated, and will be removed eventually. You should never use them. Please use either reader conditionals (available in Clojure >= 1.7.0-beta2 and ClojureScript >= 0.0-3255), or cljx to target both Clojure and ClojureScript from the same codebase" ... ah... "I am happy to announce that the reign of cljx is over: Clojure 1.7 brings us glorious Reader Conditionals (AKA .cljc files)" ... so perhaps automat
should be updated to use .cljc
files
ok, I have finished the first version of the installation docs for Dirac: https://github.com/binaryage/dirac testers welcome 😝
oh man, :parallel-build
cut my initial build time in half. this is awesome
@nonrecursive: sweet!