-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Description
I'm nowhere near a good react developer!
The thin I noticed while poking around is that the prefected comments (while hovering a discussion) is ignored afaik.
To replicate (in nextjs)
- Add a delay on 3+ sec to getComments in get-comments.ts
- Start the test server
- Create a discussion and some comments
- Go to http://localhost:3000/app/discussions
- Hover the discussion and notice the fetch takes the 3+ seconds (in developer tool)
- Click the link and notice that it again take 3+ sec to load
To "fix" comment out the queryClient.prefetchInfiniteQuery(getInfiniteCommentsQueryOptions(discussionId)), line in page.tsx in [disussinId]
The server will now not preload the comments. What you now can opserve is
- When you hover the disussion again notice the 3+ sec
- Click and the comments are there instant
OR - Click asap on the discussion
- Notice the spinner is there for the 3+ sec
This behavior is also for the discussion list as in the first page is "slow" as the discussions is preloaded on the server and the page cannot be shown before.
I don't know the correct way of doing this, but I would expect to get to the site quick and then have the spinner while comments / discussions is loaded.
Metadata
Metadata
Assignees
Labels
No labels