Skip to content

Commit e9912f9

Browse files
committed
Remove use of pre-compiled fixtures on Heroku and CI
The `render` function was using the content from the `html` fields in `fixtures.json`. This made it unpredictable when updating examples's `context` for rendering with the `rebrand` flag which we need: - for the review app, to render component examples respecting the feature flag toggled in the UI - in tests, to enable adjusting existing examples by updating their context in the test themselves rather than adding more examples Comparing test duration [with caching](https://github.com/alphagov/govuk-frontend/actions/runs/14241757022?pr=5795) and [without caching](https://github.com/alphagov/govuk-frontend/actions/runs/14265204592), no flagrant difference appears (both on initial run and subsequent runs), so I've removed the caching from the `render` helper in components to make its behaviour more predictable.
1 parent b2e8c63 commit e9912f9

1 file changed

Lines changed: 0 additions & 7 deletions

File tree

shared/lib/components.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -155,13 +155,6 @@ function render(componentName, options) {
155155
const macroName = componentNameToMacroName(componentName)
156156
const macroPath = `govuk/components/${componentName}/macro.njk`
157157

158-
// On Heroku / CI we know we're running against an up-to-date build so we can
159-
// use the generated HTML from the component JSON (where it exists) to make
160-
// things faster
161-
if ((process.env.HEROKU_APP || process.env.CI) && options?.fixture?.html) {
162-
return options.fixture.html
163-
}
164-
165158
return renderMacro(macroName, macroPath, options)
166159
}
167160

0 commit comments

Comments
 (0)