Live data from Hacker News

Stimulus: A modest JavaScript framework for the HTML you already have

stimulusjs.org

1–10 of 65 posts

Re: Stimulus: A modest JavaScript framework for the HTML you already have

#3
I like it a lot, but I'm always afraid that I'll end up running into limitations of the framework if whatever I'm doing happens to grow in scope in a way I hadn't planned for. I tend to be bad at planning ahead for side projects, but who can blame me, they're side projects.

Anyway, just stopping by to say that Vue has struck a good balance for me. Peppering in {{template values}} in existing HTML works really well, and when things start to get more complex I can easily break my dom out into components.

Re: Stimulus: A modest JavaScript framework for the HTML you already have

#4

I like it a lot, but I'm always afraid that I'll end up running into limitations of the framework if whatever I'm doing happens to grow in scope in a way I hadn't planned for. I tend to be bad at planning ahead for side projects, but who can blame me, they're side projects. Anyway, just stopping by to say that Vue has struck a good balance for me. Peppering in {{template values}} in existing HTML works really well, a…

I love Vue as well. The problem is that I haven’t found a good way to fit Vue in with an existing Rails app without it resorting to JavaScript hell. Stimulus looks interesting because it already fits in with Turbolinks.

Re: Stimulus: A modest JavaScript framework for the HTML you already have

#5
post #4

I like it a lot, but I'm always afraid that I'll end up running into limitations of the framework if whatever I'm doing happens to grow in scope in a way I hadn't planned for. I tend to be bad at planning ahead for side projects, but who can blame me, they're side projects. Anyway, just stopping by to say that Vue has struck a good balance for me. Peppering in {{template values}} in existing HTML works really well, a…

I love Vue as well. The problem is that I haven’t found a good way to fit Vue in with an existing Rails app without it resorting to JavaScript hell. Stimulus looks interesting because it already fits in with Turbolinks.

When you say JS hell I'm assuming you mean because Rails wants to be your JS bundler? Why not just have rails output a div with an ID? And then use a separate bundler such as webpack to generate a JS bundle?

At the end of the day Vue-cli or create-react-app ultimately just generates static assets. Adding your statically built SPA into a Rails app should be no harder than adding jQuery. Rails should not need to know about webpack & vice versa. The key is to build components not a full fledged SPA. Pick either Rails or Vue router. If the former, Vue is just a component/view library, don't treat it like a framework.

Re: Stimulus: A modest JavaScript framework for the HTML you already have

#8
post #7

As a VanilaJS advocate, I love it. The manual even describes how to use just a plain inclusion, instead of the build tool of the day.

But...tons of the nontrivial JavaScript projects I use describes a plain inclusion. So I don't quite understand the plaudit here.

Doing so is not a great idea, because build tools solve real and extant problems, but they're very common.

Re: Stimulus: A modest JavaScript framework for the HTML you already have

#9

I like it a lot, but I'm always afraid that I'll end up running into limitations of the framework if whatever I'm doing happens to grow in scope in a way I hadn't planned for. I tend to be bad at planning ahead for side projects, but who can blame me, they're side projects. Anyway, just stopping by to say that Vue has struck a good balance for me. Peppering in {{template values}} in existing HTML works really well, a…

Have it exactly the same way, and especially the vue components are nice to have. It seems like Stimulus would be a good fit for small applications, but as soon it becomes a medium size project it would be to complex to maintain.

Re: Stimulus: A modest JavaScript framework for the HTML you already have

#10
post #6

What's the advantage or disadvantage of using this when compared to something that works with Web Components like Polymer or stencil?

I agree with you that this is a worthwhile comparison to make, but would also point out that you could compare Web Components to any JS framework. When Web Components reach maturity (i.e. when support is baked into browsers and you don't have to fall back on using libraries like Polymer), they'll hopefully signal the end of JS frameworks as we know them, as it'll be easy to mix and match components from multiple sources. Until that time comes, I welcome JS frameworks like Stimulus that can (supposedly) be easily retrofitted onto existing websites, even if I'd prefer to see more activity around Web Components.
Post reply on HN