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
When Turbolinks is disabled, clientStartup.js can invoke reactOnRailsPageLoaded in a manner that appears premature and unintentional (and is causing my team no end to grief).
The offending code is the timeout declared here with the condition if (document.readyState === 'complete' || document.readyState !== 'loading' && !document.documentElement.doScroll) {. A readyState of interactive while deferred scripts are still being processed will lead to reactOnRailsPageLoaded being called before all components have been registered. From our testing, Chrome seems to be the only browser fast enough to actually trigger this behavior, but it's a serious issue for us, made worse if utilizing preloading/server-push.
By the surrounding debug messages and the choice to use DOMContentLoaded event handlers, the intention seems to be that reactOnRailsPageLoaded should not be invoked until the page is actually loaded, which is not merely readyState = interactive but post-DOMContentLoaded.
Is it intentional that reactOnRailsPageLoaded is called before DOMContentLoaded, if any only if Turbolinks is disabled?
The text was updated successfully, but these errors were encountered:
When Turbolinks is disabled,
clientStartup.js
can invokereactOnRailsPageLoaded
in a manner that appears premature and unintentional (and is causing my team no end to grief).The offending code is the timeout declared here with the condition
if (document.readyState === 'complete' || document.readyState !== 'loading' && !document.documentElement.doScroll) {
. A readyState ofinteractive
while deferred scripts are still being processed will lead toreactOnRailsPageLoaded
being called before all components have been registered. From our testing, Chrome seems to be the only browser fast enough to actually trigger this behavior, but it's a serious issue for us, made worse if utilizing preloading/server-push.By the surrounding debug messages and the choice to use
DOMContentLoaded
event handlers, the intention seems to be thatreactOnRailsPageLoaded
should not be invoked until the page is actually loaded, which is not merelyreadyState = interactive
but post-DOMContentLoaded
.Is it intentional that
reactOnRailsPageLoaded
is called beforeDOMContentLoaded
, if any only if Turbolinks is disabled?The text was updated successfully, but these errors were encountered: