Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use govuk-frontend v5 [DO NOT MERGE] #3700

Closed
wants to merge 27 commits into from

Commits on May 17, 2024

  1. Configuration menu
    Copy the full SHA
    d92ca8f View commit details
    Browse the repository at this point in the history
  2. Update govuk-frontend asset paths

    In govuk-frontend v5 the asset path has changed from:
    
    `govuk-frontend/govuk/`
    
    to
    
    `govuk-frontend/govuk/dist`
    
    so we have to change references to the old path.
    patrickpatrickpatrick authored and MartinJJones committed May 17, 2024
    Configuration menu
    Copy the full SHA
    05b66e4 View commit details
    Browse the repository at this point in the history
  3. Remove references to the crown fallback

    In govuk-frontend v5.0.0, the crown fallback image for IE8 has been
    removed so we need to remove all references to this asset in the gem.
    patrickpatrickpatrick authored and MartinJJones committed May 17, 2024
    Configuration menu
    Copy the full SHA
    f0115a3 View commit details
    Browse the repository at this point in the history
  4. Remove references to govuk-frontend JS polyfills

    In govuk-frontend v5.0.0, JS polyfills have been removed so therefore we
    need to remove all references to these in the gem.
    patrickpatrickpatrick authored and MartinJJones committed May 17, 2024
    Configuration menu
    Copy the full SHA
    465fb4d View commit details
    Browse the repository at this point in the history
  5. Update govuk-frontend .js file names

    In the govuk-frontend v5, the .js of UMD files has been changed to use
    the "*.bundle.js" suffix. This means we have to update references to
    those UMD files in the JS of the components.
    patrickpatrickpatrick authored and MartinJJones committed May 17, 2024
    Configuration menu
    Copy the full SHA
    e5398c7 View commit details
    Browse the repository at this point in the history
  6. Remove reference to details.js

    As of govuk-frontend v5, the details component does not use JS and the .js file has been removed from the package.
    
    Remove the `data-module="govuk-details"` attribute
    
    See 'Remove references to the JavaScript for the Details component' from https://github.com/alphagov/govuk-frontend/releases/tag/v5.0.0
    patrickpatrickpatrick authored and MartinJJones committed May 17, 2024
    Configuration menu
    Copy the full SHA
    f2a05e3 View commit details
    Browse the repository at this point in the history
  7. Remove $legacy from govuk-colour

    govuk-frontend v5 deprecates the `$legacy` param in the `govuk-colour`
    mixin. Continuing to use it produces warnings for each instance of it
    in the CSS. It can be safely removed as alphagov/govuk-frontend#3576
    notes that `it is non-operational and the parameter is only maintained to
    prevent compilation errors`.
    patrickpatrickpatrick authored and MartinJJones committed May 17, 2024
    Configuration menu
    Copy the full SHA
    7e559e3 View commit details
    Browse the repository at this point in the history
  8. Update tag component in light of govuk-frontend v5

    govuk-frontend v5 introduces some changes to the tag component. The one
    that has the most impact, is that the tag is now designed not to use
    ALL CAPS text anymore. Instead it is to be titlecase. In addition there
    are new background colours introduced which means that the styling for
    some tags in govuk_publishing_components has to be changed to maintain
    sufficient contrast. Tests have been updated to anticipate titlecase
    tag text instead of ALL CAPS text.
    patrickpatrickpatrick authored and MartinJJones committed May 17, 2024
    Configuration menu
    Copy the full SHA
    1e1e2bf View commit details
    Browse the repository at this point in the history
  9. Remove $govuk-new-link-styles feature flag

    In govuk-frontend v5, the new link styles are default and this feature
    flag has been removed.
    patrickpatrickpatrick authored and MartinJJones committed May 17, 2024
    Configuration menu
    Copy the full SHA
    d6a8995 View commit details
    Browse the repository at this point in the history
  10. Replace govuk-warning-text__assistive class

    In govuk-frontend v5, the `govuk-warning-text__assistive` has been
    removed. Instead `govuk-visually-hidden` is to be used. Tests that
    look for `govuk-warning-text__assistive` have been updated.
    patrickpatrickpatrick authored and MartinJJones committed May 17, 2024
    Configuration menu
    Copy the full SHA
    cf980a5 View commit details
    Browse the repository at this point in the history
  11. Use Terser instead of Uglifier

    govuk-frontend v5 now targets browsers that support ES6.
    
    This means that the UMD modules used in govuk_publishing_components from govuk-frontend
    use features of ES6 and so it means that Uglifier can't be used anymore because it only supports ES5.
    
    As well as installing Terser and updating the config, this commit also contains a patch for getting Terser working. Sprockets doesn't have an built-in loader for Terser so we need to add this functionality.
    patrickpatrickpatrick authored and MartinJJones committed May 17, 2024
    Configuration menu
    Copy the full SHA
    89adcfa View commit details
    Browse the repository at this point in the history
  12. Separate ES6 components from ES5 components

    Add new config to state if application is loading ES6 components
    in 'es6-components.js'. If set to true `layout_for_public` will include
    a script tag with type `module` that points to `es6-components.js`.
    If this config is set to true and there is no `es6-components.js` then
    an error will occur.
    patrickpatrickpatrick authored and MartinJJones committed May 17, 2024
    Configuration menu
    Copy the full SHA
    7f9b2d5 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    269edc6 View commit details
    Browse the repository at this point in the history
  14. Update app icon paths from govuk-frontend

    In govuk-frontend v5, the names of the app icons have changed and need to be updated.
    
    In addition a manifest.json file is provided for
    specifying the correct file at different sizes. These references have been updated in `layout_for_public`.
    patrickpatrickpatrick authored and MartinJJones committed May 17, 2024
    Configuration menu
    Copy the full SHA
    cd519da View commit details
    Browse the repository at this point in the history
  15. Update .svg used in header component

    In govuk-frontend v5, the crown .svg has been updated to also include the "GOV.UK" text. This has been updated in the header component.
    
    Removed the `.gem-c-header__logotype` class in `_layout-header.scss` as it is not longer required
    patrickpatrickpatrick authored and MartinJJones committed May 17, 2024
    Configuration menu
    Copy the full SHA
    ce7b8b2 View commit details
    Browse the repository at this point in the history
  16. Use .svg used in navbar

    In govuk-frontend v5, the crown .svg has been updated to also include
    the "GOV.UK" text. This has to be updated in the
    layout_super_navigation_header component. A partial has been created
    so that a variant of the .svg without "GOV.UK" can be used for the
    homepage.
    patrickpatrickpatrick authored and MartinJJones committed May 17, 2024
    Configuration menu
    Copy the full SHA
    12f8799 View commit details
    Browse the repository at this point in the history
  17. Update header logos

    MartinJJones committed May 17, 2024
    Configuration menu
    Copy the full SHA
    d189785 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    5606c91 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    9b2c5a6 View commit details
    Browse the repository at this point in the history
  20. Use govuk-frontend v5 component initialisation

    In govuk-frontend v5, initialisation has been moved to creation of
    component JS module. This means that `init()` does not need to be
    called to initialise a component, it is instead called in the
    constructor.
    
    To ensure that modules from govuk-frontend and modules from the gem
    can be initialised easily in the same `initAll()` method, the modules
    of the gem have been changed to use the new initialisation method. This
    means moving `init()` to the constructor of each module. It also means
    updating the `initAll()` method to not call 'init()' of each module.
    patrickpatrickpatrick authored and MartinJJones committed May 17, 2024
    Configuration menu
    Copy the full SHA
    8bf5701 View commit details
    Browse the repository at this point in the history
  21. Update tests to use new initialisation method

    The modules in govuk_publishing_components have been updated to use the
    new method of initialisation. To get tests to work correctly, we also
    need to update how the modules are initialised in the tests themselves
    as they are individually initialised instead of using `initAll()`
    patrickpatrickpatrick authored and MartinJJones committed May 17, 2024
    Configuration menu
    Copy the full SHA
    ff8bacd View commit details
    Browse the repository at this point in the history
  22. Update Analytics modules to use new init method

    Some of the Analytics modules use window.GOVUK.Modules and so
    the way they initialise needs to be updated in-line with how
    other JS modules are initialised. Tests for the modules
    that are effected have been updated to take into account the
    new initialisation method.
    patrickpatrickpatrick authored and MartinJJones committed May 17, 2024
    Configuration menu
    Copy the full SHA
    7747e1f View commit details
    Browse the repository at this point in the history
  23. Update GA4 modules to use new init method

    Some of the GA4 modules use window.GOVUK.Modules and so the way they
    initialise needs to be updated in-line with how other JS modules are
    initialised. Tests for the GA4 modules that are effected have been
    updated to take into account the new initialisation method.
    MartinJJones committed May 17, 2024
    Configuration menu
    Copy the full SHA
    f3b11ce View commit details
    Browse the repository at this point in the history
  24. Update lib modules to use init

    jon-kirwan authored and MartinJJones committed May 17, 2024
    Configuration menu
    Copy the full SHA
    3dab7a2 View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    62110c5 View commit details
    Browse the repository at this point in the history
  26. Fix toggle specs

    jon-kirwan authored and MartinJJones committed May 17, 2024
    Configuration menu
    Copy the full SHA
    b1b6fc3 View commit details
    Browse the repository at this point in the history
  27. Update feedback.js

    MartinJJones committed May 17, 2024
    Configuration menu
    Copy the full SHA
    4c3b470 View commit details
    Browse the repository at this point in the history