Fork me on GitHub
#fulcro
<
2018-11-19
>
sooheon00:11:58

@currentoor Thanks for the in depth example. Both yours and the books examples seem to have the idents backwards, to my beginner’s eye. :tab is constant, the front bit seems to be the id, so I’d want to do [:TABS/by-id :ucv.ui.foo], to keep the tab definitions go inside a tidy table. Is the point of this to leave open to extension a different type of view than :tab for each ui component?

currentoor00:11:10

@sooheon you’re welcome simple_smile

currentoor00:11:25

so the problem with what you’re saying > to keep the tab definitions go inside a tidy table is this means all the tabs need to be similar, since they are all in the same table and they would need to all have a similar query structure

currentoor00:11:54

but they are very different, some have sub-routers, some have other sub-components

currentoor00:11:17

typically they are very different

sooheon00:11:17

Ah, that’s right!

currentoor00:11:03

that said, if you look at your app-state in the inspector, or the DB view in the book, you’ll see all these tab idents are neatly placed inside the router’s table

sooheon00:11:40

Weird though, I think my app has a :COMPONENT/by-id table with components that have very different shapes

currentoor00:11:40

:fulcro.client.routing/routing-tree

sooheon00:11:44

not sure how that’s currently working

currentoor00:11:10

in you app are actually calling it :COMPONENT/by-id?

sooheon00:11:19

I guess that only works while the initial-state is provided per component, but would break down with loads based on component class?

currentoor00:11:39

it should be something more specific like :account/by-id and :person/by-id

currentoor00:11:09

i’m guessing you’ve used SQL databases before right?

currentoor00:11:35

it’s just like that, you want to store separate models in separate tables

currentoor00:11:46

rather than have one giant table for all your schema

currentoor00:11:07

think of :account/by-id as the name of a table

currentoor00:11:39

in fact you could totally called it :accounts or :account/table

sooheon00:11:40

mhm.. I still need to adjust from nested-hashmaps thinking => normalized db

currentoor00:11:17

normalized db is the default DB, like SQL, that everyone uses on the backend all the time without batting an eye

currentoor00:11:29

except people aren’t used to using it on the frontend 😅

sooheon00:11:50

yeah, the ease of hashmaps just hooked a lot of people, I think

currentoor00:11:02

even though it has a lot of the same benefits

currentoor00:11:35

yeah exactly they’re easy, until you have more than one view of some piece of data

currentoor00:11:52

then you have to do backflips to keep your data consistent

tony.kay00:11:13

@currentoor @sooheon So, the ident order. I regularly use :COMPONENT/by-id for singleton components, and @sooheon you are right the router ones “look” backwards. I’d prefer they all go in the same table as well if they are singletons, but unfortunately the real issue has to do with union queries. The router component in Fulcro is more about optimization that routing to be honest. You want a union query to ensure the query stays fast, but unions SWITCH on the FIRST component of the ident..thus, THAT is the part that has to vary,

tony.kay00:11:22

which is where I show you how that router is basically derived

sooheon00:11:52

ah no wonder I didn’t get this, I haven’t understood unions yet

currentoor00:11:23

hmm interesting, i always thought of tables as database tables, but yeah i suppose you could put all singletons in one table

tony.kay01:11:38

yeah, the routers work the way they do to optimize the query…and that is the primary reason I added defrouter…it is the most optimal way to switch UI while optimizing query overhead

tony.kay01:11:35

either that or dynamic queries (which would support it the other way around), but the Om Next code (when we were using Om Next) for dynamic queries isn’t quite fully fleshed out. I’ve since fixed that in Fulcro, but dynamic queries are relatively untested compared to the rest of the system.

nha22:11:19

Just curious: anyone using fulcro with a yada backend?

Ahmed Hassan04:11:27

I too am curious about it. Because Pedestal is also an option to use.

claudiu06:11:48

@nha Is Yada for classic rest-full like apis ?

claudiu07:11:42

Looks like you have to create an alternate network and use pathom for a nice integration http://book.fulcrologic.com/#_a_rest_example

nha09:11:18

looks like passing the sente aleph adapter for websockets is necessary. There is no such thing for pedestal. And reimplementing the ring middlewares as yada interceptors. I don’t think that’s a lot of work

nha09:11:42

making it REST is another option, although more work and with little benefits. Maybe that would be the way to go for pedestal since there is no sente adapter.

geraldodev23:11:44

Hi, coming back to cljs after a long hiatus. Getting to know fulcro. (I've used om.next a little when it was starting). Trying to understand the fulcro template. One question: What is the benefit of shadow-cljs.edn integration with leininingen since the :cljs config there is so small ?

wilkerlucio23:11:59

hello geraldo, shadow has very nice tooling, the compilation is faster than the alternatives and it has the big plus that you can actually use npm libs directly, no other cljs build tool does that as well today

geraldodev23:11:15

@U066U8JQJ but the opposite. what is the gain of leiningen integration ?

wilkerlucio23:11:53

ah, with lein, not much, to me today lein is only useful to build jars, I avoid it when I can

geraldodev23:11:44

That's the point. I've tried tools.dep without lein and got stuck on a tools.dep nrepl client. So It looks like repl-y is the thing that forces me to stay with lein. So I've started to study fulcro. That uses lein. But the repl that shadow-cljs brings does not have the tab expansion repl-y has. So I assume it's different. That leads to the question what does leiningen brings to the table ?

geraldodev23:11:29

If nothing I tend use shadow-cljs with tools.dep and let lein out of it.

tony.kay23:11:05

@U0516053R The main benefit is the depstar doesn’t do a great uberjar yet…not AOT or manifest

tony.kay23:11:11

that is about all I have it around for

tony.kay23:11:02

I personally also use a couple of other lein plugins that don’t have equivalents, but a pure tools.deps project is fine…

tony.kay23:11:37

I’d make it an option of the lein template, but I don’t have time to write it, test it, etc.

geraldodev00:11:05

@U0CKQ19AQ does some of the benefits you've enlisted relates directly with cljs?

tony.kay00:11:00

You mean what I use lein for

tony.kay00:11:04

no…clj only

tony.kay00:11:18

shadow and deps is very much sufficient for cljs only

geraldodev00:11:42

that's very nice to hear

tony.kay00:11:43

I’m trying to make time to port the projects all to deps…but deps is all still alpha, no windows support…so still not necessarily the best idea to have deps in the template yet 😜

tony.kay00:11:24

I’m under the (probably false) impression that no devs use windows 😄

geraldodev00:11:09

devs use windows. pedestal is linux compatible. it's wise to be compatible with windows since, fulcro's stack uses ring.

geraldodev00:11:29

at work we are stuck with windows 32 bits

geraldodev00:11:24

I use ubuntu but cant teach them cljs because lumo does not have 32 bits 😞 . I've got very impressed by the speed it boots.

thheller09:11:46

@U0CKQ19AQ I'm on Windows 😉

😂 4
tony.kay23:11:58

@nha FYI there are two versions of websockets.

tony.kay23:11:29

you’re looking at the old one