keechma

Keechma stack. Mention @U050986L9 or @U2J1PHYNM if you have any questions
urbank 2017-08-02T10:29:31.678248Z

Hi! Would you accept a pull request updating some of the dependency versions for keechma?

mihaelkonjevic 2017-08-02T10:50:10.062731Z

@urbank yes

mihaelkonjevic 2017-08-02T10:50:38.071538Z

also, I was planning on testing with the latest clojurescript version this week

urbank 2017-08-02T11:21:19.623817Z

@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 2017-08-02T11:22:12.639109Z

Keechma still has 1.8 in the project.clj

mihaelkonjevic 2017-08-02T11:53:22.204093Z

@urbank ok, I’ll check all of that today

urbank 2017-08-02T12:54:48.587103Z

@mihaelkonjevic Do you use pipelines to handle actions that don't make requests to the server as well?

mihaelkonjevic 2017-08-02T13:03:08.826363Z

@urbank I use pipelines for 95% of actions in my apps

mihaelkonjevic 2017-08-02T13:03:52.848016Z

I use normal controllers only when I have to implement some kind of “long running” processes

mihaelkonjevic 2017-08-02T13:04:03.853451Z

which is rare

mihaelkonjevic 2017-08-02T13:04:45.873952Z

here’s an example:

mihaelkonjevic 2017-08-02T13:05:20.891376Z

this controller updates window dimensions on window resize

mihaelkonjevic 2017-08-02T13:05:38.900579Z

it makes sense to use a normal controller because it has an event listener

mihaelkonjevic 2017-08-02T13:06:32.926772Z

but for user actions pipelines are my default

urbank 2017-08-02T13:08:43.991082Z

@mihaelkonjevic Ah, cool, makes sense, thanks! I was confused because I assumed pipelines were solely a solution for async requests.

mihaelkonjevic 2017-08-02T13:09:21.009900Z

also after we introduced dataloader, number of our controllers dropped significantly

mihaelkonjevic 2017-08-02T13:10:10.033624Z

I have a pre - dataloader project and I think I could remove 80% - 90% of the controller code if we used dataloader there

urbank 2017-08-02T13:11:21.068995Z

Nice 🙂 , I'm looking at pipelines and dataloader now.

urbank 2017-08-02T13:35:53.858021Z

@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?

mihaelkonjevic 2017-08-02T13:36:23.875220Z

dataloader’s purpose is to put the data in app-db

mihaelkonjevic 2017-08-02T13:36:58.894589Z

so if you need to load some data to render the UI (based on the route) you would use the dataloader

mihaelkonjevic 2017-08-02T13:37:16.905279Z

if you want to add data to app-db based on user action (like adding a todo)

mihaelkonjevic 2017-08-02T13:37:20.907664Z

you would use a controller

mihaelkonjevic 2017-08-02T13:37:36.917025Z

so the responsibilities are separated

mihaelkonjevic 2017-08-02T13:37:53.926693Z

nice thing is that they can easily work together

mihaelkonjevic 2017-08-02T13:38:40.953479Z

here are the datasources for the realworld app

mihaelkonjevic 2017-08-02T13:39:42.988120Z

both will affect the data in app-db, but dataloader is triggered on each route change

mihaelkonjevic 2017-08-02T13:39:50.992986Z

and user actions require the user to click something

urbank 2017-08-02T13:41:13.040165Z

Aha, right. So they're more akin to action than subscriptions.

urbank 2017-08-02T13:41:16.042266Z

But here

mihaelkonjevic 2017-08-02T13:41:54.063787Z

yeah, on that line you expose the datasources as subscriptions

mihaelkonjevic 2017-08-02T13:42:05.070469Z

because you still might want to have custom subscriptions

mihaelkonjevic 2017-08-02T13:42:18.077723Z

maybe do some filtering on the client side based on some other data in app-db

mihaelkonjevic 2017-08-02T13:42:35.087619Z

but make-subscriptions will create default subscriptions based on the datasources

urbank 2017-08-02T13:43:12.108417Z

Right. Threw me off a bit 🙂

mihaelkonjevic 2017-08-02T13:45:01.173747Z

for each datasource you get two default subscriptions - data and meta

mihaelkonjevic 2017-08-02T13:45:39.197093Z

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

urbank 2017-08-02T15:03:22.228913Z

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

urbank 2017-08-02T15:05:46.328738Z

The error occurs in the execute call here:

mihaelkonjevic 2017-08-02T15:05:53.333612Z

which clojurescript version?

mihaelkonjevic 2017-08-02T15:05:56.335719Z

is it the latest?

urbank 2017-08-02T15:06:21.352734Z

yeah 1.9.854

mihaelkonjevic 2017-08-02T15:06:37.363105Z

yeah, my colleague told me about that yesterday

mihaelkonjevic 2017-08-02T15:06:41.366294Z

I’ll take care of it today

mihaelkonjevic 2017-08-02T15:06:54.374854Z

it seems that new version is a bit stricter, and I have a bug somewhere

mihaelkonjevic 2017-08-02T15:07:04.381635Z

let me see if I can fix it real quick

mihaelkonjevic 2017-08-02T15:07:08.383417Z

and push the new version

mihaelkonjevic 2017-08-02T16:48:47.279218Z

@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

urbank 2017-08-02T18:53:24.735255Z

@mihaelkonjevic I was away doing maintenance. Yeah, sure, no problem 🙂 Curious what broke though. Did clojurescript become stricter about arities?

mihaelkonjevic 2017-08-02T19:20:17.646432Z

that seems to be one problem, although the code looks right

mihaelkonjevic 2017-08-02T19:20:32.654532Z

another problem is that I’m using a package for testing that is not yet updated to latest react

mihaelkonjevic 2017-08-02T19:20:45.661566Z

and react moved test utils to a different namespace so I’m not able to run tests

mihaelkonjevic 2017-08-02T19:20:51.664720Z

I’ll have to figure something out

urbank 2017-08-02T19:41:21.325062Z

@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

mihaelkonjevic 2017-08-02T21:30:46.767972Z

I'd like to update it if possible