Fork me on GitHub
#fulcro
<
2018-01-11
>
macrobartfast02:01:39

how do you show docs for a symbol (like you do for defcard-fulcro in your second video tutorial) in cursive/intellij?

macrobartfast02:01:02

omg I just found it

tony.kay02:01:04

F2 I think…me personally, I use IdeaVIM, and it is SHIFT-K (in command mode)

macrobartfast02:01:29

oh, cool... ok, I hadn't found shift-k and that works well.

macrobartfast02:01:44

I use ideavim so right on.

tony.kay02:01:30

yeah, that is the normal vim shortcut for “looking up” something under the cursor

tony.kay02:01:36

like in a dictionary

macrobartfast02:01:40

I really don't know how you were able to create so much supporting information for fulcro.

macrobartfast02:01:58

I have absolutely no excuse for not succeeding with this framework.

tony.kay02:01:10

😄 It has taken years

tony.kay02:01:22

and a lot of refinement…and I’m still super critical of it

tony.kay02:01:50

I think it still sucks 😜 But at some point you have to say “good enough” and get other stuff done

macrobartfast02:01:50

ah ok... well, it's kinda mindblowing... like video tutorials? check. maybe you prefer a github readme... check. or a book? check. and so on and so on.

tony.kay02:01:20

the book covers about half of what I could say

tony.kay02:01:33

2 dozen more vids would be nice

tony.kay02:01:37

but its a start 🙂

macrobartfast02:01:42

yeah, videos are great.

macrobartfast02:01:56

at the same time, I feel like I need to improve my own skill at reading docs.

macrobartfast02:01:15

with text docs, I tend to go down rabbit holes of my own finding.

tony.kay02:01:16

active reading….do while you read…don’t just read

tony.kay02:01:21

yeah, but that’s good

macrobartfast02:01:41

videos are like park rides... you have to keep moving along.

tony.kay02:01:47

just learn to focus the rabbit hole energy to a limited step

macrobartfast02:01:17

I'll work on it. ;-D

bbktsk17:01:52

Hi all, is it possible somehow to inherit/share code between defsc components? Let’s say I have one complex entity with a lot of fields and I need two different ways of displaying it. If I create two independent defsc components, there’s going to be a lot of code duplication: args if I use destructuring, query, ident, initial-state, that’s going to be the same. The only difference is going to be the render code. Can I somehow avoid the code duplication? The only partial solution I see is to do (prim/get-query TheOtherVariant) in one of the variants, but that feels ugly and I think it can not be used to share args destructuring…

johnny18:01:20

You can use regular vars or functions for the query, ident, initial-state. It's not really inheritance but probably the easiest solution

bbktsk18:01:55

@johnny Yes, that’s what I meant, but that does not help with tens of fields I have to list in args destructuring.

tony.kay18:01:09

@bbktsk so, it shounds like you're wanting to render the same entity, but with different viewpoints?

tony.kay18:01:27

how about this: write it once, and use a computed prop through a factory to choose the UI?

tony.kay18:01:05

(defsc Person [this {:keys [person/name person/age person/spouse] :as props} {:keys [renderer] :as computed]
  ...
  (case renderer
    :view (render-person-view name age)
    :detail (render-person-detail props)
     ...))

(defn ui-person-view [props] ((prim/factory Person) (prim/computed {:renderer :view})))
(defn ui-person-detail [props] ((prim/factory Person) (prim/computed {:renderer :detail})))

bbktsk18:01:30

@tony.kay yes. Aha! That makes sense and it’s exactly what I needed! Thanks!

tony.kay18:01:03

If you need to use other computed data, of course you'll have to read/write that to propagate it in the factory

tony.kay18:01:23

should add that to the book ...

bbktsk18:01:28

Well, still need to repeast destructuring for args, but apart from that its pretty elegant.

tony.kay18:01:54

your render functions could take any number of args

bbktsk18:01:18

oooooh. Right!

johnny18:01:29

I've been trying out fulcro-sql to see if it fits my use-case. But I've found a few issues with it. Do you accept pullrequests on that repo, because in the process of debugging I manage to fix said issues.

tony.kay18:01:55

absolutely...not enough tiem to maintain everything myself 🙂

johnny18:01:10

Can imagine, cool. It will probably find your way over the weekend

tony.kay18:01:40

any doc fixes are great too...I know there are some errors in that repo

johnny18:01:58

Can't promise that 😛 English isn't my first language and not a great writer to begin with

johnny18:01:13

But i'll see what I can do either way

tony.kay18:01:38

no expectations 🙂 Just if you noticed anything technical. For a while it had an old way of making the components that didn't even work anymore.

tony.kay18:01:51

I just forgot to update the docs when I changed it

tony.kay18:01:47

There is also one glaring missing feature: queries of data on join tables. I know what I want to do for that, but won't be allocating time to do it anytime soon.

tony.kay18:01:25

so, if you end up with time and need it, I'd be glad to sketch out what I'm thinking would work, and help someone understand how to put it into place

johnny18:01:28

Yeah that's something I need aswell

johnny18:01:02

What I could use aswell, is some kind of post processing of attributes after it's fetched from the database

tony.kay18:01:32

yes, that is the other one: data coercion...had a discussion with someone on that recently...who was it???

johnny18:01:59

Haven't read that iam afraid

tony.kay18:01:06

might have been PM

tony.kay18:01:22

so yeah, more knobs are needed for sure, and I'm happy to get PRs to add them. For new features, I'd want to collaborate on them....so let me know when/if you have time

tony.kay18:01:46

new API always comes out better when more than one person designs them

johnny18:01:29

Oh definitely

johnny18:01:33

For data coercion a simple item in schema ::core/coercion. With key attribute and simple coercion function, might suffice

johnny18:01:09

Probably speaking to fast, because you need it two ways

tony.kay18:01:20

That’s why I’d prefer not to do it in isolation. just the research on what is out there takes time

tony.kay18:01:47

I’d prefer to leave a flex point if possible for that kind of thing. Make it pluggable.