That's the funny thing about a relatively small community: we each have a disproportionate ability to influence the direction "best practices" tend to fall. We've been doing our best to document these outcomes on betterstimulus.com/ for a few years now, but there's till lots we're figuring out in real time.
So yeah... I don't know if "Stimulus-y" means as much as "Rails-y" yet, because there's just been fewer eyeballs on the problem domain.
The litmus test I run with when trying to decide how to collect elements is: is there ambiguity such that targets enable an explicit control that wouldn't be possible to infer otherwise? Or, based on the nature of the controller and what's nested under it, is it redundant make-work?
In other words, a controller that is intended to live on a ul and wrangle li elements probably doesn't benefit from forcing developers to attach a target to each li.
Anything more arbitrary, well... yeah, that's what targets are for!
Yeah, I've gotten a ton of use out of betterstimulus.com since I've committed to Stimulus for most of my projects - you and the other folks there are a huge resource to the community.
That way of thinking about target usage seems pretty reasonable, thanks for sharing!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
That's the funny thing about a relatively small community: we each have a disproportionate ability to influence the direction "best practices" tend to fall. We've been doing our best to document these outcomes on betterstimulus.com/ for a few years now, but there's till lots we're figuring out in real time.
So yeah... I don't know if "Stimulus-y" means as much as "Rails-y" yet, because there's just been fewer eyeballs on the problem domain.
The litmus test I run with when trying to decide how to collect elements is: is there ambiguity such that targets enable an explicit control that wouldn't be possible to infer otherwise? Or, based on the nature of the controller and what's nested under it, is it redundant make-work?
In other words, a controller that is intended to live on a
ul
and wrangleli
elements probably doesn't benefit from forcing developers to attach a target to eachli
.Anything more arbitrary, well... yeah, that's what targets are for!
Yeah, I've gotten a ton of use out of betterstimulus.com since I've committed to Stimulus for most of my projects - you and the other folks there are a huge resource to the community.
That way of thinking about target usage seems pretty reasonable, thanks for sharing!