feat(prototype kit integration): users of prototype-kit-v13 should have macros and filters available #378
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of the change
In version 13 of GOV.UK Prototype Kit we have some new integration points. This makes use of the new integration points and makes the installation simpler for users. Specifically, for
moj-frontend
, this will import all the nunjucks macros (components) and filters without the user having to do any setup themselves.Alternative designs
You could leave the
govuk-prototype-kit.config.json
as-is and it will still work with the same features. The mechanism for including filters has changed so users of the kit would need to add some code to their prototypes to handle this.Ultimately, using the config saves the kit user from having to wire these things in for themselves. The alternative is to instruct users on how to integrate these features.
Possible drawbacks
The only concern I have is for a potential conflict with the
date
filter, that can be resolved by namespacing it. The fact these filters are now added by default means that users might find it harder to work around that conflict if it appears.This is a backwards compatible change, it can be updated release-by-release.
Verification process
I have tested this against the latest version of
govuk-prototype-kit
. You can test this by running:You can then install this new version of moj-frontend into the kit, I've been doing that with the command:
(you can use the
package
directory without compressing it first but NPM handles the dependencies differently which can be pretty annoying). The view I'm using to test is:Release notes