{"action":"opened","number":665,"pull_request":{"url":"https://api.github.com/repos/TerriaJS/terriajs/pulls/665","id":34583258,"html_url":"https://github.com/TerriaJS/terriajs/pull/665","diff_url":"https://github.com/TerriaJS/terriajs/pull/665.diff","patch_url":"https://github.com/TerriaJS/terriajs/pull/665.patch","issue_url":"https://api.github.com/repos/TerriaJS/terriajs/issues/665","number":665,"state":"open","locked":false,"title":"Allow loading init files in .hjson format.","user":{"login":"stevage","id":678344,"avatar_url":"https://avatars.githubusercontent.com/u/678344?v=3","gravatar_id":"","url":"https://api.github.com/users/stevage","html_url":"https://github.com/stevage","followers_url":"https://api.github.com/users/stevage/followers","following_url":"https://api.github.com/users/stevage/following{/other_user}","gists_url":"https://api.github.com/users/stevage/gists{/gist_id}","starred_url":"https://api.github.com/users/stevage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevage/subscriptions","organizations_url":"https://api.github.com/users/stevage/orgs","repos_url":"https://api.github.com/users/stevage/repos","events_url":"https://api.github.com/users/stevage/events{/privacy}","received_events_url":"https://api.github.com/users/stevage/received_events","type":"User","site_admin":false},"body":"HJson (http://hjson.org/) is more user friendly (no quotes or commas),\r\nallows inline comments, and is slightly smaller.\r\n\r\nQuick explanation: the init/*.json files are our primary link with data sources, but they're relatively hard for us to maintain, very hard to data custodians to maintain, and don't allow comments, which makes it hard to document issues as we go.\r\n\r\nUsing hjson isn't a full solution, but it's a modest improvement, I think. There are other \"JSON plus\" formats which all work on the \"JSON is not a great format for configuration files\" problem, including [json5](json5.org). Hjson seems as good as any.\r\n\r\nI opted for browser side processing so that you can modify the .hjson file and see the change straight away without rebuilding. It will also work better with a purely static deployment. The cost of the hjson library is more than made up for the reduction in size in the .json files themselves.\r\n\r\nThere's no lock-in risk as we can always trivially convert the .hjson back to .json.","created_at":"2015-05-02T09:01:37Z","updated_at":"2015-05-02T09:01:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/TerriaJS/terriajs/pulls/665/commits","review_comments_url":"https://api.github.com/repos/TerriaJS/terriajs/pulls/665/comments","review_comment_url":"https://api.github.com/repos/TerriaJS/terriajs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/TerriaJS/terriajs/issues/665/comments","statuses_url":"https://api.github.com/repos/TerriaJS/terriajs/statuses/788fe781558a701b0e991c0800d220de29f416fa","head":{"label":"TerriaJS:hjson","ref":"hjson","sha":"788fe781558a701b0e991c0800d220de29f416fa","user":{"login":"TerriaJS","id":12078432,"avatar_url":"https://avatars.githubusercontent.com/u/12078432?v=3","gravatar_id":"","url":"https://api.github.com/users/TerriaJS","html_url":"https://github.com/TerriaJS","followers_url":"https://api.github.com/users/TerriaJS/followers","following_url":"https://api.github.com/users/TerriaJS/following{/other_user}","gists_url":"https://api.github.com/users/TerriaJS/gists{/gist_id}","starred_url":"https://api.github.com/users/TerriaJS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TerriaJS/subscriptions","organizations_url":"https://api.github.com/users/TerriaJS/orgs","repos_url":"https://api.github.com/users/TerriaJS/repos","events_url":"https://api.github.com/users/TerriaJS/events{/privacy}","received_events_url":"https://api.github.com/users/TerriaJS/received_events","type":"Organization","site_admin":false},"repo":{"id":17163720,"name":"terriajs","full_name":"TerriaJS/terriajs","owner":{"login":"TerriaJS","id":12078432,"avatar_url":"https://avatars.githubusercontent.com/u/12078432?v=3","gravatar_id":"","url":"https://api.github.com/users/TerriaJS","html_url":"https://github.com/TerriaJS","followers_url":"https://api.github.com/users/TerriaJS/followers","following_url":"https://api.github.com/users/TerriaJS/following{/other_user}","gists_url":"https://api.github.com/users/TerriaJS/gists{/gist_id}","starred_url":"https://api.github.com/users/TerriaJS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TerriaJS/subscriptions","organizations_url":"https://api.github.com/users/TerriaJS/orgs","repos_url":"https://api.github.com/users/TerriaJS/repos","events_url":"https://api.github.com/users/TerriaJS/events{/privacy}","received_events_url":"https://api.github.com/users/TerriaJS/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/TerriaJS/terriajs","description":"","fork":false,"url":"https://api.github.com/repos/TerriaJS/terriajs","forks_url":"https://api.github.com/repos/TerriaJS/terriajs/forks","keys_url":"https://api.github.com/repos/TerriaJS/terriajs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TerriaJS/terriajs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TerriaJS/terriajs/teams","hooks_url":"https://api.github.com/repos/TerriaJS/terriajs/hooks","issue_events_url":"https://api.github.com/repos/TerriaJS/terriajs/issues/events{/number}","events_url":"https://api.github.com/repos/TerriaJS/terriajs/events","assignees_url":"https://api.github.com/repos/TerriaJS/terriajs/assignees{/user}","branches_url":"https://api.github.com/repos/TerriaJS/terriajs/branches{/branch}","tags_url":"https://api.github.com/repos/TerriaJS/terriajs/tags","blobs_url":"https://api.github.com/repos/TerriaJS/terriajs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TerriaJS/terriajs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TerriaJS/terriajs/git/refs{/sha}","trees_url":"https://api.github.com/repos/TerriaJS/terriajs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TerriaJS/terriajs/statuses/{sha}","languages_url":"https://api.github.com/repos/TerriaJS/terriajs/languages","stargazers_url":"https://api.github.com/repos/TerriaJS/terriajs/stargazers","contributors_url":"https://api.github.com/repos/TerriaJS/terriajs/contributors","subscribers_url":"https://api.github.com/repos/TerriaJS/terriajs/subscribers","subscription_url":"https://api.github.com/repos/TerriaJS/terriajs/subscription","commits_url":"https://api.github.com/repos/TerriaJS/terriajs/commits{/sha}","git_commits_url":"https://api.github.com/repos/TerriaJS/terriajs/git/commits{/sha}","comments_url":"https://api.github.com/repos/TerriaJS/terriajs/comments{/number}","issue_comment_url":"https://api.github.com/repos/TerriaJS/terriajs/issues/comments{/number}","contents_url":"https://api.github.com/repos/TerriaJS/terriajs/contents/{+path}","compare_url":"https://api.github.com/repos/TerriaJS/terriajs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TerriaJS/terriajs/merges","archive_url":"https://api.github.com/repos/TerriaJS/terriajs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TerriaJS/terriajs/downloads","issues_url":"https://api.github.com/repos/TerriaJS/terriajs/issues{/number}","pulls_url":"https://api.github.com/repos/TerriaJS/terriajs/pulls{/number}","milestones_url":"https://api.github.com/repos/TerriaJS/terriajs/milestones{/number}","notifications_url":"https://api.github.com/repos/TerriaJS/terriajs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TerriaJS/terriajs/labels{/name}","releases_url":"https://api.github.com/repos/TerriaJS/terriajs/releases{/id}","created_at":"2014-02-25T06:30:13Z","updated_at":"2015-05-01T23:35:18Z","pushed_at":"2015-05-02T08:54:00Z","git_url":"git://github.com/TerriaJS/terriajs.git","ssh_url":"git@github.com:TerriaJS/terriajs.git","clone_url":"https://github.com/TerriaJS/terriajs.git","svn_url":"https://github.com/TerriaJS/terriajs","homepage":null,"size":49345,"stargazers_count":23,"watchers_count":23,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":17,"mirror_url":null,"open_issues_count":66,"forks":17,"open_issues":66,"watchers":23,"default_branch":"master"}},"base":{"label":"TerriaJS:master","ref":"master","sha":"78146940a76316c6b8291c50471901823fe86108","user":{"login":"TerriaJS","id":12078432,"avatar_url":"https://avatars.githubusercontent.com/u/12078432?v=3","gravatar_id":"","url":"https://api.github.com/users/TerriaJS","html_url":"https://github.com/TerriaJS","followers_url":"https://api.github.com/users/TerriaJS/followers","following_url":"https://api.github.com/users/TerriaJS/following{/other_user}","gists_url":"https://api.github.com/users/TerriaJS/gists{/gist_id}","starred_url":"https://api.github.com/users/TerriaJS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TerriaJS/subscriptions","organizations_url":"https://api.github.com/users/TerriaJS/orgs","repos_url":"https://api.github.com/users/TerriaJS/repos","events_url":"https://api.github.com/users/TerriaJS/events{/privacy}","received_events_url":"https://api.github.com/users/TerriaJS/received_events","type":"Organization","site_admin":false},"repo":{"id":17163720,"name":"terriajs","full_name":"TerriaJS/terriajs","owner":{"login":"TerriaJS","id":12078432,"avatar_url":"https://avatars.githubusercontent.com/u/12078432?v=3","gravatar_id":"","url":"https://api.github.com/users/TerriaJS","html_url":"https://github.com/TerriaJS","followers_url":"https://api.github.com/users/TerriaJS/followers","following_url":"https://api.github.com/users/TerriaJS/following{/other_user}","gists_url":"https://api.github.com/users/TerriaJS/gists{/gist_id}","starred_url":"https://api.github.com/users/TerriaJS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TerriaJS/subscriptions","organizations_url":"https://api.github.com/users/TerriaJS/orgs","repos_url":"https://api.github.com/users/TerriaJS/repos","events_url":"https://api.github.com/users/TerriaJS/events{/privacy}","received_events_url":"https://api.github.com/users/TerriaJS/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/TerriaJS/terriajs","description":"","fork":false,"url":"https://api.github.com/repos/TerriaJS/terriajs","forks_url":"https://api.github.com/repos/TerriaJS/terriajs/forks","keys_url":"https://api.github.com/repos/TerriaJS/terriajs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TerriaJS/terriajs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TerriaJS/terriajs/teams","hooks_url":"https://api.github.com/repos/TerriaJS/terriajs/hooks","issue_events_url":"https://api.github.com/repos/TerriaJS/terriajs/issues/events{/number}","events_url":"https://api.github.com/repos/TerriaJS/terriajs/events","assignees_url":"https://api.github.com/repos/TerriaJS/terriajs/assignees{/user}","branches_url":"https://api.github.com/repos/TerriaJS/terriajs/branches{/branch}","tags_url":"https://api.github.com/repos/TerriaJS/terriajs/tags","blobs_url":"https://api.github.com/repos/TerriaJS/terriajs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TerriaJS/terriajs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TerriaJS/terriajs/git/refs{/sha}","trees_url":"https://api.github.com/repos/TerriaJS/terriajs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TerriaJS/terriajs/statuses/{sha}","languages_url":"https://api.github.com/repos/TerriaJS/terriajs/languages","stargazers_url":"https://api.github.com/repos/TerriaJS/terriajs/stargazers","contributors_url":"https://api.github.com/repos/TerriaJS/terriajs/contributors","subscribers_url":"https://api.github.com/repos/TerriaJS/terriajs/subscribers","subscription_url":"https://api.github.com/repos/TerriaJS/terriajs/subscription","commits_url":"https://api.github.com/repos/TerriaJS/terriajs/commits{/sha}","git_commits_url":"https://api.github.com/repos/TerriaJS/terriajs/git/commits{/sha}","comments_url":"https://api.github.com/repos/TerriaJS/terriajs/comments{/number}","issue_comment_url":"https://api.github.com/repos/TerriaJS/terriajs/issues/comments{/number}","contents_url":"https://api.github.com/repos/TerriaJS/terriajs/contents/{+path}","compare_url":"https://api.github.com/repos/TerriaJS/terriajs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TerriaJS/terriajs/merges","archive_url":"https://api.github.com/repos/TerriaJS/terriajs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TerriaJS/terriajs/downloads","issues_url":"https://api.github.com/repos/TerriaJS/terriajs/issues{/number}","pulls_url":"https://api.github.com/repos/TerriaJS/terriajs/pulls{/number}","milestones_url":"https://api.github.com/repos/TerriaJS/terriajs/milestones{/number}","notifications_url":"https://api.github.com/repos/TerriaJS/terriajs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TerriaJS/terriajs/labels{/name}","releases_url":"https://api.github.com/repos/TerriaJS/terriajs/releases{/id}","created_at":"2014-02-25T06:30:13Z","updated_at":"2015-05-01T23:35:18Z","pushed_at":"2015-05-02T08:54:00Z","git_url":"git://github.com/TerriaJS/terriajs.git","ssh_url":"git@github.com:TerriaJS/terriajs.git","clone_url":"https://github.com/TerriaJS/terriajs.git","svn_url":"https://github.com/TerriaJS/terriajs","homepage":null,"size":49345,"stargazers_count":23,"watchers_count":23,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":17,"mirror_url":null,"open_issues_count":66,"forks":17,"open_issues":66,"watchers":23,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/TerriaJS/terriajs/pulls/665"},"html":{"href":"https://github.com/TerriaJS/terriajs/pull/665"},"issue":{"href":"https://api.github.com/repos/TerriaJS/terriajs/issues/665"},"comments":{"href":"https://api.github.com/repos/TerriaJS/terriajs/issues/665/comments"},"review_comments":{"href":"https://api.github.com/repos/TerriaJS/terriajs/pulls/665/comments"},"review_comment":{"href":"https://api.github.com/repos/TerriaJS/terriajs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/TerriaJS/terriajs/pulls/665/commits"},"statuses":{"href":"https://api.github.com/repos/TerriaJS/terriajs/statuses/788fe781558a701b0e991c0800d220de29f416fa"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":15,"deletions":3,"changed_files":2}}