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 #1939

Merged
merged 4 commits into from
Aug 22, 2024
Merged

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 self-assigned this Aug 20, 2024
Copy link

changeset-bot bot commented Aug 20, 2024

🦋 Changeset detected

Latest commit: e079433

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@faustwp/core Patch
@faustwp/cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

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

github-actions bot commented Aug 20, 2024

📦 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!

Copy link
Member

@josephfusco josephfusco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was able to see this working on both the homepage and the upgrade guide with JavaScript turned off.

CleanShot 2024-08-21 at 16 33 19@2x

CleanShot 2024-08-21 at 16 33 57@2x

@theodesp theodesp merged commit 031c239 into canary Aug 22, 2024
22 checks passed
@theodesp theodesp deleted the fix/1813-ssr-not-alway-sworking branch August 22, 2024 08:24
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