diff --git a/CHANGELOG.md b/CHANGELOG.md index 115ec69900..ff55e3514b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -65,6 +65,26 @@ Replace any use of this class with the `govuk-tag--grey` class. This change was introduced in [pull request #2417: Remove deprecated `govuk-tag--inactive class`](https://github.com/alphagov/govuk-frontend/pull/2417). +#### Make sure any individually imported JavaScript modules work as expected + +We've changed the naming of our component JavaScript modules so that individual imports are now attached to +`window.GOVUKFrontend.[ComponentName]` instead of `window.GOVUKFrontend`. + +This means you can now import multiple modules without overwriting the previous one, for example: + +``` +//= require govuk/components/accordion/accordion.js +//= require govuk/components/button/button.js + +# The above are available under window.GOVUKFrontend.Accordion and window.GOVUKFrontend.Button respectively +``` + +If you are importing indvidual component JavaScript, you should check any references to `window.GOVUKFrontend` in your code and update them to point to the correct component: `window.GOVUKFrontend.[ComponentName]`. You may have implemented workarounds that can now be removed. + +This change does not affect you if you followed our [Getting Started guide](https://frontend.design-system.service.gov.uk/get-started/#5-get-the-javascript-working) and are importing all of the GOV.UK Frontend JavaScript in one go via `all.js`, or if you installed GOV.UK Frontend using precompiled files. + +This change was introduced in [pull request #1836: Rename exported JavaScript modules to include component name](https://github.com/alphagov/govuk-frontend/issues/1836)] + ### Fixes We’ve made fixes to GOV.UK Frontend in the following pull requests: @@ -73,6 +93,7 @@ We’ve made fixes to GOV.UK Frontend in the following pull requests: - [#2323: Avoid invalid nesting of `` within a `
` in summary list](https://github.com/alphagov/govuk-frontend/pull/2323) - [#2370: Prevent issues with conditionally revealed content when content `id` includes CSS syntax characters](https://github.com/alphagov/govuk-frontend/pull/2370) - [#2408: Prevent issues with character count when textarea `id` includes CSS syntax characters](https://github.com/alphagov/govuk-frontend/pull/2408) +- [#1836: Rename exported JavaScript modules to include component name](https://github.com/alphagov/govuk-frontend/issues/1836)) ## 3.14.0 (Feature release)