Open adamschwartz opened 3 years ago
@adamschwartz and i synced up on this in chat, we're leaning towards:
in the situation where the user isn't running javascript, we can use noscript to just show the SSR time:
<style>[data-hide-ssr] { display: none }</style>
<noscript><style>[data-hide-ssr] { display: unset }</style></noscript>
Also re noscript, maybe the SSR time should then just be more like 10/13/2020
(as opposed to 2 months ago
)?
Our use of
<TimeAgo/>
is slightly wonky with SSR:https://github.com/cloudflare/cloudflare-docs-engine/blob/6faa9d1291d1d4980e6b533a7d4212aa60d96f4a/src/components/docs-tutorials.js#L89-L93
It can flash "N hours ago" and then switch to "3 days ago" on page load for example. This is because the SSR time will be locked in at the last time it was built, but upon hydration it will be from now.
We could potentially use HTMLRewriter to set on the fly.