Skip to content

Specify legacy config fields from frontend in the config types#15767

Open
cemms1 wants to merge 5 commits intomainfrom
cemms1/legacy-config
Open

Specify legacy config fields from frontend in the config types#15767
cemms1 wants to merge 5 commits intomainfrom
cemms1/legacy-config

Conversation

@cemms1
Copy link
Copy Markdown
Contributor

@cemms1 cemms1 commented Apr 29, 2026

What does this change?

  • Adds LegacyConfig type to document the config fields being sent to DCR in the POST request from frontend

    • For articles, these are marked as optional, as well as all nested object keys, to ensure nothing is accidentally broken in schema validation as part of this change
  • Adds FELegacyConfig to split the FEFrontConfig into the items more likely to be useful and those which are likely not to be used

    • Adds note in comment for the legacy config that this could be a starting point to begin removing items from frontend that are not needed
  • Updates the hostedArticle and hostedVideo fixtures, which now have all the properties in them as they appear in the DCR JSON response. The previous version of these files had the additional config files manually stripped out due to conflicting config

  • Updates the schema definitions based on this config definition

Why?

Frontend sends a huge amount of data to DCR in the requests. Because our type config is not up to date, when creating a new fixture based on the DCR JSON response for an article page (suffix .json?dcr) there are errors due to certain fields not being recognised on the Config type

e.g. tones in the following screenshot:

Screenshot 2026-04-29 at 16 26 48

Reimplements part of PR #15531

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 29, 2026

@cemms1 cemms1 marked this pull request as ready for review April 29, 2026 14:26
@github-actions
Copy link
Copy Markdown

Hello 👋! When you're ready to run Chromatic, please apply the run_chromatic label to this PR.

You will need to reapply the label each time you want to run Chromatic.

Click here to see the Chromatic project.

@cemms1 cemms1 added the maintenance Departmental tracking: maintenance work, not a fix or a feature label Apr 29, 2026
@cemms1 cemms1 requested a review from a team April 29, 2026 15:38
Comment thread dotcom-rendering/src/types/config.ts Outdated
Comment thread dotcom-rendering/src/types/config.ts
}

/** Legacy fields seemingly not used in DCR */
interface LegacyConfig {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should add a TODO to FEFrontConfig to remove any redundant config matched in this object. It just seems to be a flat list with no 'legacy' distinction.

export type FEFrontConfig = {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have split the FEFrontConfig into the standard config and the parts I believe to be legacy config, with a similar comment about removing from the frontend DCR model

@cemms1 cemms1 force-pushed the cemms1/legacy-config branch from 09ec353 to d47330a Compare May 1, 2026 13:52
@cemms1 cemms1 force-pushed the cemms1/legacy-config branch from d47330a to 7f862e9 Compare May 1, 2026 13:53
Copy link
Copy Markdown
Member

@arelra arelra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work 👏
This puts us in a good position to start deleting redundant config.

Thanks for the spot and fix

@cemms1 cemms1 added the run_chromatic Runs chromatic when label is applied label May 1, 2026
@github-actions github-actions Bot removed the run_chromatic Runs chromatic when label is applied label May 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Departmental tracking: maintenance work, not a fix or a feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants