{"action":"opened","number":396,"pull_request":{"url":"https://api.github.com/repos/dekujs/deku/pulls/396","id":57783969,"html_url":"https://github.com/dekujs/deku/pull/396","diff_url":"https://github.com/dekujs/deku/pull/396.diff","patch_url":"https://github.com/dekujs/deku/pull/396.patch","issue_url":"https://api.github.com/repos/dekujs/deku/issues/396","number":396,"state":"open","locked":false,"title":"a better way to handle pre-rendered HTML (including: event handler registration)","user":{"login":"0a-","id":10269911,"avatar_url":"https://avatars.githubusercontent.com/u/10269911?v=3","gravatar_id":"","url":"https://api.github.com/users/0a-","html_url":"https://github.com/0a-","followers_url":"https://api.github.com/users/0a-/followers","following_url":"https://api.github.com/users/0a-/following{/other_user}","gists_url":"https://api.github.com/users/0a-/gists{/gist_id}","starred_url":"https://api.github.com/users/0a-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/0a-/subscriptions","organizations_url":"https://api.github.com/users/0a-/orgs","repos_url":"https://api.github.com/users/0a-/repos","events_url":"https://api.github.com/users/0a-/events{/privacy}","received_events_url":"https://api.github.com/users/0a-/received_events","type":"User","site_admin":false},"body":"Great thanks to @aeosynth for the feedback on the previous PR ( #395 ). I have now fixed a few things that were overlooked in the previous implementation:\r\n\r\n1. Now the event handler registration works with the pre-rendered HTML. \r\n\r\nTurns on this requires to reconstruct the `createElement` function slightly so that there is a clear separation of side-effect from the creation of DOM Element from the Virtual DOM. As a result we can now run the side-effects on a DOM element of our choice (i.e., in this case, the pre-rendered element) without making a great mess. \r\n\r\nTo prevent pre-rendered content data from \"flickering\" ( #190 ) I have also added an option parameter for `.setAttribute`. We can now choose to filter out some side-effects on the DOM elements that we don't. (E.g. When running the side-effects on a pre-rendered DOM element, we are only concerned with those that add eventListener to it and not those that rewrite its attributes. The filtering is now done by `option.onlyEventListeners`).\r\n\r\n2. On the client-side, for the self-healing feature to kick in, a user can now choose to set either the attribute `autoFix` for string-comparison or `checksum=\"{value generated on the server-side}\"` on the container. ","created_at":"2016-01-31T23:12:56Z","updated_at":"2016-01-31T23:12:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dekujs/deku/pulls/396/commits","review_comments_url":"https://api.github.com/repos/dekujs/deku/pulls/396/comments","review_comment_url":"https://api.github.com/repos/dekujs/deku/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dekujs/deku/issues/396/comments","statuses_url":"https://api.github.com/repos/dekujs/deku/statuses/8a9e5271d7515adc1c32984d0569d2a5a0d7bf98","head":{"label":"0a-:master","ref":"master","sha":"8a9e5271d7515adc1c32984d0569d2a5a0d7bf98","user":{"login":"0a-","id":10269911,"avatar_url":"https://avatars.githubusercontent.com/u/10269911?v=3","gravatar_id":"","url":"https://api.github.com/users/0a-","html_url":"https://github.com/0a-","followers_url":"https://api.github.com/users/0a-/followers","following_url":"https://api.github.com/users/0a-/following{/other_user}","gists_url":"https://api.github.com/users/0a-/gists{/gist_id}","starred_url":"https://api.github.com/users/0a-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/0a-/subscriptions","organizations_url":"https://api.github.com/users/0a-/orgs","repos_url":"https://api.github.com/users/0a-/repos","events_url":"https://api.github.com/users/0a-/events{/privacy}","received_events_url":"https://api.github.com/users/0a-/received_events","type":"User","site_admin":false},"repo":{"id":50082633,"name":"deku","full_name":"0a-/deku","owner":{"login":"0a-","id":10269911,"avatar_url":"https://avatars.githubusercontent.com/u/10269911?v=3","gravatar_id":"","url":"https://api.github.com/users/0a-","html_url":"https://github.com/0a-","followers_url":"https://api.github.com/users/0a-/followers","following_url":"https://api.github.com/users/0a-/following{/other_user}","gists_url":"https://api.github.com/users/0a-/gists{/gist_id}","starred_url":"https://api.github.com/users/0a-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/0a-/subscriptions","organizations_url":"https://api.github.com/users/0a-/orgs","repos_url":"https://api.github.com/users/0a-/repos","events_url":"https://api.github.com/users/0a-/events{/privacy}","received_events_url":"https://api.github.com/users/0a-/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/0a-/deku","description":"Render interfaces using pure functions and virtual DOM","fork":true,"url":"https://api.github.com/repos/0a-/deku","forks_url":"https://api.github.com/repos/0a-/deku/forks","keys_url":"https://api.github.com/repos/0a-/deku/keys{/key_id}","collaborators_url":"https://api.github.com/repos/0a-/deku/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/0a-/deku/teams","hooks_url":"https://api.github.com/repos/0a-/deku/hooks","issue_events_url":"https://api.github.com/repos/0a-/deku/issues/events{/number}","events_url":"https://api.github.com/repos/0a-/deku/events","assignees_url":"https://api.github.com/repos/0a-/deku/assignees{/user}","branches_url":"https://api.github.com/repos/0a-/deku/branches{/branch}","tags_url":"https://api.github.com/repos/0a-/deku/tags","blobs_url":"https://api.github.com/repos/0a-/deku/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/0a-/deku/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/0a-/deku/git/refs{/sha}","trees_url":"https://api.github.com/repos/0a-/deku/git/trees{/sha}","statuses_url":"https://api.github.com/repos/0a-/deku/statuses/{sha}","languages_url":"https://api.github.com/repos/0a-/deku/languages","stargazers_url":"https://api.github.com/repos/0a-/deku/stargazers","contributors_url":"https://api.github.com/repos/0a-/deku/contributors","subscribers_url":"https://api.github.com/repos/0a-/deku/subscribers","subscription_url":"https://api.github.com/repos/0a-/deku/subscription","commits_url":"https://api.github.com/repos/0a-/deku/commits{/sha}","git_commits_url":"https://api.github.com/repos/0a-/deku/git/commits{/sha}","comments_url":"https://api.github.com/repos/0a-/deku/comments{/number}","issue_comment_url":"https://api.github.com/repos/0a-/deku/issues/comments{/number}","contents_url":"https://api.github.com/repos/0a-/deku/contents/{+path}","compare_url":"https://api.github.com/repos/0a-/deku/compare/{base}...{head}","merges_url":"https://api.github.com/repos/0a-/deku/merges","archive_url":"https://api.github.com/repos/0a-/deku/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/0a-/deku/downloads","issues_url":"https://api.github.com/repos/0a-/deku/issues{/number}","pulls_url":"https://api.github.com/repos/0a-/deku/pulls{/number}","milestones_url":"https://api.github.com/repos/0a-/deku/milestones{/number}","notifications_url":"https://api.github.com/repos/0a-/deku/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/0a-/deku/labels{/name}","releases_url":"https://api.github.com/repos/0a-/deku/releases{/id}","deployments_url":"https://api.github.com/repos/0a-/deku/deployments","created_at":"2016-01-21T04:43:37Z","updated_at":"2016-01-21T04:43:39Z","pushed_at":"2016-01-31T22:48:08Z","git_url":"git://github.com/0a-/deku.git","ssh_url":"git@github.com:0a-/deku.git","clone_url":"https://github.com/0a-/deku.git","svn_url":"https://github.com/0a-/deku","homepage":"http://dekujs.github.io/deku","size":2338,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dekujs:master","ref":"master","sha":"5c2fbef9df307e5eff32fd068f601d04e479667f","user":{"login":"dekujs","id":12415915,"avatar_url":"https://avatars.githubusercontent.com/u/12415915?v=3","gravatar_id":"","url":"https://api.github.com/users/dekujs","html_url":"https://github.com/dekujs","followers_url":"https://api.github.com/users/dekujs/followers","following_url":"https://api.github.com/users/dekujs/following{/other_user}","gists_url":"https://api.github.com/users/dekujs/gists{/gist_id}","starred_url":"https://api.github.com/users/dekujs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dekujs/subscriptions","organizations_url":"https://api.github.com/users/dekujs/orgs","repos_url":"https://api.github.com/users/dekujs/repos","events_url":"https://api.github.com/users/dekujs/events{/privacy}","received_events_url":"https://api.github.com/users/dekujs/received_events","type":"Organization","site_admin":false},"repo":{"id":22746070,"name":"deku","full_name":"dekujs/deku","owner":{"login":"dekujs","id":12415915,"avatar_url":"https://avatars.githubusercontent.com/u/12415915?v=3","gravatar_id":"","url":"https://api.github.com/users/dekujs","html_url":"https://github.com/dekujs","followers_url":"https://api.github.com/users/dekujs/followers","following_url":"https://api.github.com/users/dekujs/following{/other_user}","gists_url":"https://api.github.com/users/dekujs/gists{/gist_id}","starred_url":"https://api.github.com/users/dekujs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dekujs/subscriptions","organizations_url":"https://api.github.com/users/dekujs/orgs","repos_url":"https://api.github.com/users/dekujs/repos","events_url":"https://api.github.com/users/dekujs/events{/privacy}","received_events_url":"https://api.github.com/users/dekujs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dekujs/deku","description":"Render interfaces using pure functions and virtual DOM","fork":false,"url":"https://api.github.com/repos/dekujs/deku","forks_url":"https://api.github.com/repos/dekujs/deku/forks","keys_url":"https://api.github.com/repos/dekujs/deku/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dekujs/deku/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dekujs/deku/teams","hooks_url":"https://api.github.com/repos/dekujs/deku/hooks","issue_events_url":"https://api.github.com/repos/dekujs/deku/issues/events{/number}","events_url":"https://api.github.com/repos/dekujs/deku/events","assignees_url":"https://api.github.com/repos/dekujs/deku/assignees{/user}","branches_url":"https://api.github.com/repos/dekujs/deku/branches{/branch}","tags_url":"https://api.github.com/repos/dekujs/deku/tags","blobs_url":"https://api.github.com/repos/dekujs/deku/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dekujs/deku/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dekujs/deku/git/refs{/sha}","trees_url":"https://api.github.com/repos/dekujs/deku/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dekujs/deku/statuses/{sha}","languages_url":"https://api.github.com/repos/dekujs/deku/languages","stargazers_url":"https://api.github.com/repos/dekujs/deku/stargazers","contributors_url":"https://api.github.com/repos/dekujs/deku/contributors","subscribers_url":"https://api.github.com/repos/dekujs/deku/subscribers","subscription_url":"https://api.github.com/repos/dekujs/deku/subscription","commits_url":"https://api.github.com/repos/dekujs/deku/commits{/sha}","git_commits_url":"https://api.github.com/repos/dekujs/deku/git/commits{/sha}","comments_url":"https://api.github.com/repos/dekujs/deku/comments{/number}","issue_comment_url":"https://api.github.com/repos/dekujs/deku/issues/comments{/number}","contents_url":"https://api.github.com/repos/dekujs/deku/contents/{+path}","compare_url":"https://api.github.com/repos/dekujs/deku/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dekujs/deku/merges","archive_url":"https://api.github.com/repos/dekujs/deku/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dekujs/deku/downloads","issues_url":"https://api.github.com/repos/dekujs/deku/issues{/number}","pulls_url":"https://api.github.com/repos/dekujs/deku/pulls{/number}","milestones_url":"https://api.github.com/repos/dekujs/deku/milestones{/number}","notifications_url":"https://api.github.com/repos/dekujs/deku/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dekujs/deku/labels{/name}","releases_url":"https://api.github.com/repos/dekujs/deku/releases{/id}","deployments_url":"https://api.github.com/repos/dekujs/deku/deployments","created_at":"2014-08-08T04:32:23Z","updated_at":"2016-01-31T22:39:28Z","pushed_at":"2016-01-31T23:12:56Z","git_url":"git://github.com/dekujs/deku.git","ssh_url":"git@github.com:dekujs/deku.git","clone_url":"https://github.com/dekujs/deku.git","svn_url":"https://github.com/dekujs/deku","homepage":"http://dekujs.github.io/deku","size":2458,"stargazers_count":2377,"watchers_count":2377,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":96,"mirror_url":null,"open_issues_count":20,"forks":96,"open_issues":20,"watchers":2377,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dekujs/deku/pulls/396"},"html":{"href":"https://github.com/dekujs/deku/pull/396"},"issue":{"href":"https://api.github.com/repos/dekujs/deku/issues/396"},"comments":{"href":"https://api.github.com/repos/dekujs/deku/issues/396/comments"},"review_comments":{"href":"https://api.github.com/repos/dekujs/deku/pulls/396/comments"},"review_comment":{"href":"https://api.github.com/repos/dekujs/deku/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dekujs/deku/pulls/396/commits"},"statuses":{"href":"https://api.github.com/repos/dekujs/deku/statuses/8a9e5271d7515adc1c32984d0569d2a5a0d7bf98"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":7,"additions":144,"deletions":48,"changed_files":7}}