{"action":"created","issue":{"url":"https://api.github.com/repos/tobibako45/genba-rails/issues/2","repository_url":"https://api.github.com/repos/tobibako45/genba-rails","labels_url":"https://api.github.com/repos/tobibako45/genba-rails/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/tobibako45/genba-rails/issues/2/comments","events_url":"https://api.github.com/repos/tobibako45/genba-rails/issues/2/events","html_url":"https://github.com/tobibako45/genba-rails/issues/2","id":424718266,"node_id":"MDU6SXNzdWU0MjQ3MTgyNjY=","number":2,"title":"Turbolinks備忘録","user":{"login":"tobibako45","id":35980114,"node_id":"MDQ6VXNlcjM1OTgwMTE0","avatar_url":"https://avatars1.githubusercontent.com/u/35980114?v=4","gravatar_id":"","url":"https://api.github.com/users/tobibako45","html_url":"https://github.com/tobibako45","followers_url":"https://api.github.com/users/tobibako45/followers","following_url":"https://api.github.com/users/tobibako45/following{/other_user}","gists_url":"https://api.github.com/users/tobibako45/gists{/gist_id}","starred_url":"https://api.github.com/users/tobibako45/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tobibako45/subscriptions","organizations_url":"https://api.github.com/users/tobibako45/orgs","repos_url":"https://api.github.com/users/tobibako45/repos","events_url":"https://api.github.com/users/tobibako45/events{/privacy}","received_events_url":"https://api.github.com/users/tobibako45/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2019-03-25T04:27:46Z","updated_at":"2019-03-25T04:39:12Z","closed_at":null,"author_association":"OWNER","body":"## Turbolinks専用のイベントを使わないとダメ。\r\n\r\nTurbolinksを利用している場合は、\r\n\r\n```\r\ndocdocument.addEventListener('turbolinks:load', function () {\r\n   console.log('Hellow wprld!');\r\n});\r\n```\r\n\r\nとしないと、正しく動かない。\r\n$(document).ready()やwindow.onloadとかはうまく動かない。\r\n\r\n既存のJS資産を流用する場合も対応させておく必要がある。"},"comment":{"url":"https://api.github.com/repos/tobibako45/genba-rails/issues/comments/476052507","html_url":"https://github.com/tobibako45/genba-rails/issues/2#issuecomment-476052507","issue_url":"https://api.github.com/repos/tobibako45/genba-rails/issues/2","id":476052507,"node_id":"MDEyOklzc3VlQ29tbWVudDQ3NjA1MjUwNw==","user":{"login":"tobibako45","id":35980114,"node_id":"MDQ6VXNlcjM1OTgwMTE0","avatar_url":"https://avatars1.githubusercontent.com/u/35980114?v=4","gravatar_id":"","url":"https://api.github.com/users/tobibako45","html_url":"https://github.com/tobibako45","followers_url":"https://api.github.com/users/tobibako45/followers","following_url":"https://api.github.com/users/tobibako45/following{/other_user}","gists_url":"https://api.github.com/users/tobibako45/gists{/gist_id}","starred_url":"https://api.github.com/users/tobibako45/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tobibako45/subscriptions","organizations_url":"https://api.github.com/users/tobibako45/orgs","repos_url":"https://api.github.com/users/tobibako45/repos","events_url":"https://api.github.com/users/tobibako45/events{/privacy}","received_events_url":"https://api.github.com/users/tobibako45/received_events","type":"User","site_admin":false},"created_at":"2019-03-25T04:39:12Z","updated_at":"2019-03-25T04:39:12Z","author_association":"OWNER","body":"## Turbolinksを利用する際は、できる限りまとめる\r\n\r\napplication.jsとapplicationcssを一つにまとめることが重要。\r\nTurbolinksの高速化のキモは、これらの共通アセットｎ読み込みの頻度をへらすことにある。\r\nページごとにJSやCSSファイルが異なるようだと、ページ遷移のたびに再読込が発生して、高速化の効果を十分に受けられない。"}}
{"actor":{"display_login":"tobibako45"}}