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

fix: ssr not always working #1938

Closed
wants to merge 2 commits into from
Closed

Conversation

jasonbahl
Copy link
Contributor

Description

This fixes a bug where the WordPressTemplate component would return null on the server when isPreview was null.

Related Issue(s):

fixes #1813

Testing

I tested following the steps outlined in #1813 on the reproduction mentioned in the issue.

I also was able to reproduce the issue on acf.wpgraphql.com (codebase here: https://github.com/wp-graphql/acf.wpgraphql.com) and was able to confirm that the issue is resolved for acf.wpgraphql.com with this fix in place.

Screenshots

Reproduction Site from #1813 - Before

With JavaScript disabled, the page is blank

CleanShot 2024-08-20 at 15 51 32

Reproduction Site from #1813 - After

Content is rendered even with JavaScript disabled

CleanShot 2024-08-20 at 15 54 20

acf.wpgraphql.com - Before

With JavaScript disabled, the page is blank

CleanShot 2024-08-20 at 15 50 31

acf.wpgraphql.com - After

Content is rendered even with JavaScript disabled

CleanShot 2024-08-20 at 15 57 02

@jasonbahl jasonbahl marked this pull request as ready for review August 20, 2024 21:57
@jasonbahl jasonbahl requested a review from a team as a code owner August 20, 2024 21:57
Copy link
Contributor

📦 Next.js Bundle Analysis for @faustwp/getting-started-example

This analysis was generated by the Next.js Bundle Analysis action. 🤖

🎉 Global Bundle Size Decreased

Page Size (compressed)
global 250.52 KB (-10 B)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

@jasonbahl
Copy link
Contributor Author

closing in favor of: #1939 (the # in the branch name was causing issues with automated tests)

@jasonbahl jasonbahl closed this Aug 20, 2024
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.

SSR only works when template query is present
3 participants