Fork me on GitHub
#keechma
<
2016-03-23
>
roberto14:03:53

I’m planning on doing a demo for my co-workers

roberto14:03:59

enjoying it a lot so far

roberto14:03:13

the only sort of sore spot is that you need about 3 pieces before you start seeing something on the screen. I’m fine with it, but I can see how some of my co-workers would find that a bit intimidating

mihaelkonjevic14:03:43

yes, it's a pain I feel too. I'm not sure what is the solution though

roberto14:03:49

i was thinking of writing a script that generates some scaffolds

roberto14:03:55

but not sure how to start with that

mihaelkonjevic14:03:15

I was thinking about a template for leiningen

mihaelkonjevic14:03:24

but I don't want to handle that kind of complexity

mihaelkonjevic14:03:35

other option is something like yeoman generators

roberto14:03:49

yeah, I was thinking of something that I can run interactively on the shell

roberto14:03:27

for example:

(generate-component {:name “Person” :type “Form” :fields [“first-name” last-name”] :namespace “person”})

roberto14:03:54

or maybe not even specify the type nor fields

roberto14:03:16

just something that generates the controller, component and system with an h1 tag

roberto14:03:37

enough to get started and avoid having to manually create all those files

roberto14:03:23

also, from the example, this looked to me like something that can probably be included in the edb instead of having to write this for every project https://github.com/keechma/keechma-place-my-order/blob/66cd3138897f72f9e683dae2e562610c55cd8984/client/src/client/edb.cljs#L9-L44

mihaelkonjevic14:03:40

I think I'll make a macro that will generate those

mihaelkonjevic14:03:14

but I think that the macro should be in keechma because it assumes that entity db is stored under the :entity-db key of the map

roberto14:03:56

yeah, I agree

mihaelkonjevic14:03:57

router is also extracted and released as a separate lib

gadfly36117:03:10

@mihaelkonjevic @roberto maybe we could add a +keechma profile to reagent-figwheel (which is an existing leiningen template). It wouldnt handle scaffolding, but it would be a basic, working starting point for keechma. Anyways, just a thought

mihaelkonjevic17:03:08

@gadfly361: that would be awesome!

gadfly36117:03:52

Sweet! If you have any ideas about what youd want the minimal starting app to look like, let me know and i can work on adding the profile

roberto19:03:08

I think the basic wiring for each compoent, the system and a core.cljs that starts the app

roberto19:03:46

I’m not too fond of having dedicated controllers and components folders, but for scaffolding, it makes total sense.

gadfly36119:03:39

My default for a template is to have as few layers as possible to keep it feeling 'light' and approachable - so im in favor of not having dedicated folders. That said, when i actually make an application, i use folders ... so it is kinda hypocritical lol. In short, i can be swayed in either direction.

mihaelkonjevic19:03:04

I use folders for bigger apps

mihaelkonjevic19:03:31

but for scaffold, I think that would be overkill

roberto19:03:17

i think the folders helps new comers. I’m not fond of those, but when a newcomer sees a controllers folder and a components folder, they can understand that

roberto19:03:49

I personally would get rid of those as soon as I’m comfortable with the library, but it has always been helpful when I’m learning something new

mihaelkonjevic19:03:55

how do you group similar files? In one app I had components, controllers and entities folders

roberto19:03:05

I normally group them by what they do

roberto19:03:08

not by type

roberto19:03:24

for example, I would put a the navbar under a navbar folder

roberto19:03:39

and in there, it would hold a navbar_ctrl and navbar_comp and a navbar_system

roberto19:03:11

but right now, starting off with keechma, I find it easier to follow the structure in the examples

roberto19:03:14

baby steps simple_smile

mihaelkonjevic19:03:45

yeah, especially because I don't think there's always one to one mapping between controllers and components

roberto19:03:59

yeah, exactly, I found that out last night.

roberto19:03:01

it is a plus

gadfly36119:03:41

Would either of you be willing to create a barebones keechma app that you think would be a good starting point to come out of the template? If so, i can templatize that app and shove it into reagent-figwheel.

mihaelkonjevic19:03:01

maybe we could remove multiple actions and have just one button

roberto20:03:06

it doesn’t have an example with edb tho

gadfly36120:03:12

I think the counter is a good size for a starting point. The place my order example might scare people away.

gadfly36120:03:16

@roberto do you see a way to include edb, in a more hello-world kind of way? That would be best of both worlds. Also since edb is now its own lib .. would we want like a +keechma profile and then another that is +keechma-edb or something?

roberto20:03:54

sounds reasonable, I’m just trying to picture a scenario where someone would not use keehcma without edb

roberto20:03:24

but it does make sense to have 2 separate profiles, gives users the possibility to opt-in

roberto20:03:50

also a good starting point to learn, it just occurred to me that this could be something like nodeschool for learning keechma

roberto20:03:06

different templates take you through different levels of learning how to develop with keechma

gadfly36120:03:57

Ohh thats an interesting idea!

gadfly36120:03:55

I think the repo that has the tagged commits works well for that too - thinking of like the reagent phonecat example, where you can jump to any part in the tutorial. Regarding the 2 profiles, if you think 90+ % of keechma uses will use edb, then perhaps the single template (with edb) makes the most sense.

mihaelkonjevic20:03:59

edb might be an overkill for the starter pack

mihaelkonjevic20:03:12

it implies you handle some "data"

mihaelkonjevic20:03:47

but it's also true you're going to use it in 99% of apps

mihaelkonjevic20:03:10

so we're talking 4 files: core, 1 controller, 1 component, edb

mihaelkonjevic20:03:18

that doesn't sound too bad

gadfly36120:03:18

Since roberto brought up the learning aspect, how important is edb when you are first getting acquainted with keechma vs how much initial complexity does it add. If you can get started and learn without it ... and adding it say doubles the intial complexity, then i can see leaving it out as a good option. If it doesnt cause that much mentral strain or add a bigger barrier to entry then i can see including it.

roberto20:03:03

4 files sounds good, I would go a bit further tho, and add a file for a header and maybe a footer, just to illustrate how to make multiple components

mihaelkonjevic20:03:13

when you extract edb from the keechma, it's not mentioned anywhere in the code. it's clearly (more) separated from the rest

mihaelkonjevic20:03:58

+ it requires that you understand how to set it up with schema

mihaelkonjevic20:03:19

I'm somewhat conflicted about edb

roberto20:03:11

that is understandable, I think you are right, it should be separate, it does add some overhead to learning

roberto20:03:24

I still struggle with it a bit