Fork me on GitHub
#keechma
<
2017-08-02
>
urbank10:08:31

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

mihaelkonjevic10:08:38

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

urbank11:08:19

@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

urbank11:08:12

Keechma still has 1.8 in the project.clj

mihaelkonjevic11:08:22

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

urbank12:08:48

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

mihaelkonjevic13:08:08

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

mihaelkonjevic13:08:52

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

mihaelkonjevic13:08:45

here’s an example:

mihaelkonjevic13:08:20

this controller updates window dimensions on window resize

mihaelkonjevic13:08:38

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

mihaelkonjevic13:08:32

but for user actions pipelines are my default

urbank13:08:43

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

mihaelkonjevic13:08:21

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

mihaelkonjevic13:08:10

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

urbank13:08:21

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

urbank13:08:53

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

mihaelkonjevic13:08:23

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

mihaelkonjevic13:08:58

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

mihaelkonjevic13:08:16

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

mihaelkonjevic13:08:20

you would use a controller

mihaelkonjevic13:08:36

so the responsibilities are separated

mihaelkonjevic13:08:53

nice thing is that they can easily work together

mihaelkonjevic13:08:40

here are the datasources for the realworld app

mihaelkonjevic13:08:42

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

mihaelkonjevic13:08:50

and user actions require the user to click something

urbank13:08:13

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

mihaelkonjevic13:08:54

yeah, on that line you expose the datasources as subscriptions

mihaelkonjevic13:08:05

because you still might want to have custom subscriptions

mihaelkonjevic13:08:18

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

mihaelkonjevic13:08:35

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

urbank13:08:12

Right. Threw me off a bit 🙂

mihaelkonjevic13:08:01

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

urbank15:08:22

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

urbank15:08:46

The error occurs in the execute call here:

mihaelkonjevic15:08:53

which clojurescript version?

mihaelkonjevic15:08:56

is it the latest?

urbank15:08:21

yeah 1.9.854

mihaelkonjevic15:08:37

yeah, my colleague told me about that yesterday

mihaelkonjevic15:08:41

I’ll take care of it today

mihaelkonjevic15:08:54

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

mihaelkonjevic15:08:04

let me see if I can fix it real quick

mihaelkonjevic15:08:08

and push the new version

mihaelkonjevic16:08:47

@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

urbank18:08:24

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

mihaelkonjevic19:08:17

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

mihaelkonjevic19:08:32

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

mihaelkonjevic19:08:45

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

mihaelkonjevic19:08:51

I’ll have to figure something out

urbank19:08:21

@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

mihaelkonjevic21:08:46

I'd like to update it if possible