3 ms·
Holy hell. I didn't realize this. This is nightmare fuel and the blog post you linked is leveling some really good criticism. My favorite part is where he linke
by ethanwillis 7y ago
Holy hell. I didn't realize this. This is nightmare fuel and the blog post you linked is leveling some really good criticism. My favorite part is where he linked to a Github issue where the React team instead of responding with a real answer just repeated their manta "Suspense will solve everything" and closed the issue. I know "open source devs don't owe you anything." But I've noticed that sentiment is now being used in a lot of open source projects, especially the well funded ones by big Corps, to just shutdown anything that derails whatever their underlying motivations are.
I mostly abandoned the effort and any sort of greenfield React development, when I
came to understand what Suspense was and how unwieldy it would have been to
incorporate Suspense into the hooks I had written. As of April 2020, the mechanism
behind Suspense is for components which make async calls to throw a promise while
rendering to indicate that the component is doing something asynchronously.
“Throw” as in the way you would “throw” an error in JavaScript with the throw
operator. In short, React will attempt to render your components, and if a
thenable is thrown in the course of rendering, React will catch it in a special
parent component called Suspense, render a fallback if sufficient time has
elapsed, and then when the promise has fulfilled, attempt to render the component
again. I say “as of April 2020,” because the React team has consistently said the
exact details of the Suspense API might change, and has used this declaration to
preempt any possible criticisms of this mechanism
- hombre_fatal 7y agoWell, I don't think this is fair, either. As someone points out in the thread before making some good points to OP, this topic is discussed ad nauseam in React's github issues and elsewhere. There are many good discussions online about this and all the different solutions out there with different trade-offs. And the Suspense system is what the React team came up with to solve it. I don't see how someone wanting to rehash the discussion requires any other answer than "we're solving this with X, it's just not yet available." This is one of the most common trope of any sort of forum system, github issues included: everyone thinks they're the first person to broach a topic, yet everyone else has seen it 1000s times.