-
Notifications
You must be signed in to change notification settings - Fork 160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document or fix known issues with this demo #13
Comments
Also I noticed a lot of |
Thank you for opening this issue Dan! Same as what you mentioned in reactjs/server-components-demo#57, this demo isn’t intended to reflect the performance or behavior of a real app too. We will add a note in the README soon. The main goal of this demo was to demonstrate the “streaming” feature, so there are noticeable spinners and even some manual slowdowns. We’ve considered For the additional server request and the Thanks again! |
This seems unfortunate because it conflates streaming of data (good) with unpredictable streaming of UI (bad). Perhaps HN is not the right app to demonstrate this since no reasonable designer would place a spinner around every link. My worry is that this demo creates a perception that streaming of UI is essentially uncontrollable. Do we have any ideas on how to resolve this? Is streaming the whole “page content” at once (but separate from the page shell) not sufficient to demonstrate streaming? Is this example fundamentally flawed as a streaming demo? Come to think of it, it seems rather inefficient that we assemble the front page from 20 requests anyway. I don’t believe a real HN implementation would work this way. Was the data fetching split into multiple requests for the purpose of this demo, or is requesting individual items the only API exposed by HN? |
Let me try to rephrase my concern from the other end. I understand the intention is to demonstrate streaming. However, from the user’s perspective, the purpose reads as “build the best possible HN client with RSC”. Similar to how a framework’s TodoMVC reads as a canonical way to build TodoMVC in it, regardless of the author’s intent. So any flaws in this example (especially significant flaws in the UX) will be taken as flaws in the paradigm itself — especially now that the demo exists “as is” without the surrounding keynote. I’ve spoken to a few people and they were all surprised that this demo isn’t meant to show “best practice”. How can we address this? |
Unfortunately it is the only way with the public API of HN I can find. One good way to improve the demo is to only show the spinner for the list container but not the individual items, as you proposed. And when there is |
Can I ask you to look into this? I imagine y’all are pretty busy but this seems important, and the issues I noted while trying to do it myself also seem a bit worrying. So it seems like maybe this could also help uncover some bugs in the process. Thanks for considering — and really appreciate such a snappy response. |
Fixed in #15 and you saw it already :) Thanks for the help BTW! |
I'm sorry to chime in, but I couldn't help to imagine Andrew Clark's reaction to so many spinners when I saw this demo for the first time (and I don't know him, I just thought of his Suspense presentation about the "spinner hell"). After seeing the code, I think I got the idea from a technical point. But from an end user's experience, this is not great to impress any "boss" to adopt RSC. Something like the "canonical" Notes App running in NextJS would be more helpful and educational. |
Yes we are working on that one as well. Thanks for the great feedback here :) |
As a follow-up, here's a list of the issues I'm currently aware of in this demo:
|
Thanks for putting those together @gaearon! For those who want to track updates of these items, or jump into more detailed technical discussions, here's a list of these issues (and how are we gonna resolve them) in the Next.js repo. So feel free to subscribe or share feedback there:
|
@gaearon I think it would be preferable if React were (even more) adaptive to backpressure (cc @sebmarkbage). Then, this sort of this could be achieved by just supplying constant backpressure in a server that doesn't support streaming. We previously opened facebook/react#22726 to address one part of this, to prevent React from starting to write to a stream if it's already full. Another PR that would be needed is for React to write to the buffer and close the buffer regardless if it's full, if the render is completely finished. (We also opened facebook/react#22350 to add our own stream abstraction to work around some of these things ourselves, but it has gone stale) |
Hey everyone! To give an update here, most of the critical issues mentioned above by @gaearon have been fixed in the latest Next.js, and the demo is also upgraded to use
Let me know if you have any questions! |
Another update: compression is now enabled automatically, the demo is also upgraded to React RC.1. |
@huozhi Do you plan to work on other items or do you need some help there? Would be nice to fix before there's renewed interest. |
I sent a PR for the loading stuff. #67 |
@gaearon Thanks for bringing up these issues, the hydration errors is already patched. Will take a look at the rest ones with team 🙏 |
I've fixed this in vercel/next.js#48986, details on why it happened are on the PR. Upgraded the demo to the latest version. |
I've merged #67 which updates to latest canary. Let's see what other issues are left. Weird scroll on small screen heightsTo repro, use small screen height. wat.movDisappearing content
Expected: it waits for content, then navigates to the first page. Pressing back navigates back to the story. This is probably related: Can't fetch a large pageNote: this doesn't repro after c7c6818, but presumably it's still a bug since you might want
|
Is this part being considered? Or are the remaining tasks abandoned? 😢 |
I believe everything in this thread is now addressed (repo is on the latest Next.js version now as well). Anything I'm missing? |
I'm starting to see this demo being used in performance comparisons in a way that implies this is the canonical RSC experience. It would be good to either solve or document (in README) concrete issues with it so that a future reader has an idea of what's correct and what's a known issue. (I've added reactjs/server-components-demo#57 to the original demo in the same spirit.)
Update
The up-to-date list of problems (likely non-exhaustive) is here: #13 (comment)
Streaming "Jank"
This demo shows each story "streaming in" individually:
bad_ux.mov
This is a rather janky user experience.
I am guessing that this demo does it to make the "streaming" aspect obvious. However, I am observing that people take away that this jankiness is what we mean by "streaming". It seems like a rather unfortunate consequence if people's takeaway becomes that apps built with Server Components have pieces randomly "popping in" — especially because the whole point of the
<Suspense>
model is to give you precise control over what's allowed to "pop in" individually vs what pieces must "pop in" together.How to fix it?
If I understand correctly, there are multiple ways to fix this:
Remove this
<Suspense>
boundary so that all stories "pop in" at once. Despite delaying the display, this is a much better user experience because there's no content layout shift, and individual jumping rows aren't useful anyway.<Suspense>
boundary breaks hydrationAlternatively, use
<SuspenseList>
, replace a spinner fallback with null, and hide the tail, so that you only see stories appearing "in order". This is currently out of question because<SuspenseList>
won't be in 18.0 and will come later in 18.x. It's not currently implemented on the server.Additional server request
I am seeing an extra request to the RSC entry point from the client after the page loads:
I wouldn't expect the initial page load to need to make any additional requests. Do we understand why it happens? Is this a bug or a known limitation of the current demo?
Thanks
I very much appreciate the work on this demo. I'm hoping we can fix and/or document the issues in it so that people are aware what's missing and don't make an impression of the overall RSC architecture or user experience based on an early demo.
Thanks!
The text was updated successfully, but these errors were encountered: