guardian / guardian/dotcom-rendering

Make `serverTime` prop required

Open
#14,776 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
274
Forks
34
Avg merge
2d 22h
Merged PRs (30d)
121

Description

As a follow-up to #14660 we want to make the `serverTime` prop required as it _should_ always be available and allows us to simplify things slightly by removing the logic to fallback to absolute timestamps when `serverTime` is not defined.

However, on closer inspection there are still some places where `serverTime` is not currently available such as when `LiveBlogRenderer` is used to render blocks for live blogs:

https://github.com/guardian/dotcom-rendering/blob/d124a5af3b0e8d18a9c0469dee11f733206126cc/dotcom-rendering/src/server/render.article.web.tsx#L231-L233

https://github.com/guardian/dotcom-rendering/blob/d124a5af3b0e8d18a9c0469dee11f733206126cc/dotcom-rendering/src/server/render.article.apps.tsx#L171-L173

It is also unavailable in `renderElement` where it is used by `YoutubeBlockComponent`:

https://github.com/guardian/dotcom-rendering/blob/d124a5af3b0e8d18a9c0469dee11f733206126cc/dotcom-rendering/src/lib/renderElement.tsx#L867-L870

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.