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.
Stimulus.js 2.0
61–70 of 140 posts
Re: Stimulus.js 2.0
#62Alpine.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...
Re: Stimulus.js 2.0
#63Earlier 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?
Re: Stimulus.js 2.0
#64I 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…
Anything more complicated though, and you are better off with Vue, React, Etc
Re: Stimulus.js 2.0
#65I 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
#66Earlier 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.
Not all. But many. Things like zendesk integrations for example. YMMV
Re: Stimulus.js 2.0
#67And just when Symfony announced their preferred way of doing frontend work is based on Stimulus, too. Great timing.
Re: Stimulus.js 2.0
#68Earlier 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 ?
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
#69Alpine.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…
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
#70Alpine.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...