Live data from Hacker News

Stimulus.js 2.0

discourse.stimulusjs.org

61–70 of 140 posts

Re: Stimulus.js 2.0

#61
post #51

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's something special about the Ruby language which makes it such a fertile environment for innovation. Only Clojure compares in this respect.

SPA abuse is the predictable and highly unimaginative result of framework overuse. Hoping a different framework will somehow be a solution is exceedingly optimistic.

Re: Stimulus.js 2.0

#62

Alpine.js is worth a look as well [1]. I've been working with it as part of the newly christened "PETAL stack" [2] of Phoenix, Elixir, Tailwind, Alpine.js, and LiveView. [1] https://css-tricks.com/alpine-js-the-javascript-framework-th... [2] https://thinkingelixir.com/podcast-episodes/021-tailwind-css...

I've also been playing with Alpine, but on the also-newly-christened "TALL stack" [1] of Tailwind, Alpine.js, Laravel, and LiveWire. It's also worth a look.

[1] https://tallstack.dev

Re: Stimulus.js 2.0

#63
post #54

Earlier quoted context omitted.

Rails is already the sane alternative. Any full stack framework is. DotNet, Laravel, Django, Rails... If you think you need a JS framework to handle your UI, you've already lost, and you're doomed to reinventing wheels that these technologies have already perfected.

Isn't Stimilus a JS framework?

StimulusJS is one step up from JQuery and formalizes a lot of jQuery patterns that I'd come across - data-target, data-event attributes, etc.

Re: Stimulus.js 2.0

#64

I worked with Stimulus for about a month and found it to be frustrating: 1. There is not a lot of documentation 2. They don't provide any testing guidelines, the best I've found is hand-wavy test-with-a-browser stuff 3. Everything is essentially global 4. Functions are disconnected from their parameters, i.e. I can't tell which bits of data a function is using without digging through a bunch of code. 5. Putting state…

Ditto. I think if you are an experienced web app dev, understand the pros and cons of something like Stimulus, and set out from the beginning of your project to make PRODUCT decisions within the constraints of something like Stimulus and being more SSR. Then it is a great tool.

Anything more complicated though, and you are better off with Vue, React, Etc

Re: Stimulus.js 2.0

#65
post #51

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's something special about the Ruby language which makes it such a fertile environment for innovation. Only Clojure compares in this respect.

SPA abuse is the predictable and highly unimaginative result of framework overuse. Hoping a different framework will somehow be a solution is exceedingly optimistic.

[deleted]

Re: Stimulus.js 2.0

#66

Earlier quoted context omitted.

Stimulus is paired with Turbolinks, which doesn't play well with almost anything in the JS ecosystem.

This used to be accurate in the days of auto initializing jquery plugins, but probably isn’t the case today if you’re actually using stimulus.

It still is problematic if you use third party plugins / saas vendors.

Not all. But many. Things like zendesk integrations for example. YMMV

Re: Stimulus.js 2.0

#68

Earlier quoted context omitted.

> "PETAL stack" of Phoenix, Elixir, Tailwind, Alpine.js, and LiveView Oh, finally a hipster stack after my own heart. My initial stack used Web Components instead of Alpine.js, but after one year trying to make it work (using lit-element) I'm battered, bruised and I declare Web Components a failed piece of technology [1]. Alpine is interesting, but not powerful enough for my use case, which is encapsulating common UI…

Shadow dom is optional for web components, web components are still useful without it, so I hardly see how that could be a reason for "failed piece of technology". Also, did you try with pure JS ? no lit ? I just removed StencilJS from my component to go pure-JS and it turns out I really prefer it that way, maybe it would suit you too to do WC without any additional JS lib ?

> Shadow dom is optional for web components

Not the OP, but slots are part of the shadow DOM spec, so if you don’t want isolated styles, you have to forego slots.

I tend to build my app scaffolding with wrapper components that provide layout and/or functionality to their child components via slots, so as much as I like the idea of WebComponents they’re a complete non-starter for me.

Re: Stimulus.js 2.0

#69

Alpine.js is worth a look as well [1]. I've been working with it as part of the newly christened "PETAL stack" [2] of Phoenix, Elixir, Tailwind, Alpine.js, and LiveView. [1] https://css-tricks.com/alpine-js-the-javascript-framework-th... [2] https://thinkingelixir.com/podcast-episodes/021-tailwind-css...

> "PETAL stack" of Phoenix, Elixir, Tailwind, Alpine.js, and LiveView Oh, finally a hipster stack after my own heart. My initial stack used Web Components instead of Alpine.js, but after one year trying to make it work (using lit-element) I'm battered, bruised and I declare Web Components a failed piece of technology [1]. Alpine is interesting, but not powerful enough for my use case, which is encapsulating common UI…

> Any other suggestion for lightweight rich JS components that do not require one to buy into Vue, React or other "full-stack" JS libraries?

Depending on your needs, you can sort of use Alpine + server-side templating to achieve this. While Alpine itself has no concept of components, you can define a template fragment that consists solely of the “component” for basically the same effect. Because the x-data directive is freshly evaluated each time it appears, you can include a fragment multiple times and get isolated “instances”.

YMMV though, I eventually found that because templating is much more simplistic than a real tree of components as you would get with Vue or React, things started getting hard to follow, especially when my “components” were nested, or involved approximating slots.

Ultimately I converted to Inertia.js, which is a very small glue library that lets me write the whole front end in Vue (or React, or Svelte) while keeping a more traditional Laravel (or Rails) backend.

Re: Stimulus.js 2.0

#70

Alpine.js is worth a look as well [1]. I've been working with it as part of the newly christened "PETAL stack" [2] of Phoenix, Elixir, Tailwind, Alpine.js, and LiveView. [1] https://css-tricks.com/alpine-js-the-javascript-framework-th... [2] https://thinkingelixir.com/podcast-episodes/021-tailwind-css...

PETAL is a good name! I was calling it TAPE (Tailwind, Alpine.js, Phoenix, and Elixir) http://tapestack.party
Post reply on HN