Skip to main content

Keeping up with upstream

This port is designed so that a new NHS.UK frontend release is a small, reviewable pull request rather than a re-port.

What comes from upstream automatically

The repository pins an exact nhsuk-frontend version (currently 10.6.1). Running npm run sync copies or generates everything that is data rather than logic:

What is hand-written

Each component's Razor markup is a line-by-line port of its Nunjucks template. This is the only part a person has to change when upstream changes a template.

How changes are caught

Every upstream example is rendered through the Razor components and compared with upstream's HTML, ignoring only differences a browser ignores, like whitespace and attribute order. This runs in CI and on this site.

When a new upstream version is released, the upgrade pull request shows:

  1. which component options were added, changed or deprecated, as a diff of macro-options.json
  2. which parameters changed, as compile errors or new properties in the generated C#
  3. which examples no longer match, as failing parity checks with an HTML diff

Each pull request can also get its own copy of this site through Heroku review apps, so changes can be checked visually before merging.