Live data from Hacker News

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

github.com

1–10 of 112 posts

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

#3
This feels like it has a whif of Angular about it. Controllers in HTML attributes...

Are we likely to see this in Rails 6? I'm a full-time Rails dev these days and I struggle to keep up with all the new things that are coming through that I'm not using day-to-day on older apps! Webpacker, Action Cable, just to name a couple.

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

#4
For context, I'm in no way, shape, or form a modern front end maestro. I'm good with ES6, Jquery, Handlebars, and Bootstrap. I've done a little with the Angular 2.

From that perspective....

What does this buy me over the other more popular frameworks? What are the chances that this won't be abandoned if it doesn't gain traction? It's also easier to recruit developers if you say your stack is built on the more popular frameworks.

On the other hand, even though I've never used Ruby on Rails, this is written by BaseCamp so I do give them a slight benefit of a doubt. Just like I would give Kotlin the benefit of a doubt based on my experience with JetBrains' products.

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

#5

For context, I'm in no way, shape, or form a modern front end maestro. I'm good with ES6, Jquery, Handlebars, and Bootstrap. I've done a little with the Angular 2. From that perspective.... What does this buy me over the other more popular frameworks? What are the chances that this won't be abandoned if it doesn't gain traction? It's also easier to recruit developers if you say your stack is built on the more popular…

I believe this section attempts to answer that question:

https://github.com/stimulusjs/stimulus/blob/master/ORIGIN.md...

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

#7
post #5

For context, I'm in no way, shape, or form a modern front end maestro. I'm good with ES6, Jquery, Handlebars, and Bootstrap. I've done a little with the Angular 2. From that perspective.... What does this buy me over the other more popular frameworks? What are the chances that this won't be abandoned if it doesn't gain traction? It's also easier to recruit developers if you say your stack is built on the more popular…

I believe this section attempts to answer that question: https://github.com/stimulusjs/stimulus/blob/master/ORIGIN.md...

> Stimulus also differs on the question of state. Most frameworks have ways of maintaining state within JavaScript objects, and then render HTML based on that state. Stimulus is the exact opposite. State is stored in the HTML, so that controllers can be discarded between page changes, but still reinitialize as they were when the cached HTML appears again. It really is a remarkably different paradigm. One that I’m sure many veteran JavaScript developers who’ve been used to work with contemporary frameworks will scoff at. And hey, scoff away. If you’re happy with the complexity and effort it takes to maintain an application within the maelstrom of, say, React + Redux, then Turbolinks + Stimulus will not appeal to you.

The complexity of React + Redux is completely orthogonal to having a virtual DOM. Ractive, vue, and the like are similarly easy as Stimulus.

Making state management easier is a matter of having simpler APIs, not moving state into HTML.

Quick Ractive version (at work so just ad-libbing):

  new Ractive({
    el: '.greeter-ui',
    template: `
      
        
        Greet
      
    `,
    data: {
      name: 'Alex'
    },
    oncomplete: function(){
      var Greeter = this;

      var greetButton = document.querySelector('button.greet') 
      document.addEventListener(greetButton, 'click', function(event){
        var name = Greeter.get('name')
        console.log(name)
        event.preventDefault();
      })
    }
  })

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

#9

This feels like it has a whif of Angular about it. Controllers in HTML attributes... Are we likely to see this in Rails 6? I'm a full-time Rails dev these days and I struggle to keep up with all the new things that are coming through that I'm not using day-to-day on older apps! Webpacker, Action Cable, just to name a couple.

Reminds me too of AngularJS. Rails has dramatically changed how it handles front-end, but it would be tough to compete without doing so.

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

#10
post #5

For context, I'm in no way, shape, or form a modern front end maestro. I'm good with ES6, Jquery, Handlebars, and Bootstrap. I've done a little with the Angular 2. From that perspective.... What does this buy me over the other more popular frameworks? What are the chances that this won't be abandoned if it doesn't gain traction? It's also easier to recruit developers if you say your stack is built on the more popular…

I believe this section attempts to answer that question: https://github.com/stimulusjs/stimulus/blob/master/ORIGIN.md...

Thanks for that. I just looked up the referenced TurboLink package. I'm not very opinionated on whether it makes more sense to render on the server or client. I can go either way depending on context.

But, if I were to do another project where server side rendering made more sense, I would definitely do a proof of concept with Stimulus + TurboLinks.

Right now, my preferred light weight solution is JQuery+Handlebars+WebAPI (c#)

Post reply on HN