Live data from Hacker News

Stimulus.js 2.0

discourse.stimulusjs.org

101–110 of 140 posts

Re: Stimulus.js 2.0

#101

Earlier quoted context omitted.

It feels very much like Knockout which reminds me of the same frustrations

Huh? I think Knockout.js was awesome for its time! To me, Vue.js feels like Knockout’s spiritual successor. What did you find frustrating about Knockout?

Knockout still is awesome. Very low friction to knock stuff out.

Re: Stimulus.js 2.0

#102

Earlier quoted context omitted.

What UI behaviors necessitated you to move beyond stimulus? Could you provide an example?

Sure! One typical example is a component that collects (and displays) education history provided by the user. I'll list out just a few key UI behavior: * A "read" view which represents a list of containers with titles that show each instance of a users answer (for example, if you provided 5 sets of answers, such as 5 universities you attended, we need to show those 5 in some sort of preview form on the page) * A butt…

Do you think Github.com UI is complex? They are using a very similar approach to Stimulusjs: https://github.github.io/catalyst/

And it's working great?

Re: Stimulus.js 2.0

#103

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 ?

In the above stack LiveView doesn’t play that well with web components that render their own children, as it will remove those children when it rerenders. So you do kind of need shadow DOM.

Re: Stimulus.js 2.0

#104
post #55

What'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?

Stimulus Reflex already have a Django counterpart that uses the Stimulus Relex js and conventions. The package is django-sockpuppet.

Re: Stimulus.js 2.0

#105

Earlier quoted context omitted.

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.

[deleted]

Re: Stimulus.js 2.0

#106

Earlier quoted context omitted.

But you get blank page until js kicks in?

Not if you use Gatsby or NextJS and get server side rendering out of the box

Why backend of web development is narrow down to nodejs server? How about people who use Rust/Python/Ruby/Elixir/PHP?

Re: Stimulus.js 2.0

#107
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.

I've got even greater hopes for the NEW MAGIC that @dhh has been hinting about

Apparently Stimulus 2.0 is part of that directional change

Tweets: https://twitter.com/dhh/status/1334916143010680833?s=20

Re: Stimulus.js 2.0

#108

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're currently trying to migrate a significant amount of stimulus code over to react. Not knocking on stimulusjs, but just be wary that it does not grow well with increa…

I believe even Basecamp (or one of their products) uses React on a more complex interaction.

Source? They never hinted anything like that.

Re: Stimulus.js 2.0

#109

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…

Doesn’t vuejs require you to keep your state in a store object (data: {}) and render html via js though?

No, you can just use normal HTML, add some vue-specific stuff and then treat that HTML as Vue app.

It’s how people use Vue as a jQuery replacement.

Re: Stimulus.js 2.0

#110
post #90

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.

Happy unpoly user here too. I think it is way better than stimulus, turbolinks, htmlx, alpine, etc. Just doesn't have as good marketing as those.

> Just doesn't have as good marketing as those.

And maybe documentation too. Turbolinks has really good docs and conceptually it's pretty easy to get going (1 line of JS and learning a few event handlers). Alpine and StimulusJS have really good docs / guides and tons of practical examples if you Google for a specific problem you're trying to solve.

Unpoly's docs seem like it's mostly an HTML front-end to their API spec with very few examples. It's kind of difficult to figure out how to use most of what it does. There's also very little practical examples of using it if you Google around.

I've heard of it in the past but never got into it because of the above.

Post reply on HN