-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move ES6 components to their own file
This change is part of the process for upgrading apps to a new version of govuk_publishing_components that uses GOV.UK frontend V5.1 This is one of the steps detailed in the [Upgrading to GOV.UK Frontend v5 document](https://docs.google.com/document/d/1uwip7pzQwM7t5ghn9_8KrsWXLePSRUltFPZ5fYw6Ab8/edit). The purpose of this is to prevent browsers that don't support ES6 attempting to load ES6 Javascript from our components. We know browser that don't support ES6 as grade X browsers, and these browsers also don't support the `type = "module"` attribute in script tags. So we use this to prevent such code being loaded by ES6 Browsers. The 'all_components' require as been removed to avoid grade X browsers calling ES6 javascript
- Loading branch information
1 parent
d2f4d70
commit 7820bee
Showing
4 changed files
with
18 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// These modules from govuk_publishing_components | ||
// depend on govuk-frontend modules. govuk-frontend | ||
// now targets browsers that support `type="module"`. | ||
// | ||
// To gracefully prevent execution of these scripts | ||
// on browsers that don't support ES6, this script | ||
// should be included in a `type="module"` script tag | ||
// which will ensure they are never loaded. | ||
|
||
//= require govuk_publishing_components/components/button | ||
//= require govuk_publishing_components/components/checkboxes | ||
//= require govuk_publishing_components/components/error-summary | ||
//= require govuk_publishing_components/components/layout-header | ||
//= require govuk_publishing_components/components/radio | ||
//= require govuk_publishing_components/components/skip-link |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters