Hacker News new | ask | show | jobs
by vidarh 919 days ago
> React components form a tree that mirrors the DOM. A graph is a much better fit.

Not all acyclic graphs are trees, but all trees are acyclic graphs. As such this part of your description is confusing.

Your last paragraph does a much better job at explaining how it differs.

1 comments

I put a concrete example in the sample app. "pizza" depends on "size" and "base". So a DAG, as you point out, is less constraining than a tree. When you shoehorn your state and orchestration into react components, not only do you have to fit them into a tree, it's fundamentally the wrong tree.
I'd suggest you emphasize that near the top of your README, maybe with a cleaned-up version of the generated graph and some annotation of the data flow. To put it a bit pointedly, "nobody" will care about the data structure until they see that it means they don't have to manually thread data down through the right branches of a tree. That's your big selling point.
Good suggestion.