You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We call things like window.GOVUK = window.GOVUK || {} at various points throughout our code, as well as several variations (e.g. window.GOVUK.Modules = window.GOVUK.Modules || {}).
Recent changes have highlighted that this approach means that some of our code is somewhat brittle because we don't always check for everything we should check for. Adding new code is fine, but if old code is removed that takes away something that isn't being checked for, we get an error.
The reason for having some of these calls is because different applications include different components, so they can't always assume that window.GOVUK.Modules exists. However this means that lines of code are repeated.
We should investigate whether it would be possible to put all these calls and their variants together in one place, before any other code executes.
The text was updated successfully, but these errors were encountered:
We call things like
window.GOVUK = window.GOVUK || {}
at various points throughout our code, as well as several variations (e.g.window.GOVUK.Modules = window.GOVUK.Modules || {}
).Recent changes have highlighted that this approach means that some of our code is somewhat brittle because we don't always check for everything we should check for. Adding new code is fine, but if old code is removed that takes away something that isn't being checked for, we get an error.
The reason for having some of these calls is because different applications include different components, so they can't always assume that
window.GOVUK.Modules
exists. However this means that lines of code are repeated.We should investigate whether it would be possible to put all these calls and their variants together in one place, before any other code executes.
The text was updated successfully, but these errors were encountered: