Fork me on GitHub
#fulcro
<
2019-09-11
>
tony.kay03:09:20

Two more tutorials on YouTube (parts 10 and 11 uploading now) covering form input, and an intro to form state tracking. There are at least 2 more videos needed (4 total) to adequately cover form basics, but this is a start.

32
💯 12
😍 12
❤️ 4
gerred03:09:26

you're convincing me to check out fulcro 😉 (thanks!)

4
gerred03:09:08

(i say that committing now to watching every video)

Danny Almeida03:09:06

Thank you tony!! Cant' wait to watch them all:slightly_smiling_face:

💯 12
8
Vincent Cantin08:09:45

@tony.kay Right now, the dom tags used by Fulcro users are implemented either as a macro or as a function. Which of the two is used is open to potential misunderstandings. I propose the idea of exposing all the tag macros in an additional separate namespace, for the users who really care about using explicitly the macros instead of a function. For those macros, the (empty) props would have to be explicitly provided.

Vincent Cantin08:09:16

I am not sure if there would be a user need, however.

wilkerlucio11:09:03

@vincent.cantin the difference should not affect behavior in any way (except performance), the macro versions are just an optimization (if you don't have anything dynamic, it can delegate directly to the react functions with zero overhead at runtime). makes sense?

8
hoynk11:09:34

Hi, I am evaluating Fulcro for a project and have been happy with what I saw so far. One of the requirements is that we provide an API to the server and transit/eql is definetelly not an option. Is it possible to make Fulcro use a different protocol (maybe GraphQL)? Any other approaches? Is it just not the use case for Fulcro?

wilkerlucio11:09:30

hello, the requirement for the API, this is because you want to have external users to that as well, or is it something else?

hoynk11:09:14

It is a system that will mostly be called by the systems of our clients. Most of the traffic will come from them.

hoynk11:09:23

It is mostly B2B.

kszabo11:09:26

I would still use Pathom and implement a REST-like interface with it for customers

hoynk12:09:37

Having an API for the frontend and another for the customers?

kszabo12:09:29

yes, you generally want that distinction anyway

hoynk12:09:19

Why would I as, in this case, the functionalities are 90% the same?

kszabo12:09:29

It’s exactly that 10% difference which will grow over time as you add more features to your frontend, which is going to be meant to be private that will bite you

kszabo12:09:23

customers usually just want a static REST endpoint to code against and are not prepared for the dynamic nature of GraphQL/Pathom

kszabo12:09:54

but you can reap the benefits of that dynamism internally in your frontend code

kszabo12:09:55

what I’m trying to say is that it’s easier to tighten down a dynamic construct, than to do dynamic requirements with static ones

kszabo12:09:35

see n+1 query problems with REST APIs for frotends which is why Fulcro is using this data access pattern in the first place

wilkerlucio17:09:20

@UBEQ9K406 like @U08E8UGF7 said, exposing a REST API from pathom is quite trivial, the other direction takes more work

wilkerlucio17:09:06

you can use Fulcro with GraphQL as well via pathom (there are some integrations there), but unless you are really looking for having a GraphQL, the approach with most gain and less effort is Pathom for Fulcro, and exposing a REST from Pathom, IMO

hoynk17:09:04

How do I expose a REST API from Fulcro/Pathom?

wilkerlucio17:09:24

@UBEQ9K406 once you have the pathom resolvers in place, the implementation for each endpoint can be a pre defined query, something like:

(defroutes app
  (GET "/user/:id" []
    (let [data
          (parser {} [{[:user/id id]
                       [:user/id :user/name :user/email]}])]
      ; you can also do adapter to rename keys if you must, but if you just output
      ; json the names will remain and the namespaces will be stripped
      (get data [:user/id id])))
  (route/not-found "<h1>Page not found</h1>"))

lurodrigo14:09:53

Hi guys! Could someone help me? I'm trying to follow fulcro3 book, but I can't even get the first example to work. http://book.fulcrologic.com/fulcro3/#_create_your_project I have all the tools installed and created all files in the correct places, but when running npx shadow-cljs server and go to localhost:8000 it is empty; console says Failed to load resource: the server responded with a status of 404 (Not Found). In fact, resources/public/js folder doesn't even exist. shadow-cljs does not raise any warning or error, though

hoynk14:09:47

You need to open localhost:9630 and tell it to build :main.

lurodrigo14:09:03

that simple! hahaha it worked, thanks

tony.kay15:09:38

@me1036 Does the book not say that?

lurodrigo16:09:48

@tony.kay it says "You can start the compiler server with: navigate to the URL it prints out for the compiler server (usually http://localhost:9630). You can then use the "Builds" menu to turn on/off different client builds and see the progress live as it happens!". Since I am not familiar with shadow-cljs I assumed simply starting the server would do the trick and the "different builds" stuff was related to advanced/finer control tools

thheller16:09:33

you can just run shadow-cljs watch app instead of shadow-cljs server

thheller16:09:41

that will start the build and the server