From 20a0559ef4d3e728b0f5975d4d868d733d10d99e Mon Sep 17 00:00:00 2001 From: Romaric Pascal Date: Thu, 26 Sep 2024 16:56:04 +0100 Subject: [PATCH] Apply suggestions from code review Co-authored-by: seaemsi <50173207+seaemsi@users.noreply.github.com> --- CHANGELOG.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9fe4ede421..e789b0be45 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,18 +6,18 @@ For advice on how to use these release notes see [our guidance on staying up to ### New features -#### Components can no longer initialise twice on the same element +#### Components can no longer be initialised twice on the same element -GOV.UK Frontend components now throw an error if they had already been initialised on the DOM Element they're receiving for initialisation. -This avoids components to be initialised more than once, causing them to not work properly. +GOV.UK Frontend components now throw an error if they've already been initialised on the DOM Element they're receiving for initialisation. +This prevents components from being initialised more than once and therefore not working properly. We introduced this change in [pull request #5272: Prevent multiple initialisations of a single component instance](https://github.com/alphagov/govuk-frontend/pull/5272) #### Respond to initialisation errors when using `createAll` and `initAll` We've added a new `onError` option for `createAll` and `initAll` that lets you respond to initialisation errors. -The functions will carry on catching errors and initialising components further down the page if one fails to initialise, -but this option will let you react to a component failing to initialise (for example reporting to an error monitoring service). +The functions will continue catching errors and initialising components further down the page if one component fails to initialise, +but this option will let you react to a component failing to initialise (for example, reporting to an error monitoring service). We introduced this change in: @@ -26,8 +26,8 @@ We introduced this change in: #### Check if GOV.UK Frontend is supported -We've added the `isSupported` function to let you check if GOV.UK Frontend is supported in the browser your script is running. -GOV.UK Frontend components will check this automatically, but you may want to do it as well to avoid running some code when GOV.UK Frontend is not supported. +We've added the `isSupported` function to let you check if GOV.UK Frontend is supported in the browser where your script is running. +GOV.UK Frontend components will check this automatically, but you may want to use the `isSupported` function to avoid running some code when GOV.UK Frontend is not supported. We introduced this change in [pull request #5250: Add `isSupported` to `all.mjs`](https://github.com/alphagov/govuk-frontend/pull/5250)