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

Spinners and client-side navigation #14

Merged
merged 14 commits into from
Feb 23, 2024
Merged

Spinners and client-side navigation #14

merged 14 commits into from
Feb 23, 2024

Conversation

LiteralGenie
Copy link
Owner

@LiteralGenie LiteralGenie commented Feb 23, 2024

  • add skeletons to card list and details pane that trigger on pagination
    • to support this, the api query was moved from the page component into a hook (ie global data instead of prop drilling)
  • navigation is now done client-side using nuqs instead of nextjs / rsc magic
    • because it's not possible to update query params without a page reload in nextjs (aka shallow routing app router)
      • this meant the page would just freeze ([1a] [1b] [2]) when a pagination button is clicked, with none of the isFetching / suspense fallbacks triggering
      • even with the suggestion from here, the back button (esp when it involves url fragments) is broken
    • data for next / prev pages are prefetched now
  • similarly, <Link>s to url fragments also froze the page while waiting on hydration / some rsc request ([1] [2] )
    • these were replaced by <a>s meaning these links arent registered in whatever nextjs router history when clicked. This normally breaks the back button but a popstate event listener was added to cover up this hack
    • oh and all this depends on a nextjs canary build that fixes a fragment-navigation bug but introduces a hydration error described in home-container.tsx

runs with LiteralGenie/jobber-classifier@1ffb241

image

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.

1 participant