fulcro

Book: http://book.fulcrologic.com, Community Resources: https://fulcro-community.github.io/, RAD book at http://book.fulcrologic.com/RAD.html
tony.kay 2020-09-23T00:13:33.000700Z

It’s meant for you to decide. I personally use CSS from the community (because I hate building that crap). fulcro-css is useful when writing things like libraries of components that might need to provide css, but you don’t want to conflict with what is already on the page (name wise at least) …whatever…use it if you find it useful 🙂

👍 1
Mr. Savy 2020-09-23T02:48:42.002700Z

I dunno what I'm doing wrong but example 1 from the book doesn't work since I upgraded the versioning. I don't want to downgrade since it's probably something dumb that I'm missing, but I have no idea what.

Mr. Savy 2020-09-23T02:51:21.002900Z

hmm, it's updating in inspect but not on the screen

2020-09-23T02:53:31.003100Z

where in the readme does it say that?

2020-09-23T02:53:40.003300Z

i just did a text search for 3000 and i didnt see it

2020-09-23T02:53:46.003500Z

shadow-cljs - HTTP server available at http://localhost:8081 shadow-cljs - server version: 2.8.110 running at http://localhost:9630 shadow-cljs - nREPL server started on port 9000 shadow-cljs - watching build :main

2020-09-23T02:54:58.003900Z

nothing on port 3000 both in the readme and on my actual localhost

2020-09-23T02:56:55.004200Z

ah ok. development/go was supposed to start the demo app. It didnt' for me. Execution error (NoSuchFileException) at sun.nio.fs.UnixException/translateToIOException (UnixException.java:92). /grow/data/fulcro-rad-demo/example/db.log user=> (clojure.core/require 'development) nil user=> (development/go) I 20-09-23 02:56:18 _rad.database-adapters.datomic-cloud:-238 - Starting database :main Execution error (NoSuchFileException) at sun.nio.fs.UnixException/translateToIOException (UnixException.java:92). /grow/data/fulcro-rad-demo/example/db.log I wasnt sure that error was rel event

2020-09-23T02:59:05.004500Z

something is looking for a file in the directory that i pointed the datomic dev-local tool at.

Mr. Savy 2020-09-23T04:08:57.004800Z

the num updates but the updated value isn't passed through the component I think? i'm still not really sure, I'll try again tomorrow.

Adrian Smith 2020-09-23T08:40:43.005300Z

did Fulcro get a new logo btw?

Björn Ebbinghaus 2020-09-23T10:54:59.006Z

:fulcro: for some time

tony.kay 2020-09-23T11:50:21.006900Z

Fulcro 3.3.4 is on Clojars. This version fixes a regression in some networking requests that was caused by a bugfix in EQL (v0.0.9->1.0.0)

tony.kay 2020-09-23T13:20:07.013100Z

Also, if anyone cares to comment on this: https://github.com/fulcrologic/fulcro/issues/400 I’d love to hear from you. Right now transit supports all of the built-in types and Fulcro tempids, but customizing types means you have to drop extensions in everywhere you use transit-related things (transit-clj->str, http-remote, websockets, etc.). With RAD, there is a further desire to be able to customize these centrally and more easily since a library author might want to provide fields/controls that use some custom type (e.g. #time/local-date). Being able to centrally define what data types you support and how they are encoded and decoded in all the various spots is becoming more and more important (RAD route parameters, for example, encode current control state in the URL for reports using Fulcro’s transit-clj->str followed by a base64 encode)

❤️ 1
tony.kay 2020-09-23T13:22:11.014500Z

I’m torn between a central registry (which would make it easier to cover all of the bases for you, but means you have to remember to install your things) and a non-side-effect implementation where you’d have to at least pass a config map to all of the things (which means you have to remember to pass that config at every call site)

tony.kay 2020-09-23T13:23:16.015600Z

The latter has the small advantage (from a purist design perspective) that two apps on a page could install different transit things and not conflict…but that should be really rare, and also fairly easy to fix if you control the source of at least one of the apps on the page.

tony.kay 2020-09-23T13:23:42.015900Z

I’d prefer comments on the issue ticket itself.

