{"action":"created","issue":{"url":"https://api.github.com/repos/atom/atom/issues/11370","repository_url":"https://api.github.com/repos/atom/atom","labels_url":"https://api.github.com/repos/atom/atom/issues/11370/labels{/name}","comments_url":"https://api.github.com/repos/atom/atom/issues/11370/comments","events_url":"https://api.github.com/repos/atom/atom/issues/11370/events","html_url":"https://github.com/atom/atom/pull/11370","id":145797438,"number":11370,"title":"Tokenize visible buffer chunk immediately","user":{"login":"hellendag","id":2823852,"avatar_url":"https://avatars.githubusercontent.com/u/2823852?v=3","gravatar_id":"","url":"https://api.github.com/users/hellendag","html_url":"https://github.com/hellendag","followers_url":"https://api.github.com/users/hellendag/followers","following_url":"https://api.github.com/users/hellendag/following{/other_user}","gists_url":"https://api.github.com/users/hellendag/gists{/gist_id}","starred_url":"https://api.github.com/users/hellendag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hellendag/subscriptions","organizations_url":"https://api.github.com/users/hellendag/orgs","repos_url":"https://api.github.com/users/hellendag/repos","events_url":"https://api.github.com/users/hellendag/events{/privacy}","received_events_url":"https://api.github.com/users/hellendag/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/atom/atom/labels/atom","name":"atom","color":"f7c6c7"},{"url":"https://api.github.com/repos/atom/atom/labels/needs-review","name":"needs-review","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-04-04T20:40:25Z","updated_at":"2016-04-28T01:03:30Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/atom/atom/pulls/11370","html_url":"https://github.com/atom/atom/pull/11370","diff_url":"https://github.com/atom/atom/pull/11370.diff","patch_url":"https://github.com/atom/atom/pull/11370.patch"},"body":"When opening a new file, there is currently a flash of unstyled content (\"FOUC\") between the point where the file is first rendered and when syntax highlights are rendered. This gap can be hundreds of milliseconds, and the flash can be jarring.\r\n\r\nTo resolve this, I propose paying some tokenizing costs up front so that the first rendering of the file is already highlighted. Tokenize the first chunk, then defer the rest.\r\n\r\nThis means implicitly adding 20ms or so to the initial render pass, but there is no longer a jarring style change.\r\n\r\nTest Plan:\r\n\r\nOpen JS files of varying sizes. Verify that the initial render of the file is already highlighted, with no flash."},"comment":{"url":"https://api.github.com/repos/atom/atom/issues/comments/215277626","html_url":"https://github.com/atom/atom/pull/11370#issuecomment-215277626","issue_url":"https://api.github.com/repos/atom/atom/issues/11370","id":215277626,"user":{"login":"lee-dohm","id":1038121,"avatar_url":"https://avatars.githubusercontent.com/u/1038121?v=3","gravatar_id":"","url":"https://api.github.com/users/lee-dohm","html_url":"https://github.com/lee-dohm","followers_url":"https://api.github.com/users/lee-dohm/followers","following_url":"https://api.github.com/users/lee-dohm/following{/other_user}","gists_url":"https://api.github.com/users/lee-dohm/gists{/gist_id}","starred_url":"https://api.github.com/users/lee-dohm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lee-dohm/subscriptions","organizations_url":"https://api.github.com/users/lee-dohm/orgs","repos_url":"https://api.github.com/users/lee-dohm/repos","events_url":"https://api.github.com/users/lee-dohm/events{/privacy}","received_events_url":"https://api.github.com/users/lee-dohm/received_events","type":"User","site_admin":true},"created_at":"2016-04-28T01:03:30Z","updated_at":"2016-04-28T01:03:30Z","body":"I'm concerned about the edge cases of this, for example with files with excessively long lines, this might cause the text to not be displayed for a noticeably long time. This is something that I would consider much more jarring than waiting a moment for the text to be highlighted."}}