Live data from Hacker News

Stimulus.js 2.0

discourse.stimulusjs.org

91–100 of 140 posts

Re: Stimulus.js 2.0

#91

Earlier quoted context omitted.

What UI behaviors necessitated you to move beyond stimulus? Could you provide an example?

Sure! One typical example is a component that collects (and displays) education history provided by the user. I'll list out just a few key UI behavior: * A "read" view which represents a list of containers with titles that show each instance of a users answer (for example, if you provided 5 sets of answers, such as 5 universities you attended, we need to show those 5 in some sort of preview form on the page) * A butt…

Awesome answer. I work a lot on business systems with complex forms and agree with everything you say.

We are still feeling our way for a solution as we don't want to move to a SPA (swapping one set of costs for another) but have outgrown our current SSR + hand-rolled JS + jQuery + Bootstrap JS mess.

Re: Stimulus.js 2.0

#92
post #40

Unpoly https://unpoly.com is also worth a look if you are interested in these things. It combines Turbolinks and Stimulus functionality in a very usable way.

My killer unpoly features: * easy AJAX loading like turbolinks ( ) * easy AJAX modal ( ) * submit a form whenever any input changes ( ) * respects the way HTML is intended to be used, so the page still works even when JS is disabled

I’m currently dealing with a modal issue within Svelte (pretty sure it’s due to createDispatch) and the Discord moves too fast to get help.

Gonna check this out in the AM.

EDIT: Couldn't sleep so checked it out now. Looking through the issues, there are a couple that are apparently "fixed in 1.0" but it doesn't look like 1.0 is coming anytime soon. Shame.

Re: Stimulus.js 2.0

#93

I worked with Stimulus for about a month and found it to be frustrating: 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…

It feels very much like Knockout which reminds me of the same frustrations

Re: Stimulus.js 2.0

#94

Earlier quoted context omitted.

What UI behaviors necessitated you to move beyond stimulus? Could you provide an example?

Sure! One typical example is a component that collects (and displays) education history provided by the user. I'll list out just a few key UI behavior: * A "read" view which represents a list of containers with titles that show each instance of a users answer (for example, if you provided 5 sets of answers, such as 5 universities you attended, we need to show those 5 in some sort of preview form on the page) * A butt…

Thank you for the detailed answer. I can definitely see you’ve crossed the line of adding subtle interactivity to the dom :)

The behaviors you describe are intricate and contain interconnected components which are probably managed by something like vuex (or the react equivalent)

Re: Stimulus.js 2.0

#95

I worked with Stimulus for about a month and found it to be frustrating: 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…

Doesn’t vuejs require you to keep your state in a store object (data: {}) and render html via js though?

Re: Stimulus.js 2.0

#96

Earlier quoted context omitted.

I am an experienced web dev and went into Stimulus excited to have something that seemed straightforward, but was disappointed. Vue has the flexibility to do SSR HTML with a bit of javascript for behavior way that works well for me. Just being able to put )">Save Instead of: some--long--path-to#save" data-id=" ">Save ... save(event) { event.preventDefault() In my HTML has been worth the switch for me.

I've personally hit the point where I feel like React is my go to for anything - especially with Gatsby. * If I'm keeping it simple, it's barely different than pure HTML. * Free templating * If I need Javascript (which I likely will), it's extremely easy to add anything I need.

But you get blank page until js kicks in?

Re: Stimulus.js 2.0

#97

Earlier quoted context omitted.

because then you need an api

React supports server side rendering.

Sure, but where is your data and business logic going to live? If the answer is "just write it in JS" then it's no longer a question of "just use React" but "let's replace our entire stack with Javascript".

Re: Stimulus.js 2.0

#98

I worked with Stimulus for about a month and found it to be frustrating: 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…

It feels very much like Knockout which reminds me of the same frustrations

Huh? I think Knockout.js was awesome for its time! To me, Vue.js feels like Knockout’s spiritual successor. What did you find frustrating about Knockout?

Re: Stimulus.js 2.0

#99
This is good news. I work for 6 months with StimulusJS 1 and I'm very happy to use it. I use it mainly in a rails app combined with Turbolinks.

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.

Re: Stimulus.js 2.0

#100

Earlier quoted context omitted.

I've personally hit the point where I feel like React is my go to for anything - especially with Gatsby. * If I'm keeping it simple, it's barely different than pure HTML. * Free templating * If I need Javascript (which I likely will), it's extremely easy to add anything I need.

But you get blank page until js kicks in?

Not if you use Gatsby or NextJS and get server side rendering out of the box
Post reply on HN