wpengine / faustjs

Faust.js™ - The Headless WordPress Framework
https://faustjs.org
Other
1.44k stars 134 forks source link

fix: ssr not always working #1938

Closed jasonbahl closed 3 months ago

jasonbahl commented 3 months ago

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

github-actions[bot] commented 3 months ago

📦 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 commented 3 months ago

closing in favor of: https://github.com/wpengine/faustjs/pull/1939 (the # in the branch name was causing issues with automated tests)