Fork me on GitHub
#fulcro
<
2017-12-26
>
LL09:12:01

@tony.kay Can the defsc df/load the remote db in the :initial-state? I just want to fetch data as late as possible.

wilkerlucio12:12:47

@tpliliang what you mean by load remote in initial state? usually we do the load on the :started-callback

macrobartfast21:12:22

I want to be able to play with multiple client types (react native on various platforms, android and ios native, and unity)... is that going to be an issue with edn, and if so should I tweak my approach (a.k.a. following a REST style for the server, or graphql)?

tony.kay21:12:00

@macrobartfast I assume on all of those, since you’re implying Fulcro, that you’ll be using Clojurescript/Fulcro?

tony.kay21:12:15

and on the back-end?

macrobartfast21:12:31

that's what I'm unsure on...

macrobartfast21:12:38

I started with luminus...

tony.kay21:12:46

language/platform, I mean?

macrobartfast21:12:47

then wanted a more decoupled solution, so tried liberator...

macrobartfast21:12:54

oh, clojure, fo sho

tony.kay21:12:04

then EDN, fo sho 😉

macrobartfast21:12:56

I should just build out something along the lines of your getting started dealio, then worry about adding a different kind of client when I get that in place.

macrobartfast21:12:16

thrilled to find you here, btw...

macrobartfast21:12:25

went to untangled slack... crickets...

macrobartfast21:12:30

then read the banner at the top.

tony.kay21:12:22

Untangled had potential trademark issues I wanted to isolate us from

macrobartfast21:12:00

ah ok, well, I like fulcro more as a name 😉

tony.kay21:12:22

The rolling your own might be helpful. Glad you like the new name. I do too…took me a while to get the muscle memory adjusted

tony.kay21:12:28

kept wanting to type Untangled

tony.kay21:12:42

now I’m having the same problem with om vs prim

macrobartfast21:12:22

you need real-time string interpolation on your keyboard.

tony.kay21:12:26

If you get native working well, BTW, I’d love a guest blog post about it

macrobartfast21:12:51

been very shy about putting anything out there... so that'll be a good goal and catalyst for change.

tony.kay21:12:54

I have not had time, and am open to patches as well if we need them. Should work with little or no work

macrobartfast21:12:18

I'm ridiculous to even be thinking about all those clients at this point, with my skill level.

tony.kay21:12:21

I’m happy to edit text…I just don’t have time to fiddle with the code

macrobartfast21:12:37

I'll be lucky to get this all working.

tony.kay21:12:48

one at a time, my friend

macrobartfast21:12:35

one other question, if you have time...

macrobartfast21:12:29

I started wanting to make a slick react dashboard, using components and widgets from various sources online... where do things stand on being able to pull in an existing React component into cljs?

macrobartfast21:12:54

I ask because last week I decided I might be better off just coding my front-ends in straight js/react...

macrobartfast21:12:12

but then I became sad at the thought.

macrobartfast21:12:01

it's a dumb non-question, actually... disregard... I'll get through your getting started material and think about that again.

tony.kay21:12:25

@macrobartfast not a dumb question at all

macrobartfast21:12:32

the real problem was that I wanted to copy pasta react widgets for fun and profit.

macrobartfast21:12:58

and with clojurescript I'd have to, you know, think or something.

tony.kay21:12:24

using libraries of them is quite a good thing. I’ve had various levels of success. I’ve heard people saying that shadow-cljs does a better job with libraries than just using cljs with cljsbuild.

tony.kay21:12:10

The latest cljs compiler does better and even has node support where it will try to pull them in. But the JS landscape is soo FUBAR, that it is a hard task

tony.kay21:12:32

I made semantic-ui-wrappers on github…that’s a nice set of pre-written components

tony.kay21:12:43

it just wraps Semantic UI React.

tony.kay21:12:52

very very alpha (my wrappers), but a start.

macrobartfast21:12:14

actually, another programmer at a coffee shop tried cljs, then used elm (which I'm not getting into), and the elm story was beautiful in terms of his being able to slipstream elm right into the webpack pipeline.

macrobartfast21:12:16

but I'm not going the elm route, but it was an interesting case study in a js dev trying to work a better language into his workflow.

macrobartfast21:12:49

but there does seem to be a need to go all in on cljs... very hard to incrementally adopt it.

macrobartfast21:12:17

but I'm babbling... too many christmas treats... I'll start on the getting started material.

tony.kay21:12:48

cool. The new Developer’s Guide at http://book.fulcrologic.com is incomplete, but the Getting Started chapter has been integrated there.

macrobartfast21:12:13

you are a machine.

tony.kay21:12:18

I’m working more on that today and the next few days

tony.kay21:12:32

It’s a lot of stuff I’d aleady written….just in a better format I think

tony.kay21:12:02

this is the most tedious the docs have been for me. Editing is not my strong suit. I can spew new docs a mile a minute…but editing…oh god 😞

macrobartfast21:12:29

well, I'll put my editing hat on when I follow along.

wilkerlucio21:12:37

@tony.kay hello, I was starting to use hte new load :initialize, but I found a blocker, it can't initialise to-many relationships

wilkerlucio21:12:11

because it works by merging, and when we call the initial-state we don't know about the children, so I can't find a way to initialize those properly

wilkerlucio21:12:43

do you have any idea on how to initialise those?

tony.kay21:12:28

issue your load using load-action and initialize them before the load within your own mutation?

tony.kay21:12:22

To-many is a can of worms I don’t know how to solve.

tony.kay21:12:51

I’m not even sure how you’re going to solve it manually…you don’t have the IDs in order to initialize them.

tony.kay21:12:02

almost certainly needs to be a post-processing step instead

wilkerlucio21:12:17

my previous solution still works, but it's a different approach, it uses the query to navigate the result and initialise things

wilkerlucio21:12:39

but it has it's own problems too, there are some situations that it can't follow (can be fixed, but the algorithm is getting complex)

tony.kay21:12:06

well, it’s a new feature, so I guess we can try to evolve it a bit

tony.kay21:12:01

The solution at the moment is to pregenerate the intermediate target of the merge.

tony.kay21:12:26

we did that because the step in processing where you want to work is somewhat disconnected from the inputs of load I believe

wilkerlucio21:12:31

but that's tricky, you can't even know how many elements are coming, and the reverse merge would just ignore whatever you put there

tony.kay21:12:05

So, we normally do have the query. We just don’t have the options to tell us that initialize is set

tony.kay21:12:38

The easiest (but a bit ugly) is to augment the query with metadata, perhaps

tony.kay21:12:02

I’m working on docs. Open to suggestions, but I want to keep going on what I’m working on at the moment.

wilkerlucio21:12:05

well, if you are initializing we can just start doing recursively, kind of, need some experimenting

wilkerlucio21:12:14

I can look on that

wilkerlucio21:12:48

and the book is looking good, just flipped on it now 🙂

tony.kay21:12:08

yeah, I’m excited to get this all into a more usable form