Hi, i am still a noob in both nextjs and payload.
How can i see what has been server side render on my page while i am developing locally? Some suggest disabling js, but initial document that is loaded needs js to insert html it has inside some script tag... what am i missing?
Basically i want to see only html that has been server side rendered, to make sure that my "use client" components are not hiding important content from crawlers
Modern crawlers actually do support javascript, they just wont wait around forever for your content. But in case of your usual nextjs site it's totally fine
use client
components aren't
purelyclient side, it's a bit more complex than that
but the tldr of it is that if you're fetching your data on the server side, either via your route or in a server component then you'll be 100% fine
you can also do
yarn build
and then
yarn serve
to check out your prod build locally
the modern web doesnt work or exist without javascript so unless you have specific requirements to run it without js (in which case you wouldnt build it with nextjs) i would worry about it too much as long as you're adhering to nextjs best practices
Thank you very much for a very detailed explanation.
I will give this a try
Star
Discord
online
Get dedicated engineering support directly from the Payload team.