Hi! Would you accept a pull request updating some of the dependency versions for keechma?
@urbank yes
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
Keechma still has 1.8 in the project.clj
@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
Nice 🙂 , I'm looking at pipelines and dataloader now.
@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
Aha, right. So they're more akin to action than subscriptions.
But here
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
Right. Threw me off a bit 🙂
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
The error occurs in the execute call here:
which clojurescript version?
is it the latest?
yeah 1.9.854
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