govuk-frontend
govuk-frontend copied to clipboard
Use async file operations for helpers
This PR aims to remove IO blocking readFileSync()
calls (including component directory listings)
Puppeteer tests are running super quickly 😊
https://user-images.githubusercontent.com/415517/191203826-04de51dc-f34f-431e-8042-ab45bf0effeb.mp4
Converting to draft whilst I look at the various timeouts. Unblocking IO may have made Jest or Puppeteer trip over
Thanks for splitting the commits and going through all these changes. The move to async looks good to me, I like how it feels more parallel-y with the Promise.all
🙌🏻 .
Only concern I have in that PR is the naming move from componentData
to component
that:
- looses the separation between the data about the component and the component itself
- makes it weird with the types of a lot of
component
variables beingComponentData
It feels a bit nitpicky and I'm not holding strongly to going back to componentData
, but thought I'd mention it 😄
Ha, that's fine
Consistency wise, I'm more than happy to make everything componentData
Consistency was the aim, not the name 🙌
Or rename the @typedef
to Component?
Making everything componentData
makes more sense to me, as we keep the distinction from the component itself (in case we ever have tests that need to reference both).
Making everything
componentData
makes more sense to me, as we keep the distinction from the component itself (in case we ever have tests that need to reference both).
@romaricpascal All sorted, now using componentData
instead 🎉