Live data from Hacker News

Stimulus.js 2.0

discourse.stimulusjs.org

31–40 of 140 posts

Re: Stimulus.js 2.0

#32
I love Stimulus and am super happy to see this update.

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.

Re: Stimulus.js 2.0

#33
post #13
post #10

Earlier quoted context omitted.

I think the much touted "NEW MAGIC" will be the thing that does the automatic content refresh.

> I think the much touted "NEW MAGIC" will be the thing that does the automatic content refresh. The StimulusJS handbook has an automatic content refresh example at https://stimulusjs.org/handbook/working-with-external-resour... . As for NEW MAGIC, DHH mentioned it will have a Rails server side aspect to it so I don't think we can compare these tools directly. He did say other server side frameworks could implement s…

The new turbolinks they use on hey.com is using a concept named „portals“ so different parts of the web application can be refreshed independently. My linked inside hey.com articles are very interesting.

Re: Stimulus.js 2.0

#34
post #33
post #13

Earlier quoted context omitted.

> I think the much touted "NEW MAGIC" will be the thing that does the automatic content refresh. The StimulusJS handbook has an automatic content refresh example at https://stimulusjs.org/handbook/working-with-external-resour... . As for NEW MAGIC, DHH mentioned it will have a Rails server side aspect to it so I don't think we can compare these tools directly. He did say other server side frameworks could implement s…

The new turbolinks they use on hey.com is using a concept named „portals“ so different parts of the web application can be refreshed independently. My linked inside hey.com articles are very interesting.

Yeah that's the interesting part. It sounds like maybe there will be some overlaps in Turbolinks 6 and NEW MAGIC when it comes to partial updates.

Maybe for basic partial page updates where you don't need to broadcast something to every connected client over websockets then Turbolinks 6 will be enough on it own. If that ends up being the case that's amazing because it'll be fully client side.

In any case the near future is looking to be the best its ever been for developing very nice feeling apps without going the SPA route with any back-end technology.

Re: Stimulus.js 2.0

#35

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 behaviours in reusable packages. Stimulus seem to be the missing ingredient in the mix for me. Any other suggestion for lightweight rich JS components that do not require one to buy into Vue, React or other "full-stack" JS libraries?

Also, I wholeheartedly recommend Unpoly as well, fits nicely in the PETAL stack.

1: shadow DOM isn't great on your OWN components, styling isn't fun paired with global CSS/tailwind, dealing with properties/attributes/observables/reactivity in general is an absolute pain in the buttocks, good luck wrapping an in a web component.

Re: Stimulus.js 2.0

#39

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…

Have you checked out Surface [1]? In a recent interview [2] Chris McCord hinted at merging at least some of Surface into LiveView.

[1] http://surface-demo.msaraiva.io

[2] https://thinkingelixir.com/podcast-episodes/024-liveview-upl...

Re: Stimulus.js 2.0

#40

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.

My killer unpoly features:

* easy AJAX loading like turbolinks ()

* easy AJAX modal ()

* submit a form whenever any input changes ()

* respects the way HTML is intended to be used, so the page still works even when JS is disabled

Post reply on HN