Fork me on GitHub
#fulcro
<
2019-06-20
>
tony.kay00:06:20

3.0.0-alpha-9 is on clojars. I did the clojure-side implementation of components today and got SSR pretty much working.

👍 28
tony.kay00:06:50

also fixed a number of bugs. See changelog for details.

tony.kay00:06:06

I also switched to ghostwheel stubs for the production release, which should turn off the internal spec validation. If anyone hits snags with things not compiling let me know.

jduenas01:06:17

Hello lads, I'm just getting into fulcro and have a question regarding testing. I'm very used to clojure.spec but looking at fulcro-spec I don't really see the appeal :( Can someone please illustrate what am I missing regarding fulcro-spec? What's its best use?

tony.kay02:06:02

Fulcro spec was written before there was much in the way of clj(s) testing utilities. It has nothing to do with clojure.spec (it predates it)

tony.kay02:06:56

These days it is primarily handy for when you need mocking in tests, or would prefer a lightweight alternative to is that reads L->R

tony.kay02:06:07

The terminal reporter also prints a nicer diff

tony.kay02:06:37

I have not ported forward the cljs renderer, but it also had much nicer output…but I only have time to maintain so much ;/

jduenas02:06:59

Oh, I see. Thanks @tony.kay, and thanks for all the work you put into fulcro, it is truly amazing. Will be checking it further.

kingcode18:06:28

@ tony.kay Hello Tony, I am interested in exploring Fulcro, but just read on https://fulcro.fulcrologic.com/vsom-next.html that the only client-db choice is built-in as db format. Does this mean that using datascript is not possible, even for things not related to fulcro, e.g. app domain stuff? I doubt it, but wanted to check nonetheless…

currentoor18:06:18

fulcro itself uses it’s built in normalized db format

currentoor18:06:10

however you can use the pathom library to write data resolvers that pull data from datascript in the client (or server wherever your data is)

currentoor18:06:16

normally people write pathom resolvers in the client to pull data from a REST API, but you can pull data from anywhere

currentoor18:06:57

so you can use that to get data from any source into fulcro’s DB

currentoor18:06:08

however fulcro’s query engine will only look in it’s built in DB

currentoor18:06:11

does that make sense?

currentoor18:06:35

also the book has a lot more information

kingcode18:06:11

@U09FEH8GN So I wouldn’t be able to simply stuff my domain data in a datascript DB inside a regular atom accessible globally? But I would have to write the pathom resolver to do just that, correct? If so, once done can I use the full datascript API against my domain data?

currentoor18:06:03

you would have to write pathom resolvers as an intermediary between datascript and fulcro

currentoor18:06:15

fulcro cannot directly depend on datascript

currentoor18:06:54

might help to read some of the pathom docs

currentoor18:06:45

i believe Tony considered using datascript directly in fulcro a long time ago

currentoor18:06:58

but it was just way too slow for any sizable amount of data

☝️ 4
kingcode18:06:20

OK… sure that is a sure thing that fulcro can’t depend on ds, however for my domain data I would assume I can have my e.g. in-browser db the want I need it? Thx and sorry I didn’t read pathom, it looks a bit overwhelming for me right now 🙂

currentoor18:06:52

yeah it’s a lot to take in at once, totally understandable

kingcode18:06:54

It just seems to me that if I want to manipulate my Todo List, or Wedding Registry guest graph or whatever, I should be able to manipulate that within DS/Api right?

kingcode18:06:38

Thx for your comments

currentoor18:06:43

the key point is fulcro has a query engine and datastore built for satisfying queries from UI components, these are not configurable,

currentoor18:06:44

however you can write code to get data from any data source and fulcro can merge it into it’s state

kingcode18:06:53

That is totally expected that Fulcro needs the state DB for its own use according to its rules - but for the other stuff I wouldn’t expect to have to go through Fulcro?

kingcode18:06:02

Sounds good - thanks for your help!

currentoor18:06:17

happy to help

4
kingcode18:06:29

Thx - from reading your last post, once resolved correctly and inserted into Fulcro’s merged state, my DS db could be accessed (using Fulcro of course) and queried any way I want (including ds/api full query engine), right? Sorry for the add-on question 🙂

currentoor18:06:03

yes through pathom resolvers yes

currentoor18:06:34

i’m doing something just like that, except my resolvers are written in my server and the data source is datomic

currentoor18:06:22

i have another set of resolvers for a REST API and another set for nodeJS servers on embedded devices all in the same project

currentoor18:06:41

so there’s plenty of flexibility

kingcode19:06:21

cool…thx!