This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # adventofcode (1)
- # beginners (172)
- # boot (47)
- # cider (7)
- # cljs-dev (30)
- # cljsrn (43)
- # clojure (180)
- # clojure-dusseldorf (1)
- # clojure-greece (1)
- # clojure-italy (3)
- # clojure-russia (41)
- # clojure-spec (67)
- # clojure-uk (101)
- # clojurescript (128)
- # core-async (4)
- # cursive (13)
- # datomic (29)
- # devcards (5)
- # emacs (19)
- # events (1)
- # hoplon (38)
- # lein-figwheel (1)
- # luminus (8)
- # midje (1)
- # off-topic (47)
- # om (10)
- # onyx (23)
- # protorepl (1)
- # re-frame (11)
- # reagent (7)
- # ring (3)
- # ring-swagger (9)
- # rum (6)
- # sql (5)
- # untangled (4)
I have written a little bit of clojure but have almost no experience with clojurescript. I want to learn cljs by writing an admin tool for work. I’m finding the options to start out a little overwhelming: om, om.next, re-frame, hoplon, … Can I can some pointers on where to start? The app is a relatively simple admin tool (superseding a rails/underscore.js app), mostly searching for users and examining their data streams. There might be some minimal visualization in the future.
@dangit: I found re-frame to be a pretty easy entry point, but I think hoplon would be a great option as well- both have active and helpful channels on here. Rum with datascript would be a good choice as well, particularly if you are comfortable with Datomic. Om next might be a bit too much to learn at the start, but there are a quite a few people using and loving it.
@dangit may I suggest reagent? It will work well if you’re not building an SPA and doesn’t contain a lot of the complexity that exist in om
i rethink reagent has the shallowest learning curve if you’re already familiar with react
You could take a look at tourney-bot as a reference. Real-world application written in Rum: https://github.com/oakmac/tourney-bot
@bbloom re-frame tries to deliver architecture for medium sized apps and up. Sure, if you have a small, simple app you don't have much need for architecture. Any of the "V" generation libraries will be good to use: Reagent, OM, Rum or Quiescent. But there is a reason why Redux, cyclejs, the Elm Architecture, Pux, etc exist. As your app gets beyond trivial, you need architecture. I've been embedded daily in the Reagent world for 3 years now, and I relentlessly hear the following: "I started off with Reagent, which I love, but after 6 months I had created a bit of a mess". Every single time, what that person is actually saying is: "I started in Reagent without any sense of an Architecture and I grew one in an adhoc manner which ultimately wasn't pleasing". You can't not have an architecture as the app gets bigger - the only question is which one. Reagent (and the other V libraries) don't give you archecture. But, one way or another, you are going to be growing one. So please be careful about telling people that archecture is "a lot of stuff of arguable value". I've REPEATEDLY seen where that goes. If instead you want to suggest an alternative archecture, then I'll happily discuss re-frame at the level of "why this archetecture is better than that, or not". But if your goal is to simply dismiss the need for any architecture, I'd say that's poor advice. I'll be seeing that person across in #reagent in 6 months asking for advice.
@mikethompson I said that it’s of arguable value because we can clearly have an argument about it 😛 I’m not trying to shit on your work. My apologies if it seems that way. Overall, I feel re-frame has its head screwed on straight and wouldn’t argue vehemently against it other than in terms of ramp up time.
That said, I firmly believe that most of what re-frame provides is general in a way that isn’t useful for many applications; and that most of the benefits of re-frame can be accomplished via education rather than framework.
One last thought: I did read through the re-frame docs and various wiki-materials. Overall, it’s quite well written and the docs may be even more valuable than the code 😉
Don't worry about the shitting on the work thing .. each time that happens I generally learn something. So I'm always up for that.
for me, it’s about leverage - if i have to invest a bunch of time caring and feeding for a framework, i better be getting a lot of leverage. that means the product of value and occurrences of getting that value needs to be large
for most apps i’ve worked on, even decently large ones, i’d be able to count the number of stores, effects, co-effects, whatever, on one hand
But, and this is my main point, one way or another you are creating an archecture.
and so having someone design one for me is of lesser value than it may be for other folks
If your claim is that you like your architecture more and that re-frame is too much overhead, I understand. But be careful in your advice to others on this point. They may not grow the same architecture you do.
3) I believe #2 to be true, even if they are 100% guaranteed to show up in reagent in 6 months asking for help and/or moving to re-frame
Ha! Indeed, The ones who have suffered first tend to appreciate re-frame more, yes. They tend to be the most effusive in their praise. Which is always nice for an OSS person to hear.
not making a judgement about re-frame specifically, but many libraries should be blog posts … for example:
Hi, I’m trying to eval cljs code in cljs code, is there any way to get current compiler state (I need compiler state with current namespaces set), other than creating it with empty-state and manipulating it directly?
In general, pick a tool that solves the problems you currently have. If you're growing new problems from prior choices, and a new tool helps tackle those problems, migrate to / use the new tool. Pragmatism at its finest, and removes a lot of the issues that come from trying to get it right the first time, with some cost down the road for migration.
Hi, we’re seeing the warning "WARNING: :preloads should only be specified with :none optimizations” because we’re trying to use :preloads with :simple optimizations. Why is :preloads incompatible with optimizations?
The use case is that we have a test build. In the test build, we want to call
(enable-console-print!) as early as possible. We also were thinking that running tests at the same optimization level as our prod build might detect bugs related to optimization.
do you have a call to run-tests? presuambly you can just add the code you want right before that
We do, but we call it in a function that happens after all the code loads. The place we’re getting into trouble is that we print out some test information as the namespace is loading (regarding the value of some test configuration variables).
Sometimes that print works, because it happens to be the case that
(enable-console-print!) was called previously in another file. But if we say, rename a file, then the load order can possibly change, and suddenly println will error
maybe the better fix is to never call println during loading of namespaces - we could wrap that in a function and call that before run-tests
you can put the enable-console-print! in a test-init ns or whatever and require that first
it is a bit easier to remember “don’t call print on ns load” than “its ok to call print on ns load, but call enable-console-print right before!” 🙂
OK, maybe I need to back up one step then. How do I know which files will load first? If I have a.cljs and b.cljs in a test directory, and one calls
enable-console-print at ns load, and the other calls
println .... I’m not sure how to guarantee any order without a preload
hm, um, ok i’m not quite sure if that has any implications on this advice, but here goes:
> main ns to be that test runner namespace
Do you mean by using the
:main option? that was one thought I had, but it seems also to only work with
if you can’t use
:main, you can still just use goog.require from the outside or whatever you’re doing to call your entry point now
people are unlikely to agree to help before they know whether or not they can help at all 🙂
the docs for re-frame talk about waiting until early 2016 before it'll be supported on most browsers
From the docs for re-com: > the entire layout side of this library plus a few of the widgets rely on Flexbox which only works on modern browsers, and specifically not IE 9 and 10.
You will need to make your own assessment. We have the luxury of knowing our browser target
@kenrestivo even bootstrap is heading towards flexbox these days so it must be getting mainstream https://github.com/twbs/bootstrap/pull/21389 But, like I said, each to their own. For exaple, flexbox used to work slowly on firefox, but then it got fixed.
not a problem, but some projects are based on re-com so i'm trying to decide if i can follow them down that primrose path
@kenrestivo You got me curious. So I'm currently running the re-com demo program which obviously uses flexbox extensively on IE11 without any apparent problems. Everything works and performaance is fine. So the caniuse warnings about bugs may themselves be out of date. http://re-demo.s3-website-ap-southeast-2.amazonaws.com/
The best test is: http://re-demo.s3-website-ap-southeast-2.amazonaws.com/#/h-box
so my understanding so far with om.next is that IQuery pretty much makes my data-needs look like Datomic Pull syntax... There is a read-fn and a mutate-fn ... do I need to make many of these ? only if I want to mess with the atom that is my application-state, right?
Hi, I am trying to use ReactCSSTransitionGroup in my project following the guide of https://github.com/reagent-project/reagent-cookbook/tree/master/recipes/ReactCSSTransitionGroup . However, I am using
reagent v0.6.0 instead of
v0.5.1 , so I changed project dependencies to
[reagent "0.6.0" :exclusions [cljsjs/react]] [cljsjs/react-with-addons "15.4.0-0"] . But it shows
Uncaught Error: js/ReactDOM is missing. How can I fix this problem? Thanks!
you might also need a
(:require [cljsjs.react.dom]) if you require
@cmal before you go too far down that path, consider this blog post: http://www.upgradingdave.com/blog/posts/2016-12-17-permutation.html
We used to use
ReactCSSTransitionGroup but switched to
react-flip-move (recently) and loving it
Hi all, I see some advice on Stack Overflow here that one should use
(try ... (catch :default e ...)) in order to catch any error in ClojureScript. Does anyone have an official-ish reference for this?
@timgilbert can confirm that it is official-ish, don't know if written down anywhere though
Ok, yeah. I didn't see anything obvious in a superficial skim over the cljs source either
Is there a way to run some JS at compile time? e.g. I have some parsing I want done statically but the parsing library is written in JS.
@kenny you might be able to hack something together to do it, but I'd look at a clojure parsing solution instead. Unless you're replacing a specific binary parser, Instaparse will probably get what you want done https://github.com/Engelberg/instaparse
Something like that could work. I am looking into using nashorn. For some reason I can't find the lib on maven though..