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.
Stimulus: A modest JavaScript framework for the HTML you already have
21–30 of 65 posts
Re: Stimulus: A modest JavaScript framework for the HTML you already have
#22Earlier quoted context omitted.
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
#23I 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
#24Earlier quoted context omitted.
Why would a project have both npm and yarn, or bower, webpack and gulp?
Easy, each library is its own little world of dependencies, with the author favoring a different build tool, so simple npm install or npm serve might require all of them to satisfy all the dependencies build scripts.
Re: Stimulus: A modest JavaScript framework for the HTML you already have
#25Earlier quoted context omitted.
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
#26[1] https://github.com/firstandthird/domodule [2] https://github.com/firstandthird/simple-domodal [3] https://github.com/firstandthird/complete
Re: Stimulus: A modest JavaScript framework for the HTML you already have
#27Previous 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.
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
#28Earlier quoted context omitted.
Easy, each library is its own little world of dependencies, with the author favoring a different build tool, so simple npm install or npm serve might require all of them to satisfy all the dependencies build scripts.
Is that a real world scenario or something you can imagine but haven't actually done?
Polymer starter kit
https://github.com/Polymer/polymer-starter-kit
- npm
- bower
- polymer-cli
Doing a polymer test requires downloading and installing Web Component Tester, which then requires:
- npm
- grunt
- gulp
- bower
Re: Stimulus: A modest JavaScript framework for the HTML you already have
#29Re: Stimulus: A modest JavaScript framework for the HTML you already have
#30We 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
It's a super awesome pattern, that makes things super simple and it's super lightweight as well.