Skip to content

Commit b362e38

Browse files
committed
Merge branch 'main' into mob/inline-product-card
2 parents e831b54 + 50ea04f commit b362e38

File tree

244 files changed

+3723
-11363
lines changed

Some content is hidden

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

244 files changed

+3723
-11363
lines changed

.github/workflows/ar-chromatic.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
- name: Chromatic - Apps Rendering
4040
env:
4141
NODE_OPTIONS: '--max_old_space_size=4096'
42-
uses: chromaui/action@v11.27.0
42+
uses: chromaui/action@v13.3.0
4343

4444
with:
4545
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN__APPS_RENDERING }}

.github/workflows/dcr-chromatic.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
- name: Chromatic - DCR
3636
env:
3737
NODE_OPTIONS: '--max_old_space_size=4096'
38-
uses: chromaui/action@v11.27.0
38+
uses: chromaui/action@v13.3.0
3939
with:
4040
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN__DOTCOM_RENDERING }}
4141
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/stale.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
stale:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/stale@v9
14+
- uses: actions/stale@v10
1515
id: stale
1616
# Read about options here: https://github.com/actions/stale#all-options
1717
with:

dotcom-rendering/.storybook/decorators/splitThemeDecorator.tsx

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ interface Orientation {
2121
orientation?: 'horizontal' | 'vertical';
2222
}
2323

24+
type SplitThemeOptions = Orientation & {
25+
/** Allows the format heading to be omitted on the split theme decorator */
26+
hideFormatHeading?: boolean;
27+
};
28+
2429
/**
2530
* The `splitTheme` decorator displays a story simultaneously in both light and
2631
* dark mode.
@@ -226,6 +231,11 @@ type ThemeProps = {
226231
Story: Parameters<Decorator>[0];
227232
context: Context;
228233
colourScheme: ColourScheme;
234+
/**
235+
* For stories without article theming where we fallback to the default theme,
236+
* we can choose to omit the format heading as it's not relevant
237+
*/
238+
hideFormatHeading?: boolean;
229239
};
230240

231241
/**
@@ -242,7 +252,13 @@ type ThemeProps = {
242252
* `colourSchemeBackground` and `colourSchemeTextColour` parameters from the
243253
* story, or provides defaults when these are not supplied.
244254
*/
245-
const Theme = ({ formats, Story, context, colourScheme }: ThemeProps) => (
255+
const Theme = ({
256+
formats,
257+
Story,
258+
context,
259+
colourScheme,
260+
hideFormatHeading = false,
261+
}: ThemeProps) => (
246262
<div
247263
css={{
248264
color:
@@ -258,7 +274,12 @@ const Theme = ({ formats, Story, context, colourScheme }: ThemeProps) => (
258274
<ThemeHeading colourScheme={colourScheme} />
259275
{formats.map((format) => (
260276
<>
261-
<FormatHeading format={format} colourScheme={colourScheme} />
277+
{!hideFormatHeading && (
278+
<FormatHeading
279+
format={format}
280+
colourScheme={colourScheme}
281+
/>
282+
)}
262283
<Palette
263284
colourScheme={colourScheme}
264285
context={context}
@@ -302,7 +323,10 @@ const Theme = ({ formats, Story, context, colourScheme }: ThemeProps) => (
302323
export const splitTheme =
303324
(
304325
formats: ArticleFormat[] = [...defaultFormats],
305-
{ orientation = 'horizontal' }: Orientation = {},
326+
{
327+
orientation = 'horizontal',
328+
hideFormatHeading = false,
329+
}: SplitThemeOptions = {},
306330
): Decorator =>
307331
(Story, context) => (
308332
<div
@@ -318,12 +342,14 @@ export const splitTheme =
318342
formats={formats}
319343
Story={Story}
320344
context={context}
345+
hideFormatHeading={hideFormatHeading}
321346
/>
322347
<Theme
323348
colourScheme="dark"
324349
formats={formats}
325350
Story={Story}
326351
context={context}
352+
hideFormatHeading={hideFormatHeading}
327353
/>
328354
</div>
329355
);

dotcom-rendering/.storybook/preview.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ style.appendChild(document.createTextNode(css));
5656
// Could this be better? Sure, we could investigate ways to really, truly server side
5757
// render in Storybook but for now this (and some of the other steps we take around
5858
// hydration) achieve what we need
59-
window.guardian = {
59+
(window as any).guardian = {
6060
config: {
6161
ophan: {
6262
pageViewId: 'mockPageViewId',
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

0 commit comments

Comments
 (0)