Closed romaricpascal closed 1 year ago
The Prototype Kit team have created an issue to allow scripts loaded using the plugin system to use type="module"
.
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
govuk-frontend
installs causes test timeoutsgovuk-frontend
is replaced with v4.5.0 (or latest) in test teardownsThese aren't necessarily blockers but you can track progress in:
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:
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 usingtype="module"
.The approach discussed on Slack would be to create a new workspace that:
npx govuk-prototype-kit create dist
to scaffold a new kitgovuk-frontend
package to use the one inpackages
withnpm link
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