fulcro

Book: http://book.fulcrologic.com, Community Resources: https://fulcro-community.github.io/, RAD book at http://book.fulcrologic.com/RAD.html
JAtkins 2020-12-17T00:26:06.062600Z

FWIW I can see this when running your demo

JAtkins 2020-12-17T00:26:14.062800Z

tony.kay 2020-12-17T01:02:33.063200Z

isn’t that pretty much what the chapter intro says? https://book.fulcrologic.com/#FormState

tony.kay 2020-12-17T01:23:42.063400Z

I pushed a minor edit, hopefully that is better

JAtkins 2020-12-17T01:27:59.063600Z

Cool. Yeah, that section by itself is confusing since realistically how often do you look at form-state with the intent to use it without form-state support? Default position would be "add form state config," but "you can skip if you want, it just won't do anything 🙂"

tony.kay 2020-12-17T02:06:38.063800Z

I am trying to fight against the pre-conceived notions that ppl have coming from systems that do form management,..that is sort of what RAD does, but form-state is not that.

tony.kay 2020-12-17T02:07:15.064500Z

when I wrote that chapter I was hoping the community would pop up their own form libs as add-ons, perhaps leveraging form-state as a building block

JAtkins 2020-12-17T02:07:16.064800Z

Oh. I’m not a target audience then. Fulcro is the first I’ve touched

tony.kay 2020-12-17T02:07:31.065Z

didn’t happen, and now RAD exists, and the book is out of date

tony.kay 2020-12-17T02:07:43.065200Z

🤷

dgb23 2020-12-17T21:09:02.079700Z

Hi, this is a message of appreciation. As a freelance full-stack developer I very recently started to watch videos and follow the book. I’m excited to say the least. Over the last few years I’ve been taking more and more notes, did experiments and started to educate myself to find the right abstractions and ways to improve my productivity, the maintainability and reliability of my work. When I first noticed Fulcro a few years (?) ago I quickly discarded it as a possibility. It seemed like “too much” and I was jaded by frameworks being something I have to fight against and escape from (comming from the PHP world). At the time I re-focused on the timeless fundamentals of web development. But recently I checked the Cognitect GitHub sponsoring list (due to the sponsoring announcement) and thought “Huh, maybe there is something to it.” I’m posivitely surprised, almost shocked... Not only because it seems to be very carefully crafted and designed, but also because it manifests several concepts, practices and intuitions that I’ve been using and gathering, and then goes way beyound that by refining and composing them into a whole, adaptable system. I so far feel blessed and lucky, because Fulcro validates my half baked tools, ideas and practices, but also because it seems to be a framework that I can build on with confidence. From what I’ve learned so far, it seems to almost completely agree with my personal experiences and challenges and teaches me a whole bunch of things on top of that. Right now I’m looking forward to build something real with it and learn what the usage assumptions are. I want to at least say “Thank you!” and “Wow!” because it is already inspiring project just from a learning perspective.

❤️ 8
Jakub Holý 2020-12-17T21:25:57.080100Z

Awesome, thanks for sharing! While getting your toes wet learning and using Fulcro, please make notes about hurdles and "if I only knew this 3 weeks ago.." so that we can keep on improving the beginner experience and flatten the learning curve!

Danny Almeida 2020-12-17T21:33:48.081100Z

Hello! I have tried the example in fulcro book on dynamic routers - https://book.fulcrologic.com/#_live_router_example. Everything works as expected, but each time I select a route option, I get three messages on the console e.g. "`Will enter settings with route params {}`". Also, when I click on "`Modified (prevent routing)`" option, I get the popup message twice. This happens when I try the online book example as well as when I try it locally on my computer. Is this the expected behaviour ?

tony.kay 2020-12-17T21:36:54.083Z

it’s a poor example, actually. will-enter does get called more than once, which is part of the design (searching for the best route match), which is why will-enter has a deferred mode to prevent side effects. The double message is unintentional but also part of the routing search…The API has been improved since that example I think. @dionysius.almeida

1
tony.kay 2020-12-17T21:37:04.083300Z

hard to keep book up to date:)

1
tony.kay 2020-12-17T21:47:20.083400Z

Thanks. You OK if I use part of that in the README? 😄 That ranks right up there with another user compliment I got: “Every sufficiently complex webapp contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Fulcro”, based on Greenspun’s tenth rule of programming.

❤️ 1
dgb23 2020-12-17T22:39:32.083900Z

@holyjak that’s a great suggestion. I’m teaching coding part time at a school for designers. And my guinea pig, a designer I work with closely, also takes these kind of notes for us to improve the course. The most challenging thing is to take the perspective of a beginner when you are already deeply in a subject for years. @tony.kay Yes of course! Also that quote reflects my experience in a way :)

👍 1
🎉 1
phronmophobic 2020-12-17T22:53:44.085900Z

Is there an example of using Fulcro without React? I realize that's probably not a use case that Fulcro is interested in supporting, but I'm happy to wade through the weeds a bit to see if I can reuse Fulcro's state management with a non-react view system.

tony.kay 2020-12-17T22:55:52.086700Z

@smith.adriane there are not many weeds. The design is adaptable. If I had the time I would have already written a UNIX Curses plugin just to be “funny”

🤘 1
tony.kay 2020-12-17T22:56:07.087100Z

of course you can’t use the DOM helpers, but you don’t want to

tony.kay 2020-12-17T22:56:30.087600Z

but you can plug the renderer, or just use it headless for state mgmt

tony.kay 2020-12-17T22:56:38.087800Z

in CLJC

