{"action":"created","issue":{"url":"https://api.github.com/repos/shakacode/react_on_rails/issues/1150","repository_url":"https://api.github.com/repos/shakacode/react_on_rails","labels_url":"https://api.github.com/repos/shakacode/react_on_rails/issues/1150/labels{/name}","comments_url":"https://api.github.com/repos/shakacode/react_on_rails/issues/1150/comments","events_url":"https://api.github.com/repos/shakacode/react_on_rails/issues/1150/events","html_url":"https://github.com/shakacode/react_on_rails/issues/1150","id":364622612,"node_id":"MDU6SXNzdWUzNjQ2MjI2MTI=","number":1150,"title":"reactOnRailsPageLoaded invoked before deferred scripts are completed","user":{"login":"rakelley","id":2120688,"node_id":"MDQ6VXNlcjIxMjA2ODg=","avatar_url":"https://avatars0.githubusercontent.com/u/2120688?v=4","gravatar_id":"","url":"https://api.github.com/users/rakelley","html_url":"https://github.com/rakelley","followers_url":"https://api.github.com/users/rakelley/followers","following_url":"https://api.github.com/users/rakelley/following{/other_user}","gists_url":"https://api.github.com/users/rakelley/gists{/gist_id}","starred_url":"https://api.github.com/users/rakelley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rakelley/subscriptions","organizations_url":"https://api.github.com/users/rakelley/orgs","repos_url":"https://api.github.com/users/rakelley/repos","events_url":"https://api.github.com/users/rakelley/events{/privacy}","received_events_url":"https://api.github.com/users/rakelley/received_events","type":"User","site_admin":false},"labels":[{"id":250686258,"node_id":"MDU6TGFiZWwyNTA2ODYyNTg=","url":"https://api.github.com/repos/shakacode/react_on_rails/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-09-27T19:33:42Z","updated_at":"2018-10-09T11:50:23Z","closed_at":"2018-10-06T21:43:54Z","author_association":"CONTRIBUTOR","body":"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).\r\n\r\nThe offending code is the timeout declared [here](https://github.com/shakacode/react_on_rails/blob/master/node_package/src/clientStartup.js#L199) 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.\r\n\r\nBy 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`.\r\n\r\nIs it intentional that `reactOnRailsPageLoaded` is called before `DOMContentLoaded`, if any only if Turbolinks is disabled?"},"comment":{"url":"https://api.github.com/repos/shakacode/react_on_rails/issues/comments/428162412","html_url":"https://github.com/shakacode/react_on_rails/issues/1150#issuecomment-428162412","issue_url":"https://api.github.com/repos/shakacode/react_on_rails/issues/1150","id":428162412,"node_id":"MDEyOklzc3VlQ29tbWVudDQyODE2MjQxMg==","user":{"login":"rakelley","id":2120688,"node_id":"MDQ6VXNlcjIxMjA2ODg=","avatar_url":"https://avatars0.githubusercontent.com/u/2120688?v=4","gravatar_id":"","url":"https://api.github.com/users/rakelley","html_url":"https://github.com/rakelley","followers_url":"https://api.github.com/users/rakelley/followers","following_url":"https://api.github.com/users/rakelley/following{/other_user}","gists_url":"https://api.github.com/users/rakelley/gists{/gist_id}","starred_url":"https://api.github.com/users/rakelley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rakelley/subscriptions","organizations_url":"https://api.github.com/users/rakelley/orgs","repos_url":"https://api.github.com/users/rakelley/repos","events_url":"https://api.github.com/users/rakelley/events{/privacy}","received_events_url":"https://api.github.com/users/rakelley/received_events","type":"User","site_admin":false},"created_at":"2018-10-09T11:50:23Z","updated_at":"2018-10-09T11:50:23Z","author_association":"CONTRIBUTOR","body":"@justin808 Yes, 11.0.6 is working for us in all scenarios, thank you for the quick turn-around."}}
{"actor":{"display_login":"rakelley"}}