Live data from Hacker News

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

stimulusjs.org

11–20 of 65 posts

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

#11
I don't mean to knock the effort they've put in here, but this looks like all of the hand-rolled "frameworks" I saw my friends in the agency / consulting space made when they said angular 1 was "too heavy"... right down to the 'data-controller' attribute binding that everyone seemed to independently come up with.

Is there anything actually novel here? These types of things always seemed to run into composition issues (controllers inside of controllers) in terms of communication and what not. The net result was invariably far less appealing than, say, angular 1 or vue or non-SPA React.

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

#12
post #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.

Pity that the end result is always having bower, webpack, npm, yarn, gulp, yeoman installed.

Really painful when JavaScript is only used on the browser and the frontend files need to be integrated into the backend infrastructure written in a more sane language.

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

#13
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 sour…

Support is now baked into most browsers for Web components! Also Polymer Lit-HTML and HyperHTML leverage JS Template Literals to natively update the DOM as fast or faster than virtual DOM using much less resource.

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

#14
post #12
post #8

Earlier quoted context omitted.

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.

Pity that the end result is always having bower, webpack, npm, yarn, gulp, yeoman installed. Really painful when JavaScript is only used on the browser and the frontend files need to be integrated into the backend infrastructure written in a more sane language.

Why would a project have both npm and yarn, or bower, webpack and gulp?

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

#15
This is good at first look. Because it seems to be straightforward and carefully design. I like the aesthetic and choice of using data attributes being part of the HTML standard as directives to apply the framework.

One criticism I have relates to The syntax for denoting action methods. Did you agonize over the choice of syntax uses hash and implication? E.g.

    click->hello#greet
All the same this careful choice shows the effort you put into the framework . I’m just not sure this particular choice is to my taste nor works with regard to being consistent with the rest of the syntactic choices you have made.

Interested to hear thoughts of others in a discussion about this.

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

#16

Earlier quoted context omitted.

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 sour…

Support is now baked into most browsers for Web components! Also Polymer Lit-HTML and HyperHTML leverage JS Template Literals to natively update the DOM as fast or faster than virtual DOM using much less resource.

If you feel this is a lazy request please let me know, but could you point me to the source code for using native JS string templates to do Dom updating that achieve similar things to Virtual DOM?

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

#18

I don't mean to knock the effort they've put in here, but this looks like all of the hand-rolled "frameworks" I saw my friends in the agency / consulting space made when they said angular 1 was "too heavy"... right down to the 'data-controller' attribute binding that everyone seemed to independently come up with. Is there anything actually novel here? These types of things always seemed to run into composition issues…

Isn't the fact that you've seen a bunch of people already hand-roll this a good indication that there's a need for something like this, so no-one else needs to hand-roll it anymore?

It doesn't need to be novel right? It just needs to be helpful.

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

#19

This is good at first look. Because it seems to be straightforward and carefully design. I like the aesthetic and choice of using data attributes being part of the HTML standard as directives to apply the framework. One criticism I have relates to The syntax for denoting action methods. Did you agonize over the choice of syntax uses hash and implication? E.g. click->hello#greet All the same this careful choice shows…

I think the ”hello#greet” part is there to be consistent with Rails route mapping.

As a standalone syntax choice, it makes little sense. But for a RoR developer, it’s obvious.

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

#20
With 30KB in size, this framework might be something I can integrate into my websites to get a nice look-and-feel while preserving usability when script blockers are active.

Personally, when I work on projects I tend to develop a pure HTML+CSS solution first and then bolt on JS if needed, so this kind of stuff might make me more comfortable with writing proper webapps since it's still just basically "bolt JS on HTML".

Post reply on HN