Fork me on GitHub
#fulcro
<
2017-12-04
>
bunkers06:12:39

Apologies if this is a stupid/well documented question, but is it possible (and sensible) to use Fulcro just on the client side? How easy is it to change the communication to talk with a REST or GraphQL API? Or how hard would it be to produce the Datomic-like communication on the server using C# or PHP for example?

roklenarcic08:12:23

you can write your own networking implementation

roklenarcic08:12:00

@bunkers in https://github.com/fulcrologic/fulcro/blob/master/src/main/fulcro/client/network.cljc you have protocols you need to implement and the default implementation

roklenarcic08:12:13

IXhrIOCallbacks is not needed, you can use a different client

roklenarcic08:12:21

for doing actual http requests

bunkers10:12:22

Cool thanks! So it’s about creating a FulcroNetwork object, that does the work of reading and writing the transit? Might be easier for me to implement the server logic using transit. I’m just not sure how tricky that will be yet. I assume all the logic for paging and caching can be left on the client side?

wilkerlucio13:12:18

@bunkers still experimental, but I had success connecting fulcro with a GraphQL api directly

bunkers14:12:53

great thanks for that @wilkerlucio. Looks very useful! I can’t see that example though. Is it a private repo?

wilkerlucio15:12:38

@bunkers sorry, you are right, that repo is closed, I exported the relevant file in a gist here: https://gist.github.com/wilkerlucio/cda2bf4a3c4c05a0ffec49cdb1eed93b

bunkers15:12:15

brilliant, thanks very much!

wilkerlucio15:12:31

no problem 🙂

tony.kay16:12:01

@bunkers look at the GettingStarted.adoc in the repo…it has a simple REST example at the end

bunkers16:12:16

I knew must have missed something obvious like that, thanks!

tony.kay16:12:24

@bunkers but try it out full-stack with clojure/clojurescript as well..just to compare. I think you might find some compelling reasons to try to pursuade others to use clj on the back end 😉

tony.kay16:12:37

it makes things sooooo simple

bunkers16:12:58

Oh yeah I’m sold, but this is my kind of baby steps way of persuasion!

grzm19:12:43

There's a lot of great information at the fulcrologic site, and I find myself referencing it a lot, particularly as I'm getting into front end work again. Minor annoyance: https://fulcrologic.github.io 404s. The proper site is https://fulcrologic.github.io/fulcro/ Is the a reason the domain root doesn't redirect? Or that the site doesn't exist at the domain root?

tony.kay20:12:45

@grzm I had not noticed that….it’s a github pages thing…I’ll check into it. I own a domain name now, so I should just host the thing myself 😜

grzm20:12:57

Cool. I remember the same issue with the untangled site, fwiw 🙂

tony.kay20:12:15

I see. It’s because it’s under an org. The org has to have a website

grzm20:12:18

Yeah, I was just seeing that. Looks like you might just need a http://fulcrologic.github.io project?

tony.kay20:12:59

Yeah, I don’t see how to do it…but I can dedicate a domain name to it

tony.kay20:12:02

I’ll just do that

tony.kay20:12:40

worst case is ppl type in www, and get my consulting company 😉

grzm20:12:42

And look at there!

grzm20:12:14

Thanks 🙂

tony.kay20:12:27

thanks for letting me know it was annoying 🙂

grzm20:12:51

well, I've got plenty of feedback along those lines around software dev in general 😉

tony.kay20:12:38

I’m considering dropping the children argument to defsc. The CSS stuff is more important, I don’t like the arg shifting, and it is easy to use let and prim/children to get the children. This is a change for 2.0 that will possibly affect porting from 1.x. Anyone object??

mitchelkuijpers20:12:04

I agree :thumbsup:

tony.kay20:12:20

😕 broke links

grzm20:12:30

Looks like that's a common thing, due to the change.

tony.kay20:12:38

yeah, I’ll have to fix the website

tony.kay20:12:43

thanks for checking

grzm20:12:36

also the evaluation worksheet still references untangled. Is there a better place to note these things? I don't want to clog up the slack or look like all I'm doing is nit-picking

currentoor20:12:41

@tony.kay we haven’t used defsc yet, so this shouldn’t affect us right?

tony.kay21:12:12

nor would it likely have affected you

mitchelkuijpers21:12:06

BTW most of the time you won't even put children in a let but just put the call somewhere in the component. There is not a whole lot you can do with them