Sounds like a really interesting project! I have so many thoughts about this, but I don’t have a lot of time for a proper reply today. I’ll give the short version — let me know if you want a follow-up!
One aspect that I think causes some confusion when people start to experiment with Stimulus is when they compare it with component-based frameworks like React and Vue. Stimulus is not an MVC framework by design. It’s a fundamentally different idea. It’s my impression that many people coming from the MVC world are stuck in a “reactive” mindset, and start to treat their controllers like components, which is the wrong level of abstraction and might make them quit early.
When you try to make controllers communicate in a programmatic way, things start to hurt, because Stimulus was designed to be declarative. When Stimulus eventually implements a solution for binding controllers together, it’ll be declared on the element in the DOM. As Sam puts it:
What we want is a way to declaratively link two controllers together in HTML, plus some sort of callback that’s invoked when the link is established and both controllers are initialized.
The method which is responsible for fetching other controller instances programmatically (
getControllerForElementAndIdentifier) is in the private API, it’s undocumented and has an intentionally long name to discourage its use. Still, it seems to be used quite a bit.
My hopes are that anti-patterns like using
getControllerForElementAndIdentifier will start to fade when the delegated property API is in place.
Anyway, that’s my two cents. I look forward to reading your blog