TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

React Suspense

92 点作者 selbekk超过 5 年前

12 条评论

ehnto超过 5 年前
I don&#x27;t know that I will ever be happy with lazy loaded UIs over a more traditional &quot;Deliver everything first, update later&quot; approach. Hopefully Suspense is a step to solving the problem.<p>I live in Australia, so there&#x27;s a perceptible ~300ms delay for every action in react-like loaded later UIs that aren&#x27;t hosted in Australia, which is most of the tools that I use. They feel clunky and broken, and the amount of times you miss-click because something pops in suddenly and moves the button you wanted down the page. I don&#x27;t think it&#x27;s the UI they think they&#x27;ve built.<p>I don&#x27;t think it will ever be good enough to throw 20 requests and wait for everything to update, bounce the page around and at long last be intractable. I would rather receive a 2mb page right now, than a 200kb page that slowly grows to a 2mb page over the course of 20 components individually loading themselves.
评论 #21712180 未加载
评论 #21712278 未加载
评论 #21712357 未加载
评论 #21712301 未加载
评论 #21714199 未加载
评论 #21713034 未加载
评论 #21718177 未加载
评论 #21712867 未加载
ljoshua超过 5 年前
So I&#x27;m not entirely clear on the advantage that Suspense has over the typical pattern of loading data in componentDidMount, and just having a bit of logic that checks whether your data has loaded or not and renders the spinner or the actual contents. It&#x27;s not really a hard pattern to implement, though sure, it takes a few extra lines. Seems like the &lt;Suspense&gt; component just kind of abstracts this a bit? What am I missing?
评论 #21713591 未加载
评论 #21715248 未加载
评论 #21713059 未加载
评论 #21716610 未加载
eknkc超过 5 年前
I feel like Suspense has been in development for a decade now. I know, I know.. They should not release it until they are comfortable about its stability. But still, all the teasers and pushed back roadmaps are not helping at this point.<p>This is because I feel like it&#x27;s gonna be great for our apps and can&#x27;t wait to try it on production though.
评论 #21712748 未加载
评论 #21711312 未加载
评论 #21712303 未加载
hkh28超过 5 年前
Interesting introduction to suspense, didn&#x27;t know about it. A word of caution might be that it is still an experimental feature [0], so you should probably not be throwing it into production just yet. But when it gets released as stable, it could really improve a lot of sites!<p>[0] <a href="https:&#x2F;&#x2F;reactjs.org&#x2F;docs&#x2F;concurrent-mode-suspense.html" rel="nofollow">https:&#x2F;&#x2F;reactjs.org&#x2F;docs&#x2F;concurrent-mode-suspense.html</a>
GrazeMor超过 5 年前
It&#x27;s weird how the article mentions that before Suspense there was a waterfall issue. But as far as I understand Suspense introduces the waterfall issue. If you have nested components that need data, the data has to load serially rather than in parallel which creates a waterfall and React devs don&#x27;t seem to know how to fix this issue.
评论 #21713842 未加载
评论 #21715842 未加载
cotelletta超过 5 年前
I hate tutorials that don&#x27;t explain you how something is actually implemented in the framework, as if you don&#x27;t need to know your own tools.<p>I&#x27;m inferring suspense is based on exceptions to interrupt unrenderable components, but it would be nice if the author told me.
评论 #21712740 未加载
评论 #21711694 未加载
评论 #21711882 未加载
girvo超过 5 年前
React Suspense, with hooks and fp-ts has given our team a massive leg up in terms of rapidly building out our products new front ends. Being able to combine typed functional programming with the functional-like abstractions given to you by React nowadays makes for a very nice, very straightforward to debug app, without bringing in dozens of dependencies to get this behaviour.<p>Ant Design has also been a game changer for us.
评论 #21712874 未加载
iamleppert超过 5 年前
This pretty much sums up why I’m making my way away from web development in general.
评论 #21733697 未加载
mesaframe超过 5 年前
&gt;will become a game changer when it comes to data fetching.<p>Every other technology ever.
thebradbain超过 5 年前
This looks super cool, and I can immediately see how it&#x27;d be immediately useful in production apps both because of potential use-cases and how straightforward it seems to integrate. Is there anything similar in development within Vue land, or is this intrinsically tied to the React render model?
typon超过 5 年前
What&#x27;s the difference between this and using Apollo Graphql for requests?
评论 #21712526 未加载
评论 #21713065 未加载
sudhirj超过 5 年前
Are we actually doing one domain and website per blog post now?
评论 #21711300 未加载
评论 #21711274 未加载