Live data from Hacker News

Stimulus.js 2.0

discourse.stimulusjs.org

41–50 of 140 posts

Re: Stimulus.js 2.0

#42

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…

Consider redom, mithril, snabbdom, riot.js, lighterhtml or even svelte.

Re: Stimulus.js 2.0

#44
post #24

Is there a convincing Stimulus vs. React-Rails post anywhere?

They are both JS frameworks, but they are fundamentally different approaches. React (and React-rails) moves rendering / state / logic clientside. You can use tools like react-rails to more easily pass data from your Rails controller to your react components (basically conveniences to create props from instance variables). Stimulus doesn't handle rendering at all. It's intended to be used for small little "sprinkles"…

What you are describing seems similar to good old BackboneJS?

Re: Stimulus.js 2.0

#45

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…

React is great though, why not just use that?

Re: Stimulus.js 2.0

#46

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…

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 ?

Re: Stimulus.js 2.0

#48

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…

React is great though, why not just use that?

because then you need an api

Re: Stimulus.js 2.0

#49

Unpoly https://unpoly.com is also worth a look if you are interested in these things. It combines Turbolinks and Stimulus functionality in a very usable way.

Wow! Thanks, that looks quite useful. Especially that it can work with all kinds of back ends.
Post reply on HN