tony.kay 2020-12-17T22:57:52.089100Z

defsc does output a react component by default, but if you use use-hooks? true you just get a plain fn

phronmophobic 2020-12-17T22:58:04.089300Z

Mostly, I just want access to the render function for a component. Is the suggested route to forgo defsc and make a similar macro?

phronmophobic 2020-12-17T22:58:15.089700Z

I type too slow

tony.kay 2020-12-17T22:58:29.089900Z

The hooks route might work…I type too fast 😜

tony.kay 2020-12-17T22:58:38.090100Z

and tend to guess ahead of ppl 🙂

tony.kay 2020-12-17T22:58:46.090300Z

(not always accurately)

tony.kay 2020-12-17T22:59:10.090500Z

In CLJ or CLJS?

phronmophobic 2020-12-17T22:59:15.090700Z

clj

tony.kay 2020-12-17T22:59:19.090900Z

then you can use defsc

tony.kay 2020-12-17T22:59:22.091100Z

no React involved

phronmophobic 2020-12-17T22:59:46.091300Z

well, ideally both, but I'm much more interested in clj since cljs already has a really good story (ie. React)

tony.kay 2020-12-17T22:59:47.091500Z

I do not guarantee that works perfectly…it was meant for server-side rendering of DOM, but there are no React ties.

tony.kay 2020-12-17T23:00:07.091700Z

(I don’t know anyone doing SSR with it, so not well-exercised)

tony.kay 2020-12-17T23:00:43.091900Z

be fun to see what you come up with. please share your progress and questions 🙂

phronmophobic 2020-12-17T23:00:51.092100Z

the use-hooks? looks like it's a great start

phronmophobic 2020-12-17T23:01:47.092300Z

and already puts Fulcro ahead of the other ui frameworks I've tried that were heavily dependent on react

tony.kay 2020-12-17T23:05:03.092500Z

The data stuff will run seamlessly…don’t know about the render (refresh) story…should be OK. I test in CLJC.

tony.kay 2020-12-17T23:05:20.092700Z

and like I said, render is trivial and pluggable

tony.kay 2020-12-17T23:07:44.092900Z

In CLJ the non-hooks “component” just let’s you put the lifecycle stuff on the component (which is just a map), but nothing calls any of it

tony.kay 2020-12-17T23:07:50.093100Z

(but you can 😉 )

tony.kay 2020-12-17T23:08:43.093300Z

(comp/component-options Class-or-this) is the API way to ask for the options in the options map of a defsc (contains query/ident/initial state as their real lambdas as well)

tony.kay 2020-12-17T23:10:25.093500Z

So, I think all it will take is: 1. Set the app options on app creation for :render-root! and :optimized-render! 2. Have your “components” return a tree of data your render can work with 3. Pass app/mount! the app, your Root component, and a made-up keyword for mount node

tony.kay 2020-12-17T23:11:16.093700Z

heck, you could start with a simple Root that prints a value and waits for input (like System/in)…on input “transact!“, and render again.

tony.kay 2020-12-17T23:11:29.093900Z

should be able to get a “increment button” like thing going in 10 mins

tony.kay 2020-12-17T23:13:22.094300Z

Render is essentially “Here’s the db, and here’s your root (whose query can be used to pull from db)…render stuff”. See the source for application.cljc and keyframe-render.cljc

phronmophobic 2020-12-17T23:14:09.094500Z

I'm a little new to fulcro, so I'll try to work through those suggestions. I did just watch some of the videos about the underlying design which seems great

tony.kay 2020-12-17T23:14:29.094700Z

Actually, if you set render-root! then you can use the unmodified keyframe-render for optimized-render

tony.kay 2020-12-17T23:14:44.094900Z

so step 1 is half the work 🙂

1
Danny Almeida 2020-12-17T23:19:07.095300Z

Thank you for that clarification. Considering the effort that you make putting out and maintaining all the videos and books, it's not a small feat 🙂 Is there a better example for dynamic routing that I can maybe use ? I'm just learning routing, so it's all a bit overwhelming with all the concepts to grasp. I've just a bunch of components which get their data from the server. Now I'm trying to use routing to have multiple screens which will fetch and show data for those components. I am looking for an example which does routing along with demand based data fetching for the components. Thank you so much for being so active on this channel. Cheers

tony.kay 2020-12-17T23:20:22.095700Z

If you want to use remotes, you just need to define a remote, which is also pretty easy. It’s just a map with a :transmit! key whose value is a function that receives the tx to transmit and callbacks to use to report the result.

tony.kay 2020-12-17T23:20:39.096100Z

I don’t have a CLJ remote pre-built…but the js source of the front-end one is a good template

phronmophobic 2020-12-17T23:21:07.096500Z

my first goal is to build a simple desktop app

👍 1
tony.kay 2020-12-17T23:22:17.096700Z

Um, the RAD internals? report.cljc and form.cljc have macros that build defsc that are both route targets. They use UISM to control state, but they do use will-enter

tony.kay 2020-12-17T23:22:19.096900Z

and such

Danny Almeida 2020-12-17T23:29:55.097200Z

I haven't checked out RAD yet. I wanted to get a hang of how fulcro works under the hood before learning RAD. Will check out the files you have mentioned. Thank you again 🙂

phronmophobic 2020-12-17T23:54:44.097400Z

nothing was happening when I tried to call app/mount! and I just peeked at the source and it looks like app/mount! doesn't have a clj implementation

phronmophobic 2020-12-17T23:56:22.097600Z

I'll give writing my own version of mount! a shot based on the cljs implementation