Skip to content

Conversation

ioannakok
Copy link
Contributor

@ioannakok ioannakok commented Apr 4, 2024

Closes #26997

What does this change?

What is the value of this and can you measure success?

Unblocks the Play 3 upgrade:

Removes deprecated code

Impact

1. Articles rendered by frontend will no longer render audio, chart, explainer, guide, Q & A, quiz and timeline atoms. Only interactive and media atoms will be rendered

This has a very low impact on users. Over the past 2 weeks we've can't see any articles published after 2017 rendered by frontend in Kibana (unless the user requests for ?dcr=false).

image

The reason why the majority of these old articles are still rendered by frontend is because they are old liveblogs. Here's what happens if we filter those out.

image

This issue will be resolved in:

2. embed/atom endpoint will stop rendering audio atoms

It looks like only the Google Bot is hitting the endpoint embed/atom/audio

image

3. Editions and AMP still request some atoms by hitting embed/atom. What about those?

Editions and AMP hit embed/atom endpoint to request:

  • media atoms (editions)
  • interactive and chart atoms (AMP)

image

This change won't have any impact to the above requests because these atoms are already rendered by client-side code that lives in frontend and atom-renderer code is not used.

case Right(atom: ChartAtom) =>
renderAtom(ChartAtomPage(atom, withJavaScript = isJsEnabled, withVerticalScrollbar = hasVerticalScrollbar))
case Right(atom: GuideAtom) =>
renderAtom(GuideAtomPage(atom, withJavaScript = isJsEnabled, withVerticalScrollbar = hasVerticalScrollbar))
case Right(atom: InteractiveAtom) =>
renderAtom(
InteractiveAtomPage(atom, withJavaScript = isJsEnabled, withVerticalScrollbar = hasVerticalScrollbar),
)
case Right(atom: MediaAtom) =>
renderAtom(MediaAtomPage(atom, withJavaScript = isJsEnabled, withVerticalScrollbar = hasVerticalScrollbar))

private def renderAtom(page: AtomPage)(implicit request: RequestHeader): Result = {
Cached(600)(RevalidatableResult.Ok(views.html.atomEmbed(page)))

<body>
@page.body
@fragments.atomPageFoot(page)
</body>

Twirl templates for:

4. How do we know Editions only requests media and AMP only requests chart and interactive atoms?

Editions

Only for media atoms Editions request the image from the poster image url. No other reference to any other type of atom exists in the editions repo.

Tested in CODE

  • Media
    image

AMP

Tested in CODE

  • Chart
    image

  • Interactive
    image

Also, using https://atomworkshop.gutools.co.uk/ I found articles with different types of atoms, requested them and verified via Kibana that nothing hits embed/atom endpoint to request those atoms.

@ioannakok ioannakok force-pushed the remove-atom-renderer-lib branch 2 times, most recently from 2293a2f to 21468ee Compare April 4, 2024 12:23
Copy link
Contributor

github-actions bot commented Apr 4, 2024

@ioannakok ioannakok force-pushed the remove-atom-renderer-lib branch from 21468ee to 3975cc5 Compare April 8, 2024 14:20
@ioannakok ioannakok marked this pull request as ready for review April 8, 2024 14:53
@ioannakok ioannakok requested a review from a team as a code owner April 8, 2024 14:53
It is not used anywhere
@prout-bot
Copy link

Seen on FRONTS-PROD, ADMIN-PROD (merged by @ioannakok 26 minutes and 13 seconds ago)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove atom-renderer dependency from frontend
3 participants