keechma

Keechma stack. Mention @U050986L9 or @U2J1PHYNM if you have any questions
carkh 2019-05-30T08:37:22.002Z

I'm trying to have a minimal keechma app starting but i get this repl/invoke error #error {:message "System must have a :main component!", :data {:type :keechma.ui-component/error}}

carkh 2019-05-30T08:38:24.002100Z

Here is the code

carkh 2019-05-30T08:39:37.002600Z

looks to me like there is a main component !

carkh 2019-05-30T09:17:54.003700Z

looks like i have to add the key-value {:router :memory} or some other to the app definition

carkh 2019-05-30T09:18:25.004300Z

which begs the question, what are the difference between hashchange, history and memory routers

mihaelkonjevic 2019-05-30T14:53:45.005200Z

hey @carkh easiest way to generate the minimal keechma app is to run lein new keechma name-of-app

mihaelkonjevic 2019-05-30T14:53:57.005500Z

this will generate a minimal structure you need to run it

mihaelkonjevic 2019-05-30T14:55:06.006900Z

as for the routers: - hashchange - binds to hash route (after # in the URL) - history - uses pushState and history API - replaces the whole URL - memory - uses in memory atom to store the route data - we use this one mostly in the mobile / react native context

mihaelkonjevic 2019-05-30T14:56:07.008Z

Keechma requires you to register the components in a map that you pass to the app when you start it - this map must have a component registered under the :main key

carkh 2019-05-30T14:56:44.008800Z

thanks @mihaelkonjevic

mihaelkonjevic 2019-05-30T14:56:47.009Z

I would also recommend you to check https://github.com/gothinkster/clojurescript-keechma-realworld-example-app

mihaelkonjevic 2019-05-30T14:57:08.009800Z

this app is built in “keechma” way, and you can compare it with other platforms

carkh 2019-05-30T14:57:19.010100Z

i've been perusing many of those example apps

carkh 2019-05-30T14:58:21.011Z

the minimal startup requirements seem a little bit fiddly though

carkh 2019-05-30T14:59:02.011700Z

for instance i had to remove the ui/system call around that map containing the main component

carkh 2019-05-30T14:59:38.012400Z

and the app definition had to have a :router key while i didn't see it anywhere in the example applications

carkh 2019-05-30T15:02:15.014400Z

see in the realworld app, there is no :router key again ><

mihaelkonjevic 2019-05-30T15:02:25.014700Z

ui/system is called internally on the map passed to the app definition

mihaelkonjevic 2019-05-30T15:02:40.015100Z

and I’m pretty sure that the :hashchange router is default

mihaelkonjevic 2019-05-30T15:04:02.016100Z

the one thing I see is that you don’t have a default route defined -> ["" {:status "all"}]

carkh 2019-05-30T15:04:13.016400Z

if i remove the router key, the whole page is made blank in the browser, and i need to refresh

carkh 2019-05-30T15:05:20.017100Z

ah let me check this default route thing

carkh 2019-05-30T15:06:07.017300Z

that was it !

carkh 2019-05-30T15:06:09.017500Z

thanks

mihaelkonjevic 2019-05-30T15:07:19.018500Z

also, you’re passing false to should-mount in app-state/start! call, this means that the app will have to be mounted manually to the dom element

carkh 2019-05-30T15:07:42.019Z

that was part of my tests, it's true right now

mihaelkonjevic 2019-05-30T15:07:48.019400Z

ah, ok

carkh 2019-05-30T15:08:07.019700Z

another question : when trying to develop using devcards or workspaces, I need to provide a full application

carkh 2019-05-30T15:08:20.020100Z

so i guess that would be the occasion to use that memory router ?

mihaelkonjevic 2019-05-30T15:09:56.021200Z

yeah, you could use it in that case, but keep in mind that your urls will stop working

carkh 2019-05-30T15:10:33.022100Z

ok

carkh 2019-05-30T15:10:41.022500Z

looks like that atom is global though

mihaelkonjevic 2019-05-30T15:10:44.022600Z

personally I’m rarely using devcards because I usually like to develop with server in place, so it makes sense to test the whole app (backend and frontend)

carkh 2019-05-30T15:11:14.023500Z

ok i was curious about your workflow, that answers it

mihaelkonjevic 2019-05-30T15:11:15.023600Z

I did use them for pure components (that only depend on their args)

carkh 2019-05-30T15:12:13.024300Z

ok one last question, but that's about a place where i'm not yet arrived

carkh 2019-05-30T15:12:35.024700Z

i can see parallels between fulcro and keeshma

carkh 2019-05-30T15:12:51.025200Z

the database mainly

carkh 2019-05-30T15:14:03.025900Z

there are parallels between your dataloader and pathom

carkh 2019-05-30T15:14:24.026400Z

i have a backend that uses pathom to provide an API

carkh 2019-05-30T15:14:45.026800Z

with EQL as the query language

carkh 2019-05-30T15:14:49.027Z

replacing graphql

carkh 2019-05-30T15:15:14.027600Z

do you think i'll be able to use your graphql examples to make use of that ?

carkh 2019-05-30T15:16:12.028200Z

or maybe do you already have some EQL loader hidden somewhere in keechma =)

mihaelkonjevic 2019-05-30T15:19:12.030500Z

I haven’t used EQL so far, so I don’t know 🙂. But, Keechma is built in a very generic way (mostly because we are using it in agency setting where we are not able to always control the backend), so you should be able to write EQL driver for that, the only thing that you need is to implement a loader that knows how to interpret params returned from the datasource’s params fn

carkh 2019-05-30T15:19:43.030800Z

allright that's what i thought, not a problem i think

mihaelkonjevic 2019-05-30T15:20:56.032100Z

We’ve used it successfully with REST, GraphQL, Contentful, Firebase and some other weird API backends, so I believe that EQL should be easy to implement

carkh 2019-05-30T15:21:25.032600Z

ok then, thanks for your kind answers, and your time

mihaelkonjevic 2019-05-30T15:21:47.033200Z

no problem, please mention me whenever you need help, because otherwise I check this channel once daily 🙂

carkh 2019-05-30T15:22:08.033600Z

i might do just that in the following week or two =)