Can we go with a 9? I don't want a matching stroke, and I'm doing the same for autogenerated forms
Thanks for the patches. published update book
This is a normal React pattern: callbacks, as @mroerni said. You don’t code a transaction for the parent’s data IN a child. That is a broken abstraction. You pass something like onClick
or onDelete
in computed props, and code the transact IN the parent.
https://book.fulcrologic.com/#_passing_callbacks_and_other_parent_computed_data
A parent MUST know something about children (because it lays them out, and gets thier props), but a child should not be explicitly coupled to knowledge of the parent. Technically passing this
does not break that abstraction, but as soon as you use it, I bet it does…because you’re going to do things like call mutations (parent-thing-delete)
(which can imply the type of parent, or introduce a type dependency)
There is a console error in the latest version of the RAD demo project.
ERROR [com.fulcrologic.fulcro.routing.dynamic-routing:188] - dr/target-ready! was called but there was no router waiting for the target listed: [:com.fulcrologic.rad.report/id :com.example.ui.account-forms/AccountList] This could mean you sent one ident, and indicated ready on another.
To reproduce, clone the repo, run yarn, start shadow, start datomic, navigate to the accounts page and hard refresh. Navigating via the links is fine. It’s when you use the URL directly. http://localhost:3000/accounts?_rp_=WyJeICJd&I know that this error doesn’t occur when using fulcro 3.4.1
Something has changed between that version and the latest version being used in the demo project.
@tony.kay any idea on what this could be or a pointer on where I should look for a fix?
actually I noticed that as well…have not had time to debug it. It was probably a bug all along and some performance improvement or something made the timing different, and is causing the route to get tried before initialzation is done
The message clearly says it tried to say a route was ready, but the state machine had not yet started….so it’s just timing
fun with async startup 🙂
My pleasure
@tony.kay could you be so very kind and elaborate a bit on this > Setting up an alternate build for creating sections of your application in isolation can be a real productivity boost. > from 3.11.2. Workspaces? Does it mean "Setting up an alternate workspaces build so that you can develop sections of your application in isolation can be a real productivity boost."? Thank you!
I just released Fulcro 3.4.7 to clojars. I found a place where I forgot to apply the new performance optimization for Inspect that was causing extreme performance penalties when actions in mutations worked with large data sets. It did not affect release builds, but it could make dev mode intolerable (it was, in fact, the whole motivation behind the revamp of Inspect). Basically the old inspect used to calculate a db diff on every opt action, and the new inspect does not need that…but I forgot to delete the line of code that calculated it 🤦
hmm, that's still happening, so I guess I have a different issue, it seems after each event in my uism's or rerender there is a clojure.data/diff call happening by fulcro.inspect that can take up to a couple seconds (I have around a 1000 entities in my state).
Hm maybe I missed another one. Caller from flame chart???
I don’t see anything in UISM…
yeah, I’m not seeing any other spots I missed. You sure you upgraded? Also, inspect will still ask for a diff, which will be calculated on the UI thread (though that is debounced in Inspect until things settle for a moment)…so it is intented to give you the perception of speed, when in fact it still has to at least build a diff at some point.
In my defense, the old inspect calculated it on every atom swap!
, which was way worse, but I forgot that optimistic actions had it as well.
Workspaces is the alternate build, yes. The idea is that Fulcro apps meant to be ultra-composable. Productions apps get large, and that can make longer and longer compile times (though incremental are usually good). Navigating through a prod app to your area of interest is also a pain. If you set up workspaces, you can run “narrowed-down” version of your application (narrowed down to a raw React element for style checking if you want, or a subsystem, etc.) This can allow you to focus on a particular task without having to “log in, click 4 nav links, play, realize you have to reload the browser tab for some reason, etc, etc.”
There are new versions of RAD and RAD Semantic UI on clojars as well. I’m working on adding official options to the SUI plugin so you can customize the render to some degree…of course you can always theme the CSS itself, but I wanted ppl to be able to tweak things like the table css classes, customize how the row actions look, etc. Docs are sparse, but if you use the source of SUI you can pretty easily see what’s changed: https://github.com/fulcrologic/fulcro-rad-semantic-ui/blob/develop/src/main/com/fulcrologic/rad/semantic_ui_options.cljc Just use that file as a starting point, and look for usages of those keys. I’ll be adding more support soon.
Thank you!
@tony.kay under https://book.fulcrologic.com/#Loading in the part "First, get rid of the application's initial state" init state is removed on all components but Root. Why? If a non-empty initial state is required it would be good to mention it there (and perhaps link to a section that goes into details, if it exists). Omitting initial state at the wrong place is a source of (new) developers' problems and confusion so it would helpful to fight it from start...
No no…we’re removing initial state on something that in reality would not have it, but would normally be loaded from a server…so it should neither be in state or on the screen.
It’s not “required”…it’s just a sane statement of an observation of the world…you cannot know, at compile time, what should actually be in many entities
Tony: the dev guide is really awesome, I cannot imagine how much hard work went and goes into it. Thanks a lot for it!
You’re welcome. Thanks for saying so. I wish I had more time to care for it…it’s a bit out of date in places and best practices aren’t really highlighted well enough (those have evolved since I wrote it). It’s still “correct”, but I think perhaps seeing things like UISM or hooks earlier now might be nice.
FWIW, I’m slowly working on an intro to fulcro blog post. Main goals are to get runnable, editable examples in the web version, and skip as much information as possible to get something basic on screen. Most of the detailed info would be referred to the official docs.
@stuartrexking that turned out to be a regression in dyn routing
Fulcro 3.4.8 is on Clojars. Found and fixed a regression with dynamic-routing that was causing route deferred to run before the route instruction was sent to the router.
Fulcro RAD, and RAD semantic UI updated. There is also an update to the RAD demo. • Added more customization options • Updated demo account list screen to show them off • Updated demo deps to get routing bug fix
@tony.kay thank you!
Thanks for pinging me on it…I had seen the error, but ignored it because I was doing something else…good to be reminded
@tony.kay Your dev guides, from the entangled to the current one, are half of my programming education. I can not thank you enough!! I worked through them multiple times. Of course, when you said that one needs to understand react I had to take a detour of some months because the react guide said I had to know js first. I would not have had any chance to wrap my non computer scientist mind around om next in a way to get it into production. For a beginner there are the clojure books, how to design programms, structure and interpratation of computer programms, FreeBSD Books and YouTube Videos. All that are very good fundamentals but how do you get from there to a furcro app in production? Not only how to get there but also how to find the way and not get lost. I could not have done that without you, your code, your manual and your guidance. Thank you again!!
The dev guide is what the name suggests. It is not a manual on how to use some software, even though it does that as well. It is a guide for developers, how to think about the problems and solutions. It talks about all the major aspects one needs to face in getting a SPA in front of users. It ranks as a textbook. It presents a path to follow from the setup to all that needs to be considered in a production system.
Thank you!!
Error in the book, @tony.kay? Under https://book.fulcrologic.com/#_lambda_query there is > . In lambda mode, `this` comes from the argument list of defsc. > which conflicts with > IMPORTANT NOTE: In lambda mode ident can use this and props from the defsc argument list. The other two are primarily *used "statically" and have no sane this o*r props. > under https://book.fulcrologic.com/#_options_lambda_vs_template
ah, yeah, feel free to send a PR…the docstring right in Fulcro itself?
Shout out to @pithyless for the very nice plug at 48:01 in https://youtu.be/UvJEBMOtayk?t=2881
Thanks for the shout out @tony.kay 🙂 I'm still happiest overall with the way my Datalog talk (https://www.youtube.com/watch?v=oo-7mN9WXTw) turned out, but any talk that helps get more people excited (cc @genekim 😄) is a win for our community.
PS. I've said it once, but I'll say it again.. @tony.kay and @wilkerlucio really did a wonderful job on Jacek's podcast. I really enjoy the kind of deep-dives and philosophical programming discussions you can get into on a multi-episode audio session.
🎉🎉🎉 @pithyless I’ve loved the three videos of yours that I watched — brilliant work!
(nice talk, BTW)
I’m sure you were meaning that about the whole graph ecosystem plus Fulcro, but it was nice to hear 🙂