{"action":"created","issue":{"url":"https://api.github.com/repos/infinity-next/infinity-next/issues/124","labels_url":"https://api.github.com/repos/infinity-next/infinity-next/issues/124/labels{/name}","comments_url":"https://api.github.com/repos/infinity-next/infinity-next/issues/124/comments","events_url":"https://api.github.com/repos/infinity-next/infinity-next/issues/124/events","html_url":"https://github.com/infinity-next/infinity-next/issues/124","id":109427796,"number":124,"title":"JavaScript is messy & confusing (JS guidelines needed)","user":{"login":"ctrlcctrlv","id":838783,"avatar_url":"https://avatars.githubusercontent.com/u/838783?v=3","gravatar_id":"","url":"https://api.github.com/users/ctrlcctrlv","html_url":"https://github.com/ctrlcctrlv","followers_url":"https://api.github.com/users/ctrlcctrlv/followers","following_url":"https://api.github.com/users/ctrlcctrlv/following{/other_user}","gists_url":"https://api.github.com/users/ctrlcctrlv/gists{/gist_id}","starred_url":"https://api.github.com/users/ctrlcctrlv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ctrlcctrlv/subscriptions","organizations_url":"https://api.github.com/users/ctrlcctrlv/orgs","repos_url":"https://api.github.com/users/ctrlcctrlv/repos","events_url":"https://api.github.com/users/ctrlcctrlv/events{/privacy}","received_events_url":"https://api.github.com/users/ctrlcctrlv/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/infinity-next/infinity-next/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/infinity-next/infinity-next/labels/javacript","name":"javacript","color":"f7c6c7"},{"url":"https://api.github.com/repos/infinity-next/infinity-next/labels/meta","name":"meta","color":"006b75"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/infinity-next/infinity-next/milestones/6","html_url":"https://github.com/infinity-next/infinity-next/milestones/Milestone%205","labels_url":"https://api.github.com/repos/infinity-next/infinity-next/milestones/6/labels","id":1217924,"number":6,"title":"Milestone 5","description":"[ ] Quality of life\r\n[ ] Site-specific donor systems\r\n[ ] API","creator":{"login":"jaw-sh","id":9262991,"avatar_url":"https://avatars.githubusercontent.com/u/9262991?v=3","gravatar_id":"","url":"https://api.github.com/users/jaw-sh","html_url":"https://github.com/jaw-sh","followers_url":"https://api.github.com/users/jaw-sh/followers","following_url":"https://api.github.com/users/jaw-sh/following{/other_user}","gists_url":"https://api.github.com/users/jaw-sh/gists{/gist_id}","starred_url":"https://api.github.com/users/jaw-sh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaw-sh/subscriptions","organizations_url":"https://api.github.com/users/jaw-sh/orgs","repos_url":"https://api.github.com/users/jaw-sh/repos","events_url":"https://api.github.com/users/jaw-sh/events{/privacy}","received_events_url":"https://api.github.com/users/jaw-sh/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":3,"state":"open","created_at":"2015-07-21T11:07:04Z","updated_at":"2015-10-11T10:28:20Z","due_on":null,"closed_at":null},"comments":6,"created_at":"2015-10-02T04:36:00Z","updated_at":"2015-12-05T21:37:44Z","closed_at":null,"body":"Right now we have a 1500 line `main.js`.\r\n\r\nhttps://github.com/infinity-next/infinity-next/blob/master/public/js/app/main.js\r\n\r\nOne of the things 8chan did right was separating different features into different scripts, then the build program concatenates them together and minifies them all, see our tree: \r\n\r\nSite owners can easily enable/disable features just by adding or removing new scripts to the array.\r\n\r\nhttps://github.com/ctrlcctrlv/infinity/tree/master/js (index of all scripts)\r\nhttps://github.com/ctrlcctrlv/infinity/blob/master/inc/instance-config.php#L87 (script listing on the public site)\r\n\r\n8chan has over 80 scripts written by more than 12 different people over the course of 5 years, yet we can understand the whole thing, and add more and edit them even today. This is because each feature we would want to change is in its own script, all it takes is finding it in the directory listing.\r\n\r\nNow I'm not saying that this is perfect, but recently I was tasked with a rewrite of 2ch JS. These are the guidelines I came up with: https://github.com/Cipherwraith/2ch/\r\n\r\nI think this is much closer to perfection, the numeric key loading especially helps with dependency management, a sore spot in the infinity tree.\r\n\r\nAs Laravel's Elixir already requires NPM, I think we should either switch to `grunt` (or implement my gruntfile above in Elixir)."},"comment":{"url":"https://api.github.com/repos/infinity-next/infinity-next/issues/comments/162249728","html_url":"https://github.com/infinity-next/infinity-next/issues/124#issuecomment-162249728","issue_url":"https://api.github.com/repos/infinity-next/infinity-next/issues/124","id":162249728,"user":{"login":"milezteg","id":2200225,"avatar_url":"https://avatars.githubusercontent.com/u/2200225?v=3","gravatar_id":"","url":"https://api.github.com/users/milezteg","html_url":"https://github.com/milezteg","followers_url":"https://api.github.com/users/milezteg/followers","following_url":"https://api.github.com/users/milezteg/following{/other_user}","gists_url":"https://api.github.com/users/milezteg/gists{/gist_id}","starred_url":"https://api.github.com/users/milezteg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/milezteg/subscriptions","organizations_url":"https://api.github.com/users/milezteg/orgs","repos_url":"https://api.github.com/users/milezteg/repos","events_url":"https://api.github.com/users/milezteg/events{/privacy}","received_events_url":"https://api.github.com/users/milezteg/received_events","type":"User","site_admin":false},"created_at":"2015-12-05T21:37:44Z","updated_at":"2015-12-05T21:37:44Z","body":">How do you intend to police the codebase for XSS vulnerabilities?\r\n\r\nWell you close holes as they arise in an application, preferably during a beta period...genuinely curious, what other method is there??"}}