keechma 2019-06-04

for my use case the loader function of a datasource feels like its requests parameter is inside out. I have to look inside a possible first request to get to the controller... I feel like a loader function will always pertain to a single end-point, or at the least that one could make a closure creating function to produce several loader functions of a same "type"

i'm sure this works for you, but i can't help but think an additional app-db parameter to the loader function would be helpfull

anyways, got it working as is, but it's a little bit hacky

this is for an eql endpoint in the background page of the extension

@carkh I’ve just released keechma-toolbox 0.1.24 that adds app-db as a third param to the loader fn

that's some crazy level of support =)

😁 1

works now with that new app-db, and i'll now be able to abstract the EQL stuff in a reusable namespace...Very nice

i didn't know about that second parameter

second parameter is the context - that is something you can set on the app level (in app-definition under the :context key). We use it when we have “singletons” in the app that need to be shared, for instance - Firebase connection, or if you’re using SSR, you could have different loaders - XHR loader for the web context and db loader for the server side context

you can also access it on the controller level - via (controller/context context) or as a third param in the pipelines -> (pipeline! [value app-db context])

ah ok i was wondering what the entry point was for that context param

so i could have used that and establish the required context for my connect controller in the same way you do in

yeah, that’s an option too

well i have it working now so we'll call it good enough !

btw, what are you building?

that's a chrome extension that's supposed to be the entry point to a range of services for a customer

i personally wouldn't do an extension, but yeah customers are what they are

i'll maybe put the learned knowledge to use in a tagged bookmarks extension, always wanted to have that and the current offering is subpar

i've been on the lookout for a web framework for cljs, have some experience with re-frame, but it's way too verbose and the jumping around drives me crazy.

fulcro looked nice but the abstraction is leaking all over the place

What does it mean?

@carkh How does it relates in the context of ClojureScript libraries, especially Fulcro?

ok, i really wanted to like fulcro. but there is much magic going on there

the abstraction is this : define queries for your components and it'll get all figured out for you

and the fulcro people have been building upon this

awesome tooling etc...

much nice things to be said about it all

but when you build an app with it, you start seeing places where you have to place dummy queries to make the machinery work

and it's not quite clear where and why

(to me at least)

have a look at union queries for instance

and routing built on top of that

i'd say that's accidental complexity, at the service of the abstraction

hence the leaking

i had hoped that fulcro had fixed some of the problems i percieved in om-next. again a very personal thing, maybe my brain isn't wired for that way of doing things.

and it did indeed fix some of those

but i feel there is much "complecting" going on there

i feel bad saying those things when the fulcro people have been so very friendly and helpfull

End of the day, I can confidently say that fulcro is well suited to make a successful app. you'll have to fiddle with those queries a little bit but it all works well enough

yeah, I started with re-frame too, but event based frameworks feel too much like GOTO programming

what i would really like is a fullly reactive thing like precept, but maintained and evolving... keechma looks like it strikes a good balance between features and down to earth results

I’ve used pub-sub in JavaScriptMVC some 10-ish years ago, and it was problematic then too, especially when you have defined order between event handlers. In my experience it’s much better to centralize logic (like with dataloader) and to keep components as pure as possible

in the end what we're doing is producing a dom, just building strings is what we did 10 years ago and that should be simple, understandable

another thing is - I’m a working in an agency setting, we can’t be to opinionated because each client has it’s own set of requirements, so Keechma is always developed in a way that is as general as possible. It does require some more glue code, but at least it’s open enough to implement anything

i'm ok with glue code, i'll do my own abstractions if need be. I like that i can understand what's going on (with your help)