tony.kay 2020-09-23T15:50:24.020200Z

Fulcrologic (company) logo is diff than Fulcro’s…but related.

az 2020-09-23T18:14:07.026Z

Hi all, any thoughts on how to achieve the following? Computed props that are only calculated on the client that are derived from a nested structure. Goal is to calculate the cost of a product. The product has a nested material structure. Burrito −> Spicy Beans −> Cooked Beans −> Raw Beans Is there a way to show a view of the Burrito, say name and price, and if the cost of Raw Beans changes, it would propagate a change up to the top level? In my attempts with RAD, I see the derived field like total−sum* example, but I don’t see how I would deal with sub items under that to trigger a change. Example: a diff pushed in from remote update, that now invalidates and changes the derived data.

tony.kay 2020-09-23T20:25:12.026600Z

A component has the entire tree of props. In RAD, derived calculations would need to happen in the ultimate parent form (which can see everything). So the price of your burrito is just the sum of the prices of the children, which are all visible in the props of that top-level form.

tony.kay 2020-09-23T20:26:03.026800Z

so that example in the RAD demo is the way to go about it

tony.kay 2020-09-23T20:26:08.027Z

(if using RAD)

mruzekw 2020-09-23T20:29:26.027200Z

Would it be possible to grab the db atom and use an atom-based reactive graph lib to hold calculated values?

tony.kay 2020-09-23T20:29:42.027400Z

no

tony.kay 2020-09-23T20:30:00.027600Z

I’m working on a design for that kind of thing, but using the atom directly in UI will not work with rendering

mruzekw 2020-09-23T20:30:21.027800Z

Ah, good point, thanks

tony.kay 2020-09-23T20:30:33.028Z

But it is in my top 3 list of things to add to Fulcro 🙂

mruzekw 2020-09-23T20:30:45.028200Z

Woo! (imagine homer gif)

mruzekw 2020-09-23T20:33:17.028600Z

What are the other 2? Just curious

tony.kay 2020-09-23T20:33:31.028800Z

In this case, though, I still would not recommend it. A combination of a quick specter query and a sum gets you what you want…what could be more declarative than:

(let [prices (sp/select ... props)
      total (reduce + 0 prices)]
  ...)

tony.kay 2020-09-23T20:35:35.029Z

The list kind of changes continuously…I used “3” to generally rate where I think it lands in importance, but in terms of timeline, that could be quite different due to other things like free time etc. Fleshing out more of RAD is probably higher on the list ATM

tony.kay 2020-09-23T20:37:04.029200Z

so far the only place where I see it being really useful (dependent data calc fw of sorts) is in complex reports, where the data you got from the server needs some major work to fit the UI needs. Right now you just have to mutate it into shape, and re-run the mutation to update it.

tony.kay 2020-09-23T20:38:03.029400Z

but I just haven’t seen a design for that yet that I care for. Fulcro has tools that other libs don’t have, so leveraging the data normalization and query power could add a lot to the equation.

az 2020-09-23T21:18:16.029600Z

Thank you @tony.kay - If I’m rendering a burrito though, will a change in raw beans (3 levels down like I outlined, via websockets) trigger a new sum-total* call?

az 2020-09-23T21:19:52.029800Z

Lastly, would it be performant in your opinion in a situation when I have Burrito, composed of 15 sub components, and in term more sub components, basically a complex multi level bom system with cost - if I am recalcing on every change anywhere in the tree?

az 2020-09-23T21:21:01.030Z

Our current solution that I am porting over has each level of the BOM memoized so we only re calc impacted branches

tony.kay 2020-09-23T21:27:19.030200Z

1. A change 3 levels down will still be rendered from parent in RAD, so yes. 2. IMO, premature optimization. You’re memoizing something that might be composed of 100 gets and a sum? Js is fast these days. That prob takes like a few hundred microseconds. I’ve done filters of 8000 items in the UI without memoization on modern browsers and had it be fast enough.

az 2020-09-23T21:29:49.030400Z

Thank you @tony.kay, that’s great advice. You’re right. Will keep working to get it in. RAD is rad by the way. It feels magical and scares me, but it’s beautiful and I can’t believe how much it does across the whole stack.

👍 1