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

prepopulate apollo cache on prerendered pages #8566

Merged
merged 5 commits into from
Jun 19, 2023
Merged

Conversation

KrisCoulson
Copy link
Contributor

This PR does two things.

  1. Preloads the Apollo Client Cache on the frontend with the fetched data we retrieved during prerendering. This allows the data served during prerender to match the client data and properly prerender
    There was an issue where prendering for cells is 50% working. It works without javascript but with Javascript enabled prerendered pages would fallback to client-side rendering so users would immediately see a loading spinner even though the content of the pages was already available

  2. Fixes a workaround that we had in place to prevent cells from throwing react 18 server / client mismatch errors.
    We were using Suspense with a null fallback to prevent React from displaying errors in the console. This hid the error but didn't solve the issue

@KrisCoulson KrisCoulson self-assigned this Jun 8, 2023
@KrisCoulson KrisCoulson added bug/confirmed We have confirmed this is a bug topic/prerender labels Jun 8, 2023
@jtoar jtoar added the release:feature This PR introduces a new feature label Jun 15, 2023
@dac09
Copy link
Collaborator

dac09 commented Jun 16, 2023

Sweet sweet fix KC!

@dac09 dac09 enabled auto-merge (squash) June 16, 2023 08:47
@dac09 dac09 merged commit 4c338b6 into main Jun 19, 2023
@dac09 dac09 deleted the feat/prerender-apollo-state branch June 19, 2023 05:18
@redwoodjs-bot redwoodjs-bot bot added this to the next-release milestone Jun 19, 2023
jtoar pushed a commit that referenced this pull request Jun 22, 2023
Co-authored-by: Daniel Choudhury <dannychoudhury@gmail.com>
@jtoar jtoar modified the milestones: next-release, v5.4.0 Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/confirmed We have confirmed this is a bug release:feature This PR introduces a new feature topic/prerender
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants