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
#10 tried to resolve an issue where a closed network notice would still appear on page load and later cause a content shift when it was removed once the JS executed. However since ext.networknotice.Notice.js doesn't actually get to execute until most other JS has also loaded via the MediaWiki ResourceLoader, this is too late to solve the issue as the page has already entered the interactive state by then.
I would suggest instead of loading the script via ResourceLoader that the the contents of ext.networknotice.Notice.js are inlined right below the notice HTML to ensure init() properly executes on the interactive event. After minification this script is only 759 bytes and should only appear on pages with the notice so the impact on overall load time should be negligible and the benefits of reducing layout shift should be well worth it.
The text was updated successfully, but these errors were encountered:
#10 tried to resolve an issue where a closed network notice would still appear on page load and later cause a content shift when it was removed once the JS executed. However since
ext.networknotice.Notice.js
doesn't actually get to execute until most other JS has also loaded via the MediaWiki ResourceLoader, this is too late to solve the issue as the page has already entered theinteractive
state by then.I would suggest instead of loading the script via ResourceLoader that the the contents of
ext.networknotice.Notice.js
are inlined right below the notice HTML to ensureinit()
properly executes on the interactive event. After minification this script is only 759 bytes and should only appear on pages with the notice so the impact on overall load time should be negligible and the benefits of reducing layout shift should be well worth it.The text was updated successfully, but these errors were encountered: