alphagov / govuk-frontend

GOV.UK Frontend contains the code you need to start building a user interface for government platforms and services.
https://frontend.design-system.service.gov.uk/
MIT License
1.18k stars 325 forks source link

Manually test that v5 works with the Prototype Kit #3484

Closed romaricpascal closed 1 year ago

romaricpascal commented 1 year ago

What

Share our strategy for loading JavaScript to the Prototype Kit team and confirm that necessary changes on their side are feasible. Use the change they've made and validate that it works, e.g. build a prototype kit review app.

Add a Prototype Kit example loading the govuk-frontend package using the new Prototype Kit option for loading scripts using type="module".

The approach discussed on Slack would be to create a new workspace that:

Post v5, we can look into added automated tests to check that assets load OK (using Jest + Puppeteer).

Why

We'll be updating how our JavaScript loads in the browser and need to make sure that our approach is compatible with what the Prototype Kit can support.

Who needs to work on this

Developers

Who needs to review this

Developers

Done when

36degrees commented 1 year ago

The Prototype Kit team have created an issue to allow scripts loaded using the plugin system to use type="module".

colinrotherham commented 1 year ago

Moving this to blocked for now

The new type="module" feature works great but the kit tries to initialise itself before GOV.UK Frontend is available

  1. Preview branch govuk-frontend installs causes test timeouts
  2. Preview branch govuk-frontend is replaced with v4.5.0 (or latest) in test teardowns
  3. Heroku password pages have hard-coded "allowed" files from GOV.UK Frontend
  4. Prototype management pages and plugins can still run GOV.UK Frontend v4

These aren't necessarily blockers but you can track progress in:

colinrotherham commented 1 year ago

Just an update to track progress a little better

The following changes were made by the Prototype Kit team:

With support fixes contributed by GOV.UK Frontend:

But with extra backwards compatibility considerations from GOV.UK Frontend too: