Skip to content
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

Use an intentional loading sequence #67

Merged
merged 8 commits into from
May 3, 2023
Merged

Conversation

gaearon
Copy link
Collaborator

@gaearon gaearon commented Apr 28, 2023

This makes the demo feel more aligned with the UX expected from HN:

  • I removed the loading "shell" for the front page and for the story page. It looked okay on the front page, but only for the first load. For switching pages, it didn't feel good. For the story page, the shell was entirely wrong because the glimmer does not remotely match the content.
  • I kept the Suspense boundary around comments. I've adjusted it to not show "Loading comments" (that much is obvious) and to match the margins (so that it doesn't show up in the wrong place).
  • I moved Footer into the main layout to match the HN design.

With these changes combined, I believe it works much closer to what people expect an HN demo to behave.

Before:

before.mov

After:

after2.mov

If we want to introduce the shell for the front page I think we can do that, but we need to be a lot more careful about how it behaves. I suggest that it shouldn't show up on pagination (that feels disruptive), and it should definitely not show up for the story page.

@vercel
Copy link

vercel bot commented Apr 28, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
next-rsc-news ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 3, 2023 6:24pm

@gaearon
Copy link
Collaborator Author

gaearon commented Apr 28, 2023

Issues I'm seeing in production:

  • Despite the "rewrite", there's 404 for initial load.
  • There's still a second request at the end, I don't know why.
  • Clicking "comments" link can stall for seconds. What's up? I guess this already happens on the deployed site (me removing the loading state made it more obvious), but I don't see a stall like this happening locally. Is it just that slow to call to HN from wherever this is being deployed?

@gaearon
Copy link
Collaborator Author

gaearon commented Apr 28, 2023

I tried to make comments a route group, hoping that this would make the "instant loading UI" prefetch the story above the fold. But prefetching doesn't seem to do what I want. Also, there's a build failure but I don't know what it is because it seems like CI is private.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants