This is a great example of "simple is better than easy". It always seems so easy to "just make a callback" in JavaScript/UIs but when things go beyond a very simple UI component things go downhill, FAST. This sort of callback dependency nightmare is so common in workflows adopted by many JavaScript/UI frameworks. It's scary and sad at the same time.
I encourage any JavaScript developer to seriously take a look at ClojureScript + React + core.async for front end development. Not a silver bullet, and there's the learning curve of a new language, but definitely better tools to build the foundation for an asynchronous & inherently complex UI. If the problem/project you're solving/working on is not trivial, the payoffs are there.
> It always seems so easy to "just make a callback"
DOM interactions are callback oriented. That's how the DOM is built. That's why people write callbacks at first place. Why would you want people to work differently? the api is what it is. You might think the api is broken, well, it's not the front end developers fault, they didn't write the spec.
> but definitely better tools to build the foundation for an asynchronous & inherently complex UI.
React and CO are DOM abstractions. Which is fine if you know how the DOM works at first place. The problem is most people don't bother learning how the damn thing really works.
But at the end of the end of day, no front end developer can escape from JavaScript or the DOM. When things break,you still have a big JavaScript stack trace with DOM errors to debug,language A or B,framework X,Y,Z or not.
I agree with you that there's no escaping the fundamental way the DOM/JavaScript was setup in the first place - it's too late unfortunately, that ship sailed in the 90s apparently :). I can write at least an article about this stuff, but if you're interested in how core.async specifically helps at least mitigate some of the callback spaghetti hell here's a good starting video https://www.youtube.com/watch?v=AhxcGGeh5ho
I encourage any JavaScript developer to seriously take a look at ClojureScript + React + core.async for front end development. Not a silver bullet, and there's the learning curve of a new language, but definitely better tools to build the foundation for an asynchronous & inherently complex UI. If the problem/project you're solving/working on is not trivial, the payoffs are there.