by ssaunier_ on 12/4/20, 5:52 PM with 133 comments
by benzible on 12/4/20, 7:26 PM
[1] https://css-tricks.com/alpine-js-the-javascript-framework-th...
[2] https://thinkingelixir.com/podcast-episodes/021-tailwind-css...
by phaedryx on 12/4/20, 11:40 PM
1. There is not a lot of documentation
2. They don't provide any testing guidelines, the best I've found is hand-wavy test-with-a-browser stuff
3. Everything is essentially global
4. Functions are disconnected from their parameters, i.e. I can't tell which bits of data a function is using without digging through a bunch of code.
5. Putting state in your HTML is tricky if you also want to modify the DOM.
6. Their naming scheme is cumbersome, e.g. data-controller="using-a--sub-directory" and data-target="some--nested--target-has-a.function", that is, the fact that everything is location-in-your-code-file-structure based.
And a lot of other small things.
Ironically, using Stimulus convinced me to switch to Vue because I liked their value proposition of "Javascript sprinkles for your HTML", which Vue lets me do, but more intuitively.
by cutler on 12/4/20, 11:05 PM
by mike1o1 on 12/4/20, 6:28 PM
My only complaint/comment is that some of the HTML that I need to generate ends up being littered with so many data attributes, especially when combining multiple Stimulus controllers/behaviors.
Has anybody found a clean way around that in Rails templates?
by catwind7 on 12/5/20, 1:36 AM
Not knocking on stimulusjs, but just be wary that it does not grow well with increasing client side complexity. You'll end up writing a lot of javascript boilerplate / DOM manipulation code / custom state management components. From my experience, it's a nice lightweight tool for when you:
1. Just need to add some light interactivity (toggling visibility of components, any basic view filtering) that do not involve a lot of logic 2. Don't need j.s unit tests (stimulus has not been the most testable tool - we lean mostly on integration tests).
by gerry_shaw on 12/4/20, 9:01 PM
by dang on 12/4/20, 9:07 PM
2018 https://news.ycombinator.com/item?id=16052105
by vmsp on 12/4/20, 9:18 PM
by stepbeek on 12/4/20, 8:32 PM
It’s encoding conventions that we’ve fallen into using it for the last year. The callbacks in value changes are going to make my life much easier.
by lostfocus on 12/4/20, 10:44 PM
by correlator on 12/4/20, 8:00 PM
by tpetry on 12/4/20, 6:59 PM
by obiefernandez on 12/4/20, 6:13 PM
by osxman on 12/5/20, 8:38 AM
My original thought was to go for an SPA with a rails API backend. I tried out both React & Vue extensively but got stuck in a while. Since implementing Rails and plain 'vanilla' JS it went better. But with StimulusJS 1+ it went simply great.
Allready upgraded to 2.0 and it feels even more structured with the new features, like values and improved targets.
by cutler on 12/4/20, 11:31 PM
by shay_ker on 12/4/20, 7:11 PM
by yborg on 12/4/20, 10:23 PM
by jdhornby on 12/4/20, 11:24 PM
by ksec on 12/4/20, 7:36 PM
by Drakula2k on 12/4/20, 6:51 PM
by Scarbutt on 12/4/20, 7:30 PM
Are they implying one shouldn't use it if you don't have any HTML already?