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

Show loading skeleton for pages with long fetches #174

Open
ejmg opened this issue Aug 15, 2024 · 0 comments
Open

Show loading skeleton for pages with long fetches #174

ejmg opened this issue Aug 15, 2024 · 0 comments
Labels
bug Something isn't working client perf Performance, Optimizations, etc

Comments

@ejmg
Copy link
Collaborator

ejmg commented Aug 15, 2024

Summary

I suspect this problem is a mix of stupid and real issues with however suspense is being handled.

On specific pages, notably clicking on a link to a specific IBC identifier from a paginated table route (e.g. ibc/clients -> ibc/client/[id]), there can be a very long delay between clicking on that identifier and the page being rendered for that identifier.

In theory, this shouldn't happen. Suspense is supposed to allow NextJS to fallback to loading.tsx while the route is being queried/served; however, I suspect that, because the IBC queries are so heavy (#148), that Suspense doesn't trigger until the server actually responds.

Having a custom indexer that flattens these queries is the high level solution for this kind of problem but the observed behavior is generally bad and should be mitigated. The solution may be as simple as breaking up the component even more so that additional Suspense boundaries can be set up with their own fallbacks. Alternatively, useSuspenseQuery still provides some boolean flags like isFetching and these might be useful for flagging and showing render state. Or maybe things are even dumber than that.

@ejmg ejmg added bug Something isn't working client perf Performance, Optimizations, etc labels Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working client perf Performance, Optimizations, etc
Projects
Status: No status
Development

No branches or pull requests

1 participant