-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move Javascript modules to es6-components
To prevent browsers evaluating JS that isn't supported, components that contain code from govuk-frontend have been moved to a separate file `es6-components.js` which is included in `application.html.erb` as a script tag with `type="module"`.
- Loading branch information
1 parent
60fc3f2
commit b358b54
Showing
4 changed files
with
14 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,6 @@ | ||
//= require govuk_publishing_components/lib | ||
//= require govuk_publishing_components/components/checkboxes | ||
//= require govuk_publishing_components/components/error-summary | ||
//= require govuk_publishing_components/components/govspeak | ||
//= require govuk_publishing_components/components/intervention | ||
//= require govuk_publishing_components/components/print-link | ||
//= require govuk_publishing_components/components/radio | ||
//= require govuk_publishing_components/components/step-by-step-nav | ||
//= require govuk_publishing_components/components/table |
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,12 @@ | ||
// 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/checkboxes | ||
//= require govuk_publishing_components/components/error-summary | ||
//= require govuk_publishing_components/components/radio |
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