FWIW I can see this when running your demo
isn’t that pretty much what the chapter intro says? https://book.fulcrologic.com/#FormState
I pushed a minor edit, hopefully that is better
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 🙂"
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.
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
Oh. I’m not a target audience then. Fulcro is the first I’ve touched
didn’t happen, and now RAD exists, and the book is out of date
🤷
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.
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!
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 ?
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
hard to keep book up to date:)
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.
@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 :)
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.
@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”
of course you can’t use the DOM helpers, but you don’t want to
but you can plug the renderer, or just use it headless for state mgmt
in CLJC
defsc
does output a react component by default, but if you use use-hooks? true
you just get a plain fn
Mostly, I just want access to the render function for a component. Is the suggested route to forgo defsc
and make a similar macro?
I type too slow
The hooks route might work…I type too fast 😜
and tend to guess ahead of ppl 🙂
(not always accurately)
In CLJ or CLJS?
clj
then you can use defsc
no React involved
well, ideally both, but I'm much more interested in clj since cljs already has a really good story (ie. React)
I do not guarantee that works perfectly…it was meant for server-side rendering of DOM, but there are no React ties.
(I don’t know anyone doing SSR with it, so not well-exercised)
be fun to see what you come up with. please share your progress and questions 🙂
the use-hooks?
looks like it's a great start
and already puts Fulcro ahead of the other ui frameworks I've tried that were heavily dependent on react
The data stuff will run seamlessly…don’t know about the render (refresh) story…should be OK. I test in CLJC.
and like I said, render is trivial and pluggable
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
(but you can 😉 )
(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)
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
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.
should be able to get a “increment button” like thing going in 10 mins
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
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
Actually, if you set render-root!
then you can use the unmodified keyframe-render for optimized-render
so step 1 is half the work 🙂
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
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.
I don’t have a CLJ remote pre-built…but the js source of the front-end one is a good template
my first goal is to build a simple desktop app
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
and such
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 🙂
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
I'll give writing my own version of mount!
a shot based on the cljs
implementation