I know it is vanilla ES6, but at some point it starts looking more like Java than JavaScript. The boilerplate necessary to convey a simple instruction is directly proportional to the averaged speed of everything else (authorship, maintenance, execution, testing, frequency of reuse, and so forth).
Stimulus: A modest JavaScript framework for the HTML you already have
31–40 of 65 posts
Re: Stimulus: A modest JavaScript framework for the HTML you already have
#32Previous discussion: https://news.ycombinator.com/item?id=16052105 I've been using Stimulus + Turoblinks for my current side project and I love it. Nice and simple way to add a bit of interactivity to existing HTML on your page.
*Turbolinks, copy/pasted that for Google and didn't find anything relevant. Edit: thanks, I found it, I was just pointing out to the typo so other people don't get confused.
Re: Stimulus: A modest JavaScript framework for the HTML you already have
#33Previous discussion: https://news.ycombinator.com/item?id=16052105 I've been using Stimulus + Turoblinks for my current side project and I love it. Nice and simple way to add a bit of interactivity to existing HTML on your page.
*Turbolinks, copy/pasted that for Google and didn't find anything relevant. Edit: thanks, I found it, I was just pointing out to the typo so other people don't get confused.
Re: Stimulus: A modest JavaScript framework for the HTML you already have
#34Previous discussion: https://news.ycombinator.com/item?id=16052105 I've been using Stimulus + Turoblinks for my current side project and I love it. Nice and simple way to add a bit of interactivity to existing HTML on your page.
*Turbolinks, copy/pasted that for Google and didn't find anything relevant. Edit: thanks, I found it, I was just pointing out to the typo so other people don't get confused.
Re: Stimulus: A modest JavaScript framework for the HTML you already have
#35Can anyone with experience of Stimulus suggest why I'd pick it over intercooler?
Re: Stimulus: A modest JavaScript framework for the HTML you already have
#36We wrote a pretty similar (like similar enough its kinda creepy) library[1] a while back and it's really helped speed up our front end dev. I LOVE having params set in data attributes. Makes re-usable modules, like a modal[2] or autocomplete [3], way easier to implement. [1] https://github.com/firstandthird/domodule [2] https://github.com/firstandthird/simple-domodal [3] https://github.com/firstandthird/complete
I did two other frameworks that are super similar, hooked up with dynamic loading of the code with webpack, and the older one RequireJS. It's a super awesome pattern, that makes things super simple and it's super lightweight as well.
Re: Stimulus: A modest JavaScript framework for the HTML you already have
#37Re: Stimulus: A modest JavaScript framework for the HTML you already have
#38This has a lot of similarities to intercooler.js http://intercoolerjs.org/ which I really enjoy when I don't need a full SPA type experience. Can anyone with experience of Stimulus suggest why I'd pick it over intercooler?
Re: Stimulus: A modest JavaScript framework for the HTML you already have
#39> export default class extends Controller { I know it is vanilla ES6, but at some point it starts looking more like Java than JavaScript. The boilerplate necessary to convey a simple instruction is directly proportional to the averaged speed of everything else (authorship, maintenance, execution, testing, frequency of reuse, and so forth).
`export` -> exports the thing
`default` -> if you require from this module, this is the default
`class` -> class definition
`extends` -> speaks for itself
`Controller` class it's extending.
You could maybe rework it so you don't export it on the same line:
```
class Foo extends Controller {}
export default Foo
```
The parallel I see here to Java is the object orientation - which is a fair criticism. There are probably ways to execute on this using other mechanisms other than inheritance. But then, sub-classing to me still feels better than assigning the prototype via direct assignment.