I believe recommending everyone to go straight for fetch-as-you-render regardless of complexity costs is endorsing premature optimization.
This was going to be a nuanced blog post, but I don’t have time to write it, so you get a thread 👇
Caveat: Fetch-on-render is very different from fetch-inside-component. The latter one WILL get you in trouble with Concurrent Mode. You DO need to externalize the fetch itself.
I think the messaging around Suspense being a way to wait for data, and not trigger it, undersells it in fear of waterfalls we have always been dealing with in React. The complexity reduction/DX/productivity increase for a subset of server side rendered apps could be huge.
The new Suspense docs highlight that you should not use it to start a fetch in render, that should be hoisted to avoid waterfalls.
This is good advice, but adds a lot of complexity and many perfectly usable apps have waterfalls today. Make it work -> make it fast?
I wonder if the team see any unique challenges around waterfalls with Suspense, or if it’s just that they feel compelled to point this very central problem out clearly now that they are starting to prescribe solutions for data fetching?
After finally getting to meet him in person this conference I can only echo every single word here, I too feel lucky. How @swyx achieves all that he does, while being so thoughtful and friendly about sharing it is mindblowing. 10/10 person, would recommend.
So @swyx just donated a whopping $10,000 to @freeCodeCamp
The more I get to know him, the more impressed and lucky I feel to have gotten the chance to meet him. An extremely humble & talented guy. Thanks @swyx for consistently and selflessly making the community a better place.
btw @kenwheeler on stage googling the useCallback documentation to fix an issue is the most advanced thing.
We all do it, and we shouldn't feel that is "cheating".
(if you need further reassurance, check out @type__error's blogpost about it!)
#reactAdvanced
Meeting and talking to so many great people at #ReactAdvanced once again made me realize everyone has their own perspective, and their own story, and every single one is so worthwhile listening to. I learned a lot from all of you! ❤
Exhausted and happy.
Talking about rocking it on stage, @emmabrillhart just nailed her talk at #ReactAdvanced on how TypeScript, GraphQL and Hooks can help readability in codebases. 🎯💯
Readability is often overlooked, but probably the most important thing with these new techs.
Today, we're excited to share the first early community preview of Concurrent Mode. It offers new composable primitives to help you orchestrate delightful user experiences. reactjs.org/concurrent
Tonight I experimented with getting out of order SSR-streaming working in react-lightyear, inspired by @acdlite's Zeit-day talk.
This is very unlikely to ever land in Lightyear proper, but fun to play with!
The ReactSuspenseServerRenderer used in that talk is waay prettier than my experiment of course, reading the code I'm very impressed about the amount of work that went into it.