Skip to main content
Warning This document has not been updated for a while now. It may be out of date.
Last updated: 11 Jan 2018

govuk_publishing_components: Moving components from an application into this gem

Normally you want to build components as close to their point of use, but at some point you will want to share a component between applications.

Try not to move components into this gem 'just in case', only do so when there is a real need.

Example

We originally added some form components into government-frontend which needed to be used in email-alert-frontend.

This meant we moved these components into this gem. You can see how this worked happened with the following PRs. Generally the steps are as follows:

  1. Move the component into the gem (update the namespace from app to gem). Component tests in the gem use rspec, these made need to be updated if the app a component is ported from uses minitest or another test framework.
  2. Release a new version of the gem
  3. Update the application with this version and delete old app component files