This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-08-02
Channels
- # beginners (118)
- # boot (73)
- # cider (2)
- # cljs-dev (65)
- # cljsrn (18)
- # clojure (49)
- # clojure-argentina (4)
- # clojure-italy (19)
- # clojure-portugal (1)
- # clojure-russia (1)
- # clojure-spec (34)
- # clojure-uk (102)
- # clojurescript (202)
- # code-reviews (3)
- # core-async (5)
- # cursive (11)
- # datomic (25)
- # emacs (1)
- # graphql (22)
- # hoplon (6)
- # keechma (59)
- # leiningen (10)
- # luminus (31)
- # lumo (78)
- # off-topic (141)
- # om (32)
- # om-next (2)
- # onyx (6)
- # parinfer (55)
- # pedestal (3)
- # protorepl (3)
- # re-frame (8)
- # reagent (8)
- # ring-swagger (1)
- # rum (20)
- # specter (1)
- # sql (5)
- # test-check (11)
- # vim (13)
- # yada (7)
Hi! Would you accept a pull request updating some of the dependency versions for keechma?
also, I was planning on testing with the latest clojurescript version this week
@mihaelkonjevic So it seems to work with [cljsjs/react-with-addons "15.6.1-0"]
but only if you also have [cljsjs/react-dom "15.6.1-1"]
, otherwise ReactDOM is not defined.
Also, not sure which of the dependencies provides core.async
. I had some problems with that one when going from clojure 1.8 to 1.9. It needed to be 0.3.443
@urbank ok, I’ll check all of that today
@mihaelkonjevic Do you use pipelines to handle actions that don't make requests to the server as well?
@urbank I use pipelines for 95% of actions in my apps
I use normal controllers only when I have to implement some kind of “long running” processes
which is rare
here’s an example:
this controller updates window dimensions on window resize
it makes sense to use a normal controller because it has an event listener
but for user actions pipelines are my default
@mihaelkonjevic Ah, cool, makes sense, thanks! I was confused because I assumed pipelines were solely a solution for async requests.
also after we introduced dataloader, number of our controllers dropped significantly
I have a pre - dataloader project and I think I could remove 80% - 90% of the controller code if we used dataloader there
@mihaelkonjevic Similar question for dataloader: Dataloader is only for fetching data from non-app-db sources, correct? For example, to get the data of a todo item, you'd still just have a reaction after loading the todos?
dataloader’s purpose is to put the data in app-db
so if you need to load some data to render the UI (based on the route) you would use the dataloader
if you want to add data to app-db based on user action (like adding a todo)
you would use a controller
so the responsibilities are separated
nice thing is that they can easily work together
here are the datasources for the realworld app
and here are user actions https://github.com/gothinkster/clojurescript-keechma-realworld-example-app/blob/master/src/cljs/realworld/controllers/user_actions.cljs
both will affect the data in app-db, but dataloader is triggered on each route change
and user actions require the user to click something
yeah, on that line you expose the datasources as subscriptions
because you still might want to have custom subscriptions
maybe do some filtering on the client side based on some other data in app-db
but make-subscriptions
will create default subscriptions based on the datasources
for each datasource you get two default subscriptions - data and meta
this allows you to check the state of the datasource https://github.com/keechma/realworld-starter-kit/blob/master/src/cljs/realworld/ui/components/articles.cljs#L46
Hm, so I'm getting errors when trying to start an app with two more or less dummy controllers. One is a pipeline controller and the other a dataloader controller. I'll paste the minimal code
which clojurescript version?
is it the latest?
yeah, my colleague told me about that yesterday
I’ll take care of it today
it seems that new version is a bit stricter, and I have a bug somewhere
let me see if I can fix it real quick
and push the new version
@urbank the whole upgrade to latest react and clojurescript versions seems to be more complicated than anticipated. Can you use the older version of clojurescript, and I’ll try to figure it out this week
@mihaelkonjevic I was away doing maintenance. Yeah, sure, no problem 🙂 Curious what broke though. Did clojurescript become stricter about arities?
that seems to be one problem, although the code looks right
another problem is that I’m using a package for testing that is not yet updated to latest react
and react moved test utils to a different namespace so I’m not able to run tests
I’ll have to figure something out
@mihaelkonjevic cljs-react-test
? Is the plan to replace it, or update it to use the new namespace? Let me know if there's anything I can do to try to help
I'd like to update it if possible