{"action":"created","comment":{"url":"https://api.github.com/repos/Wikia/infobox-template-builder/pulls/comments/41066517","id":41066517,"diff_hunk":"@@ -1,6 +1,44 @@\n 'use strict';\n+import {Model} from './model';\n+import {serialize, deserialize} from './serializers/xml';\n+import {persist} from './adapters/mediawiki';\n+\n+export {Core as InfoboxTemplateBuilder};","path":"src/core.js","position":6,"original_position":6,"commit_id":"cd88dbfb460617e2fc7d81dc4f6e0339a7d4067b","original_commit_id":"cd88dbfb460617e2fc7d81dc4f6e0339a7d4067b","user":{"login":"kenkouot","id":2964310,"avatar_url":"https://avatars.githubusercontent.com/u/2964310?v=3","gravatar_id":"","url":"https://api.github.com/users/kenkouot","html_url":"https://github.com/kenkouot","followers_url":"https://api.github.com/users/kenkouot/followers","following_url":"https://api.github.com/users/kenkouot/following{/other_user}","gists_url":"https://api.github.com/users/kenkouot/gists{/gist_id}","starred_url":"https://api.github.com/users/kenkouot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kenkouot/subscriptions","organizations_url":"https://api.github.com/users/kenkouot/orgs","repos_url":"https://api.github.com/users/kenkouot/repos","events_url":"https://api.github.com/users/kenkouot/events{/privacy}","received_events_url":"https://api.github.com/users/kenkouot/received_events","type":"User","site_admin":false},"body":"Yep, they are hoisted in ES6, and imports/exports at the top seems to be the de facto best practice. Note, class definitions are not hoisted in TypeScript.","created_at":"2015-10-02T20:54:30Z","updated_at":"2015-10-02T20:54:30Z","html_url":"https://github.com/Wikia/infobox-template-builder/pull/2#discussion_r41066517","pull_request_url":"https://api.github.com/repos/Wikia/infobox-template-builder/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/Wikia/infobox-template-builder/pulls/comments/41066517"},"html":{"href":"https://github.com/Wikia/infobox-template-builder/pull/2#discussion_r41066517"},"pull_request":{"href":"https://api.github.com/repos/Wikia/infobox-template-builder/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/Wikia/infobox-template-builder/pulls/2","id":46600952,"html_url":"https://github.com/Wikia/infobox-template-builder/pull/2","diff_url":"https://github.com/Wikia/infobox-template-builder/pull/2.diff","patch_url":"https://github.com/Wikia/infobox-template-builder/pull/2.patch","issue_url":"https://api.github.com/repos/Wikia/infobox-template-builder/issues/2","number":2,"state":"open","locked":false,"title":"CONSF-38: Create Core class and implement simple observable Model class","user":{"login":"kenkouot","id":2964310,"avatar_url":"https://avatars.githubusercontent.com/u/2964310?v=3","gravatar_id":"","url":"https://api.github.com/users/kenkouot","html_url":"https://github.com/kenkouot","followers_url":"https://api.github.com/users/kenkouot/followers","following_url":"https://api.github.com/users/kenkouot/following{/other_user}","gists_url":"https://api.github.com/users/kenkouot/gists{/gist_id}","starred_url":"https://api.github.com/users/kenkouot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kenkouot/subscriptions","organizations_url":"https://api.github.com/users/kenkouot/orgs","repos_url":"https://api.github.com/users/kenkouot/repos","events_url":"https://api.github.com/users/kenkouot/events{/privacy}","received_events_url":"https://api.github.com/users/kenkouot/received_events","type":"User","site_admin":false},"body":"Stubs out `Core` class module and also implements a `Model` class built on top of a micro-EventEmitter implementation.\r\n\r\n### Proposed API & Usage\r\n```es6\r\nconst piXmlDocument = /** fetched from mw **/;\r\nconst builder = new InfoboxTemplateBuilder({\r\n  from: piXmlDocument\r\n});\r\n\r\n// Set some data on the infobox (note, this setter API is not set up for the ordered nature of the infobox data structure yet, so expect additional methods that support the Infobox schema's specifics\r\nbuilder.data.set('foo', 1);\r\n// Set some theme data (which is a straight flat k:v structure\r\nbuilder.theme.set('color', '#fff');\r\n// serialize and persist the data to MW\r\nbuilder.save();\r\n\r\n// Usage from UI\r\n// from inside a view\r\n// MyGenericView\r\n{\r\n  init() {\r\n    builder.data.on('propertyDidChange', this.render);\r\n    builder.theme.on('propertyDidChange', this.buildStyles);\r\n  },\r\n\r\n  render() {/* does something */},\r\n  \r\n  buildStyles() {/* does something */} \r\n\r\n  onUserClickedSaveButton() {\r\n    builder.save().then(/* profit */);\r\n  } \r\n}\r\n```","created_at":"2015-10-02T03:44:34Z","updated_at":"2015-10-02T20:54:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fdabbd42d18ecdc936f6f57d5216be90f44493fe","assignee":{"login":"lizlux","id":201367,"avatar_url":"https://avatars.githubusercontent.com/u/201367?v=3","gravatar_id":"","url":"https://api.github.com/users/lizlux","html_url":"https://github.com/lizlux","followers_url":"https://api.github.com/users/lizlux/followers","following_url":"https://api.github.com/users/lizlux/following{/other_user}","gists_url":"https://api.github.com/users/lizlux/gists{/gist_id}","starred_url":"https://api.github.com/users/lizlux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lizlux/subscriptions","organizations_url":"https://api.github.com/users/lizlux/orgs","repos_url":"https://api.github.com/users/lizlux/repos","events_url":"https://api.github.com/users/lizlux/events{/privacy}","received_events_url":"https://api.github.com/users/lizlux/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/Wikia/infobox-template-builder/pulls/2/commits","review_comments_url":"https://api.github.com/repos/Wikia/infobox-template-builder/pulls/2/comments","review_comment_url":"https://api.github.com/repos/Wikia/infobox-template-builder/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Wikia/infobox-template-builder/issues/2/comments","statuses_url":"https://api.github.com/repos/Wikia/infobox-template-builder/statuses/cd88dbfb460617e2fc7d81dc4f6e0339a7d4067b","head":{"label":"Wikia:CONSF-38-core","ref":"CONSF-38-core","sha":"cd88dbfb460617e2fc7d81dc4f6e0339a7d4067b","user":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"repo":{"id":43470716,"name":"infobox-template-builder","full_name":"Wikia/infobox-template-builder","owner":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Wikia/infobox-template-builder","description":"","fork":false,"url":"https://api.github.com/repos/Wikia/infobox-template-builder","forks_url":"https://api.github.com/repos/Wikia/infobox-template-builder/forks","keys_url":"https://api.github.com/repos/Wikia/infobox-template-builder/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Wikia/infobox-template-builder/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Wikia/infobox-template-builder/teams","hooks_url":"https://api.github.com/repos/Wikia/infobox-template-builder/hooks","issue_events_url":"https://api.github.com/repos/Wikia/infobox-template-builder/issues/events{/number}","events_url":"https://api.github.com/repos/Wikia/infobox-template-builder/events","assignees_url":"https://api.github.com/repos/Wikia/infobox-template-builder/assignees{/user}","branches_url":"https://api.github.com/repos/Wikia/infobox-template-builder/branches{/branch}","tags_url":"https://api.github.com/repos/Wikia/infobox-template-builder/tags","blobs_url":"https://api.github.com/repos/Wikia/infobox-template-builder/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Wikia/infobox-template-builder/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Wikia/infobox-template-builder/git/refs{/sha}","trees_url":"https://api.github.com/repos/Wikia/infobox-template-builder/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Wikia/infobox-template-builder/statuses/{sha}","languages_url":"https://api.github.com/repos/Wikia/infobox-template-builder/languages","stargazers_url":"https://api.github.com/repos/Wikia/infobox-template-builder/stargazers","contributors_url":"https://api.github.com/repos/Wikia/infobox-template-builder/contributors","subscribers_url":"https://api.github.com/repos/Wikia/infobox-template-builder/subscribers","subscription_url":"https://api.github.com/repos/Wikia/infobox-template-builder/subscription","commits_url":"https://api.github.com/repos/Wikia/infobox-template-builder/commits{/sha}","git_commits_url":"https://api.github.com/repos/Wikia/infobox-template-builder/git/commits{/sha}","comments_url":"https://api.github.com/repos/Wikia/infobox-template-builder/comments{/number}","issue_comment_url":"https://api.github.com/repos/Wikia/infobox-template-builder/issues/comments{/number}","contents_url":"https://api.github.com/repos/Wikia/infobox-template-builder/contents/{+path}","compare_url":"https://api.github.com/repos/Wikia/infobox-template-builder/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Wikia/infobox-template-builder/merges","archive_url":"https://api.github.com/repos/Wikia/infobox-template-builder/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Wikia/infobox-template-builder/downloads","issues_url":"https://api.github.com/repos/Wikia/infobox-template-builder/issues{/number}","pulls_url":"https://api.github.com/repos/Wikia/infobox-template-builder/pulls{/number}","milestones_url":"https://api.github.com/repos/Wikia/infobox-template-builder/milestones{/number}","notifications_url":"https://api.github.com/repos/Wikia/infobox-template-builder/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Wikia/infobox-template-builder/labels{/name}","releases_url":"https://api.github.com/repos/Wikia/infobox-template-builder/releases{/id}","created_at":"2015-10-01T00:54:42Z","updated_at":"2015-10-01T18:25:28Z","pushed_at":"2015-10-02T18:28:41Z","git_url":"git://github.com/Wikia/infobox-template-builder.git","ssh_url":"git@github.com:Wikia/infobox-template-builder.git","clone_url":"https://github.com/Wikia/infobox-template-builder.git","svn_url":"https://github.com/Wikia/infobox-template-builder","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"dev"}},"base":{"label":"Wikia:dev","ref":"dev","sha":"41645b22b5b0d5a5a3a7d78aee3d6c7407bd4ee3","user":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"repo":{"id":43470716,"name":"infobox-template-builder","full_name":"Wikia/infobox-template-builder","owner":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Wikia/infobox-template-builder","description":"","fork":false,"url":"https://api.github.com/repos/Wikia/infobox-template-builder","forks_url":"https://api.github.com/repos/Wikia/infobox-template-builder/forks","keys_url":"https://api.github.com/repos/Wikia/infobox-template-builder/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Wikia/infobox-template-builder/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Wikia/infobox-template-builder/teams","hooks_url":"https://api.github.com/repos/Wikia/infobox-template-builder/hooks","issue_events_url":"https://api.github.com/repos/Wikia/infobox-template-builder/issues/events{/number}","events_url":"https://api.github.com/repos/Wikia/infobox-template-builder/events","assignees_url":"https://api.github.com/repos/Wikia/infobox-template-builder/assignees{/user}","branches_url":"https://api.github.com/repos/Wikia/infobox-template-builder/branches{/branch}","tags_url":"https://api.github.com/repos/Wikia/infobox-template-builder/tags","blobs_url":"https://api.github.com/repos/Wikia/infobox-template-builder/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Wikia/infobox-template-builder/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Wikia/infobox-template-builder/git/refs{/sha}","trees_url":"https://api.github.com/repos/Wikia/infobox-template-builder/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Wikia/infobox-template-builder/statuses/{sha}","languages_url":"https://api.github.com/repos/Wikia/infobox-template-builder/languages","stargazers_url":"https://api.github.com/repos/Wikia/infobox-template-builder/stargazers","contributors_url":"https://api.github.com/repos/Wikia/infobox-template-builder/contributors","subscribers_url":"https://api.github.com/repos/Wikia/infobox-template-builder/subscribers","subscription_url":"https://api.github.com/repos/Wikia/infobox-template-builder/subscription","commits_url":"https://api.github.com/repos/Wikia/infobox-template-builder/commits{/sha}","git_commits_url":"https://api.github.com/repos/Wikia/infobox-template-builder/git/commits{/sha}","comments_url":"https://api.github.com/repos/Wikia/infobox-template-builder/comments{/number}","issue_comment_url":"https://api.github.com/repos/Wikia/infobox-template-builder/issues/comments{/number}","contents_url":"https://api.github.com/repos/Wikia/infobox-template-builder/contents/{+path}","compare_url":"https://api.github.com/repos/Wikia/infobox-template-builder/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Wikia/infobox-template-builder/merges","archive_url":"https://api.github.com/repos/Wikia/infobox-template-builder/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Wikia/infobox-template-builder/downloads","issues_url":"https://api.github.com/repos/Wikia/infobox-template-builder/issues{/number}","pulls_url":"https://api.github.com/repos/Wikia/infobox-template-builder/pulls{/number}","milestones_url":"https://api.github.com/repos/Wikia/infobox-template-builder/milestones{/number}","notifications_url":"https://api.github.com/repos/Wikia/infobox-template-builder/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Wikia/infobox-template-builder/labels{/name}","releases_url":"https://api.github.com/repos/Wikia/infobox-template-builder/releases{/id}","created_at":"2015-10-01T00:54:42Z","updated_at":"2015-10-01T18:25:28Z","pushed_at":"2015-10-02T18:28:41Z","git_url":"git://github.com/Wikia/infobox-template-builder.git","ssh_url":"git@github.com:Wikia/infobox-template-builder.git","clone_url":"https://github.com/Wikia/infobox-template-builder.git","svn_url":"https://github.com/Wikia/infobox-template-builder","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/Wikia/infobox-template-builder/pulls/2"},"html":{"href":"https://github.com/Wikia/infobox-template-builder/pull/2"},"issue":{"href":"https://api.github.com/repos/Wikia/infobox-template-builder/issues/2"},"comments":{"href":"https://api.github.com/repos/Wikia/infobox-template-builder/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/Wikia/infobox-template-builder/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/Wikia/infobox-template-builder/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Wikia/infobox-template-builder/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/Wikia/infobox-template-builder/statuses/cd88dbfb460617e2fc7d81dc4f6e0339a7d4067b"}}}}