diff --git a/docs/examples/webpack/.gitignore b/docs/examples/webpack/.gitignore deleted file mode 100644 index 364fdec1aa..0000000000 --- a/docs/examples/webpack/.gitignore +++ /dev/null @@ -1 +0,0 @@ -public/ diff --git a/docs/examples/webpack/src/index.html b/docs/examples/webpack/src/index.html index 967c515a92..416fc7c8f0 100644 --- a/docs/examples/webpack/src/index.html +++ b/docs/examples/webpack/src/index.html @@ -21,6 +21,6 @@ - + diff --git a/docs/examples/webpack/webpack.config.js b/docs/examples/webpack/webpack.config.js index 3c6baf2f8b..945a85b356 100644 --- a/docs/examples/webpack/webpack.config.js +++ b/docs/examples/webpack/webpack.config.js @@ -76,7 +76,6 @@ module.exports = ({ WEBPACK_SERVE }, { mode }) => ({ format: { comments: false }, // Compatibility workarounds - ecma: 5, safari10: true } })] @@ -85,7 +84,7 @@ module.exports = ({ WEBPACK_SERVE }, { mode }) => ({ output: { clean: true, filename: 'assets/javascripts/[name].min.js', - library: { type: 'umd' }, + iife: true, path: destPath, publicPath: '/' }, @@ -108,5 +107,5 @@ module.exports = ({ WEBPACK_SERVE }, { mode }) => ({ errorDetails: true }, - target: ['web', 'es5'] + target: ['web', 'es2015'] }) diff --git a/packages/govuk-frontend-review/rollup.config.mjs b/packages/govuk-frontend-review/rollup.config.mjs index 06774e6789..342bc1ad3f 100644 --- a/packages/govuk-frontend-review/rollup.config.mjs +++ b/packages/govuk-frontend-review/rollup.config.mjs @@ -29,7 +29,6 @@ export default defineConfig(({ i: input }) => ({ }, // Compatibility workarounds - ecma: 5, safari10: true }) ] diff --git a/packages/govuk-frontend-review/src/views/component-preview.njk b/packages/govuk-frontend-review/src/views/component-preview.njk index 599f2b495e..9a7b52d1eb 100644 --- a/packages/govuk-frontend-review/src/views/component-preview.njk +++ b/packages/govuk-frontend-review/src/views/component-preview.njk @@ -16,5 +16,5 @@ {% endblock %} {% block scripts %} - + {% endblock %} diff --git a/packages/govuk-frontend-review/src/views/examples/scoped-initialisation/index.njk b/packages/govuk-frontend-review/src/views/examples/scoped-initialisation/index.njk index 7d65d0612b..3c567d67bc 100644 --- a/packages/govuk-frontend-review/src/views/examples/scoped-initialisation/index.njk +++ b/packages/govuk-frontend-review/src/views/examples/scoped-initialisation/index.njk @@ -45,8 +45,8 @@ {% endblock %} {% block bodyEnd %} - - + - + + {% endblock %} diff --git a/packages/govuk-frontend-review/src/views/examples/template-default/index.njk b/packages/govuk-frontend-review/src/views/examples/template-default/index.njk index 5fbba37c4b..facd7b041d 100644 --- a/packages/govuk-frontend-review/src/views/examples/template-default/index.njk +++ b/packages/govuk-frontend-review/src/views/examples/template-default/index.njk @@ -10,8 +10,9 @@ {% endblock %} - {% block bodyEnd %} - - + + + + {% endblock %} diff --git a/packages/govuk-frontend-review/src/views/examples/translated/index.njk b/packages/govuk-frontend-review/src/views/examples/translated/index.njk index bd4ff3b3ab..15b87da586 100644 --- a/packages/govuk-frontend-review/src/views/examples/translated/index.njk +++ b/packages/govuk-frontend-review/src/views/examples/translated/index.njk @@ -937,8 +937,8 @@ {% endblock %} {% block bodyEnd %} - - + diff --git a/packages/govuk-frontend-review/src/views/full-page-examples/cookie-banner-essential-cookies/index.njk b/packages/govuk-frontend-review/src/views/full-page-examples/cookie-banner-essential-cookies/index.njk index 9efce9c0b6..a8d2ee70b9 100644 --- a/packages/govuk-frontend-review/src/views/full-page-examples/cookie-banner-essential-cookies/index.njk +++ b/packages/govuk-frontend-review/src/views/full-page-examples/cookie-banner-essential-cookies/index.njk @@ -156,7 +156,7 @@ notes: >- {# As the cookie banner component does not currently include JavaScript, we have to take care of the 'Hide' button to make progressive enhancement in the example functional #} - - + + {% endblock %} diff --git a/packages/govuk-frontend-review/src/views/layouts/layout.njk b/packages/govuk-frontend-review/src/views/layouts/layout.njk index 55a0eb9287..f824101985 100644 --- a/packages/govuk-frontend-review/src/views/layouts/layout.njk +++ b/packages/govuk-frontend-review/src/views/layouts/layout.njk @@ -11,9 +11,11 @@ {% block bodyEnd %} {{ super() }} {% block scripts %} - + {% endblock %} {% endblock %} diff --git a/packages/govuk-frontend-review/src/views/tests/boilerplate.njk b/packages/govuk-frontend-review/src/views/tests/boilerplate.njk index 7f94afb486..c4cad6f8f4 100644 --- a/packages/govuk-frontend-review/src/views/tests/boilerplate.njk +++ b/packages/govuk-frontend-review/src/views/tests/boilerplate.njk @@ -12,6 +12,6 @@ Used during testing to inject rendered components and test specific configurations

- + diff --git a/packages/govuk-frontend/README.md b/packages/govuk-frontend/README.md index eb7969daa1..c89e2b2002 100644 --- a/packages/govuk-frontend/README.md +++ b/packages/govuk-frontend/README.md @@ -51,13 +51,13 @@ initialising Javascript in your application to ensure that all users can use it You can include Javascript for all components either by copying the `all.js` from `node_modules/govuk-frontend/dist/govuk/` into your application or referencing the file directly: ```html - + ``` Next you need to initialise the script by adding: ```html - + ``` [More details on importing Javascript and advanced options](https://frontend.design-system.service.gov.uk/importing-css-assets-and-javascript/#javascript) diff --git a/packages/govuk-frontend/rollup.release.config.mjs b/packages/govuk-frontend/rollup.release.config.mjs index ddbf21c3a2..fabb61cd9d 100644 --- a/packages/govuk-frontend/rollup.release.config.mjs +++ b/packages/govuk-frontend/rollup.release.config.mjs @@ -34,7 +34,6 @@ export default defineConfig(({ i: input }) => ({ }, // Compatibility workarounds - ecma: 5, safari10: true }) ], diff --git a/packages/govuk-frontend/src/govuk/components/character-count/character-count.mjs b/packages/govuk-frontend/src/govuk/components/character-count/character-count.mjs index f6201ad3c0..1469a95692 100644 --- a/packages/govuk-frontend/src/govuk/components/character-count/character-count.mjs +++ b/packages/govuk-frontend/src/govuk/components/character-count/character-count.mjs @@ -193,11 +193,13 @@ CharacterCount.prototype.init = function () { this.bindChangeEvents() // When the page is restored after navigating 'back' in some browsers the - // state of the character count is not restored until *after* the - // DOMContentLoaded event is fired, so we need to manually update it after the - // pageshow event. + // state of form controls is not restored until *after* the DOMContentLoaded + // event is fired, so we need to sync after the pageshow event. window.addEventListener('pageshow', this.updateCountMessage.bind(this)) + // Although we've set up handlers to sync state on the pageshow event, init + // could be called after those events have fired, for example if they are + // added to the page dynamically, so update now too. this.updateCountMessage() } diff --git a/packages/govuk-frontend/src/govuk/components/checkboxes/checkboxes.mjs b/packages/govuk-frontend/src/govuk/components/checkboxes/checkboxes.mjs index 7dd33299e4..0938ff13ee 100644 --- a/packages/govuk-frontend/src/govuk/components/checkboxes/checkboxes.mjs +++ b/packages/govuk-frontend/src/govuk/components/checkboxes/checkboxes.mjs @@ -65,9 +65,9 @@ Checkboxes.prototype.init = function () { // event is fired, so we need to sync after the pageshow event. window.addEventListener('pageshow', this.syncAllConditionalReveals.bind(this)) - // Although we've set up handlers to sync state on the pageshow or - // DOMContentLoaded event, init could be called after those events have fired, - // for example if they are added to the page dynamically, so sync now too. + // Although we've set up handlers to sync state on the pageshow event, init + // could be called after those events have fired, for example if they are + // added to the page dynamically, so sync now too. this.syncAllConditionalReveals() // Handle events diff --git a/packages/govuk-frontend/src/govuk/components/radios/radios.mjs b/packages/govuk-frontend/src/govuk/components/radios/radios.mjs index 998831c75d..9ed3c09b98 100644 --- a/packages/govuk-frontend/src/govuk/components/radios/radios.mjs +++ b/packages/govuk-frontend/src/govuk/components/radios/radios.mjs @@ -65,9 +65,9 @@ Radios.prototype.init = function () { // event is fired, so we need to sync after the pageshow event. window.addEventListener('pageshow', this.syncAllConditionalReveals.bind(this)) - // Although we've set up handlers to sync state on the pageshow or - // DOMContentLoaded event, init could be called after those events have fired, - // for example if they are added to the page dynamically, so sync now too. + // Although we've set up handlers to sync state on the pageshow event, init + // could be called after those events have fired, for example if they are + // added to the page dynamically, so sync now too. this.syncAllConditionalReveals() // Handle events