TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Stimulus.js 2.0

254 点作者 ssaunier_超过 4 年前

21 条评论

benzible超过 4 年前
Alpine.js is worth a look as well [1]. I&#x27;ve been working with it as part of the newly christened &quot;PETAL stack&quot; [2] of Phoenix, Elixir, Tailwind, Alpine.js, and LiveView.<p>[1] <a href="https:&#x2F;&#x2F;css-tricks.com&#x2F;alpine-js-the-javascript-framework-thats-used-like-jquery-written-like-vue-and-inspired-by-tailwindcss&#x2F;" rel="nofollow">https:&#x2F;&#x2F;css-tricks.com&#x2F;alpine-js-the-javascript-framework-th...</a><p>[2] <a href="https:&#x2F;&#x2F;thinkingelixir.com&#x2F;podcast-episodes&#x2F;021-tailwind-css-alpine-js-and-liveview-with-patrick-thompson&#x2F;" rel="nofollow">https:&#x2F;&#x2F;thinkingelixir.com&#x2F;podcast-episodes&#x2F;021-tailwind-css...</a>
评论 #25307856 未加载
评论 #25310138 未加载
评论 #25310677 未加载
评论 #25306869 未加载
评论 #25307203 未加载
phaedryx超过 4 年前
I worked with Stimulus for about a month and found it to be frustrating:<p>1. There is not a lot of documentation<p>2. They don&#x27;t provide any testing guidelines, the best I&#x27;ve found is hand-wavy test-with-a-browser stuff<p>3. Everything is essentially global<p>4. Functions are disconnected from their parameters, i.e. I can&#x27;t tell which bits of data a function is using without digging through a bunch of code.<p>5. Putting state in your HTML is tricky if you also want to modify the DOM.<p>6. Their naming scheme is cumbersome, e.g. data-controller=&quot;using-a--sub-directory&quot; and data-target=&quot;some--nested--target-has-a.function&quot;, that is, the fact that everything is location-in-your-code-file-structure based.<p>And a lot of other small things.<p>Ironically, using Stimulus convinced me to switch to Vue because I liked their value proposition of &quot;Javascript sprinkles for your HTML&quot;, which Vue lets me do, but more intuitively.
评论 #25310354 未加载
评论 #25312773 未加载
评论 #25312741 未加载
cutler超过 4 年前
I have great hopes that Stimulus 2.0 and Ruby 3.0 will put Rails back in the spotlight as the sane alternative to SPA abuse. Ruby and Rails have some really talented people on their teams and there&#x27;s something special about the Ruby language which makes it such a fertile environment for innovation. Only Clojure compares in this respect.
评论 #25309698 未加载
评论 #25310864 未加载
评论 #25313099 未加载
评论 #25309968 未加载
mike1o1超过 4 年前
Stimulus has a very small surface area, but I find it really enjoyable to use when combined with Turbolinks.<p>My only complaint&#x2F;comment is that some of the HTML that I need to generate ends up being littered with so many data attributes, especially when combining multiple Stimulus controllers&#x2F;behaviors.<p>Has anybody found a clean way around that in Rails templates?
评论 #25307084 未加载
评论 #25306154 未加载
评论 #25307074 未加载
catwind7超过 4 年前
We adopted stimulusjs a couple of years ago for adding some basic interactivity on our pages and it was a decent tool, but we quickly grew out of it once we started adding more complex (form based) front-end behavior involving lots of state changes. We&#x27;re currently trying to migrate a significant amount of stimulus code over to react.<p>Not knocking on stimulusjs, but just be wary that it does not grow well with increasing client side complexity. You&#x27;ll end up writing a lot of javascript boilerplate &#x2F; DOM manipulation code &#x2F; custom state management components. From my experience, it&#x27;s a nice lightweight tool for when you:<p>1. Just need to add some light interactivity (toggling visibility of components, any basic view filtering) that do not involve a lot of logic 2. Don&#x27;t need j.s unit tests (stimulus has not been the most testable tool - we lean mostly on integration tests).
评论 #25311006 未加载
评论 #25312189 未加载
gerry_shaw超过 4 年前
Unpoly <a href="https:&#x2F;&#x2F;unpoly.com" rel="nofollow">https:&#x2F;&#x2F;unpoly.com</a> is also worth a look if you are interested in these things. It combines Turbolinks and Stimulus functionality in a very usable way.
评论 #25308512 未加载
评论 #25312470 未加载
评论 #25309375 未加载
dang超过 4 年前
If curious see also<p>2018 <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=16052105" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=16052105</a><p>2018 <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=16443860" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=16443860</a><p>2018 <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=17834514" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=17834514</a>
vmsp超过 4 年前
See also GitHub Catalyst<p><a href="https:&#x2F;&#x2F;github.github.io&#x2F;catalyst&#x2F;" rel="nofollow">https:&#x2F;&#x2F;github.github.io&#x2F;catalyst&#x2F;</a>
stepbeek超过 4 年前
I love Stimulus and am super happy to see this update.<p>It’s encoding conventions that we’ve fallen into using it for the last year. The callbacks in value changes are going to make my life much easier.
lostfocus超过 4 年前
And just when Symfony announced their preferred way of doing frontend work is based on Stimulus, too. Great timing.
评论 #25310405 未加载
correlator超过 4 年前
Stable, efficient and intuitive. Thank you to the stimulus team!
tpetry超过 4 年前
Now i am waiting for the next turbolinks release. Their hey.com service has some interesting turbolinks extensions: <a href="https:&#x2F;&#x2F;dev.to&#x2F;borama&#x2F;a-few-sneak-peeks-into-hey-com-technology-iii-turbolinks-frames-5e4a" rel="nofollow">https:&#x2F;&#x2F;dev.to&#x2F;borama&#x2F;a-few-sneak-peeks-into-hey-com-technol...</a> and following
obiefernandez超过 4 年前
Good timing. There was talk of a fork brewing...
评论 #25306034 未加载
osxman超过 4 年前
This is good news. I work for 6 months with StimulusJS 1 and I&#x27;m very happy to use it. I use it mainly in a rails app combined with Turbolinks.<p>My original thought was to go for an SPA with a rails API backend. I tried out both React &amp; Vue extensively but got stuck in a while. Since implementing Rails and plain &#x27;vanilla&#x27; JS it went better. But with StimulusJS 1+ it went simply great.<p>Allready upgraded to 2.0 and it feels even more structured with the new features, like values and improved targets.
cutler超过 4 年前
What&#x27;s the difference between Pjax and Turbolinks? Just a generic version of the same thing? Could Stimulus [Reflex] be hacked to work with Django or does it have strong ties to Rails?
评论 #25310731 未加载
评论 #25311954 未加载
评论 #25312946 未加载
shay_ker超过 4 年前
Is there a convincing Stimulus vs. React-Rails post anywhere?
评论 #25306949 未加载
评论 #25306396 未加载
评论 #25307306 未加载
评论 #25306703 未加载
yborg超过 4 年前
Is there a good comparison summary of the major JS frameworks available somewhere?
评论 #25309148 未加载
jdhornby超过 4 年前
If anyone is interested in “the magic” DHH is talking about, this is a fantastic resource: <a href="https:&#x2F;&#x2F;dev.to&#x2F;borama&#x2F;a-few-sneak-peeks-into-hey-com-technology-iv-turbolinks-frames-continued-2bn" rel="nofollow">https:&#x2F;&#x2F;dev.to&#x2F;borama&#x2F;a-few-sneak-peeks-into-hey-com-technol...</a>
ksec超过 4 年前
Is Stimulus 2.0 the NEW MAGIC DHH was referring to? I was expecting something much bigger.
评论 #25306710 未加载
评论 #25306697 未加载
Drakula2k超过 4 年前
Nice to see that it keeps improving.
Scarbutt超过 4 年前
<i>A modest JavaScript framework for the HTML you already have</i><p>Are they implying one shouldn&#x27;t use it if you don&#x27;t have any HTML already?
评论 #25307050 未加载
评论 #25307089 未加载