Skip to content

Commit 22493b7

Browse files
authored
Merge pull request #14534 from guardian/ravi/delete-amp
Delete AMP
2 parents e7e3eaf + 44723c8 commit 22493b7

File tree

119 files changed

+48
-9975
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+48
-9975
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# AMP Removal
2+
3+
## Context
4+
5+
Google AMP is an open-source, website-publishing technology that enables you to create a website that loads almost instantly on mobile devices. AMP stands for “accelerated mobile pages.” Google created AMP so that publishers and businesses could avoid slow-loading web pages that frustrate users.
6+
7+
The pages loaded more quickly for users on constrained devices, and Google’s search algorithm had a requirement that stories that appeared in the top stories carousel would have to be amp pages.
8+
9+
In June 2021 an update to Google's Top Stories algorithm meant AMP was no longer needed to appear in top stories. In November 2021 Twitter phased out support for AMP.
10+
11+
### Negatives
12+
13+
- Issues with maintaining and updating AMP as a separate platform from a technical perspective
14+
15+
- User experience impact of sign in & cookies for AMP
16+
17+
- Design opportunities are limited on AMP
18+
19+
- The website accessibility and performance improvements we make only affect web/apps
20+
21+
- Better user experience editorially to land on a Guardian page than an AMP page when coming via Google
22+
23+
- For contributions AMP is the worst performing platform between Apple News, Web and AMP
24+
25+
More details in [Guardian and AMP](https://docs.google.com/document/d/1LLv_KFP5WVPis7KtWhJQNwZwWyJ_JuH2bDNxkAUymIU/edit?tab=t.0)
26+
27+
## Decision
28+
29+
We switched off AMP for a trial period between 12th August 2024 to 9th September 2024
30+
31+
Following analysis of the trial period we switched off AMP completely on 7th January 2025.
32+
33+
AMP code can now be deleted.
34+
35+
More details in the [chat channel](https://mail.google.com/chat/u/0/#chat/space/AAAA5AQB80w)
36+
37+
## Status
38+
39+
Approved

dotcom-rendering/docs/architecture/amp/000-structure-for-initial-milestone.md renamed to dotcom-rendering/docs/architecture/historic-adrs/000-structure-for-initial-milestone-amp.md

File renamed without changes.

dotcom-rendering/docs/contributing/where-should-my-code-live.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ In DCR, we use file suffixes to help provide some context & information around f
2222

2323
**Rendering Target**
2424

25-
DCR supports rendering for different targets - web, apps & amp.
25+
DCR supports rendering for different targets - web & apps.
2626
To mark code which is only to be used for specific rendering target, this should be added to the suffix of the file, e.g `MyComponent.apps.tsx`, `MyLib.amp.ts` or `MyLayout.web.tsx`.
2727

2828
These files all still live in the directories, and the suffixes are used to determine which target that code is for.
2929
In the case that there's no suffix, it can generally be assumed this code can be shared across targets.
3030

3131
> Note: When this was set up, most web code stayed without suffixes, which means there's a chance it's not compatible with other targets, so be vigilant when using shared code on a new target for the first time.
3232
33-
> Note: Some un-suffixed code might be shared across apps & web, but not AMP, or some other combination, so keep an eye out to see if there's a platform specific version of the file you're working on!
33+
> Note: Some un-suffixed code might be shared across apps & web or some other combination, so keep an eye out to see if there's a platform specific version of the file you're working on!
3434
3535
**Islands / Client side (P)react**
3636

dotcom-rendering/docs/elements/Disclaimer.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,3 @@ This is represented in frontend by [DisclaimerBlockElement](https://github.com/g
1616
## CAPI HTML Output
1717

1818
This is inserted raw into the document.
19-
20-
## AMP Cleaned HTML
21-
22-
This is run through the BodyCleaner and the AMP cleaners.

dotcom-rendering/docs/elements/Embed.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,4 @@ Appears raw.
2727

2828
If an embed uses `<figure>` tag, then the `ShowAllArticleEmbedsSwitch` can be used with `InBodyElementCleaner` to render a reduced subset of embeds.
2929

30-
## AMP Cleaned HTML
31-
32-
The html included in a potential embed may not be permitted by the AMP specification. For each embed that is renedered in an article we can:
33-
34-
- Transform the embed into something which is valid amp.
35-
- Remove the embed.
36-
- Fail to render the article in AMP.
37-
38-
The field `isMandatory` should control whether an embed is removed or if the page is. Dotcom does not currently support this API, so currently a workaround is used by central production to force the page to fail amp validation.
39-
4030
## Salient Points

dotcom-rendering/docs/elements/Image.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,6 @@ This is run through the [PictureCleaner](https://github.com/guardian/frontend/bl
208208
- Uses [WidthsByBreakpoint](https://github.com/guardian/frontend/blob/91e117429d865936692de60aa2bea6740bde4f75/common/app/layout/WidthsByBreakpoint.scala#L1) to generate a list of _image_ breakpoints to combine with the media into urls.
209209
- Combines the **master** ImageAsset and [breakpoints](https://github.com/guardian/frontend/blob/a101940926699230b8a95a9082aa56327ca98988/common/app/views/support/Profile.scala#L17) to generate [srcset](https://github.com/guardian/frontend/blob/a101940926699230b8a95a9082aa56327ca98988/common/app/views/support/Profile.scala#L240)s.
210210

211-
## AMP Cleaned HTML
212-
213-
This is run through the same cleaners and templates up to `image.scala.html` where it is then rendered using [ampImage](https://github.com/guardian/frontend/blob/f16a4ac50492dc65d7274576840c6993165a2485/common/app/views/fragments/amp/ampImage.scala.html) which uses [getAmpImageUrl](https://github.com/guardian/frontend/blob/a101940926699230b8a95a9082aa56327ca98988/common/app/views/support/Profile.scala#L298) to get a 620px wide crop.
214-
215211
## Salient points
216212

217213
- Image URLS need to be rewritten from `media.guim` to `i.guim` on the server.

dotcom-rendering/docs/elements/Instagram.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,3 @@ This is represented in frontend by [InstagramBlockElement](https://github.com/gu
1313
## CAPI HTML Output
1414

1515
Absolute tonnes of it wow.
16-
17-
## AMP Cleaned HTML
18-
19-
An amp tag [`<amp-instagram>`](https://www.ampproject.org/docs/reference/components/amp-instagram) exists to represent this content.
20-
21-
It requires the following data:
22-
23-
`data-shortcode` | the URL slug for the embed
24-
`data-captioned` | whether a caption is displayed
25-
`width` | the width of the image (not the whole embed)
26-
`height` | the height of the image (not the whole embed)

dotcom-rendering/docs/elements/Text.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,3 @@ The [BlockNumberCleaner](https://github.com/guardian/frontend/blob/bb83dabb21aea
4242
- Something else about quotes.
4343
- AffiliateLinksCleaner
4444
- Rewrites URLs on applicable links and adds a disclaimer.
45-
- AttributeCleaner("style")
46-
- Removes inline style on amp articles. Inline style could be in a text block, but it's unlikely.
47-
48-
## AMP Cleaned HTML
49-
50-
This is run through the BodyCleaner and the AMP cleaners.

dotcom-rendering/docs/elements/Tweet.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ These are dynamically enhanced on the client side by loading the twitter javascr
2020

2121
## Article Cleaned HTML
2222

23-
## AMP Cleaned HTML
24-
2523
## Salient Points
2624

2725
We store enough in CAPI to handle deleted tweets and displaying their images without the twitter js enhancement.

dotcom-rendering/index.d.ts

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -31,35 +31,6 @@ interface PerformanceEntry {
3131

3232
declare namespace JSX {
3333
interface IntrinsicElements {
34-
// ------------------------------------- //
35-
// AMP types //
36-
// ------------------------------------- //
37-
'amp-accordion': any;
38-
'amp-ad': any;
39-
'amp-analytics': any;
40-
'amp-audio': any;
41-
'amp-consent': any;
42-
'amp-embed': any;
43-
'amp-experiment': any;
44-
'amp-facebook': any;
45-
'amp-form': any;
46-
'amp-geo': any;
47-
'amp-iframe': any;
48-
'amp-img': any;
49-
'amp-instagram': any;
50-
'amp-list': any;
51-
'amp-live-list': any;
52-
'amp-pixel': any;
53-
'amp-script': any;
54-
'amp-sidebar': any;
55-
'amp-soundcloud': any;
56-
'amp-state': any;
57-
'amp-sticky-ad': any;
58-
'amp-twitter': any;
59-
'amp-video': any;
60-
'amp-vimeo': any;
61-
'amp-youtube': any;
62-
6334
/** Island {@link ./src/components/Island.tsx} */
6435
'gu-island': import('./src/components/Island.tsx').GuIsland;
6536
}

0 commit comments

Comments
 (0)