Fix blog post load by removing PostHog SSR experiments#225
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
Caution Review failedThe pull request is closed. WalkthroughThe changes involve significant refactoring of several components in the application, particularly the Changes
Possibly related PRs
Poem
Tip OpenAI O1 model for chat
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
We added PostHog SSR capabilities so that search engines could read the homepage text without seeing a skeleton, and so that users wouldn't see a flicker on load.
This method relied on adding cookies to the RootLayout, but this broke static page generation fo the blog posts. The error was: DynamicServerError. More here: https://nextjs.org/docs/messages/dynamic-server-error
To fix this, we reverted using cookies in the RootLayout. We should one piece of text before hydration, and then we show another upon hydration. And to avoid the flicker a user might see, we fade in from opactity-0. By the time the fade in is complete the user only sees the final text.
There are other ways to fix this, by using multiple layouts, or with Next.js middleware, but both would have been annoying so we're using the solution in this PR.
Summary by CodeRabbit
Release Notes
New Features
HeroABcomponent for improved responsiveness and user experience.Herocomponent with a default static message.Bug Fixes
HeroABcomponent during hydration.Refactor
HeroABto client-side rendering using React hooks.Chores
uuidv7dependency from the project.