{"action":"created","issue":{"url":"https://api.github.com/repos/sindresorhus/refined-github/issues/218","repository_url":"https://api.github.com/repos/sindresorhus/refined-github","labels_url":"https://api.github.com/repos/sindresorhus/refined-github/issues/218/labels{/name}","comments_url":"https://api.github.com/repos/sindresorhus/refined-github/issues/218/comments","events_url":"https://api.github.com/repos/sindresorhus/refined-github/issues/218/events","html_url":"https://github.com/sindresorhus/refined-github/issues/218","id":155153743,"number":218,"title":"Add delegated listener util, or switch from Sprint","user":{"login":"DrewML","id":5233399,"avatar_url":"https://avatars.githubusercontent.com/u/5233399?v=3","gravatar_id":"","url":"https://api.github.com/users/DrewML","html_url":"https://github.com/DrewML","followers_url":"https://api.github.com/users/DrewML/followers","following_url":"https://api.github.com/users/DrewML/following{/other_user}","gists_url":"https://api.github.com/users/DrewML/gists{/gist_id}","starred_url":"https://api.github.com/users/DrewML/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DrewML/subscriptions","organizations_url":"https://api.github.com/users/DrewML/orgs","repos_url":"https://api.github.com/users/DrewML/repos","events_url":"https://api.github.com/users/DrewML/events{/privacy}","received_events_url":"https://api.github.com/users/DrewML/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/sindresorhus/refined-github/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/sindresorhus/refined-github/labels/help%20wanted","name":"help wanted","color":"159818"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2016-05-17T00:46:13Z","updated_at":"2016-06-12T22:40:10Z","closed_at":null,"body":"We've been manually creating delegated listeners for a bit now:\r\n\r\n- https://github.com/sindresorhus/refined-github/blob/master/extension/content.js#L235\r\n- https://github.com/sindresorhus/refined-github/blob/master/extension/content.js#L249\r\n- https://github.com/sindresorhus/refined-github/blob/master/extension/content.js#L269\r\n-https://github.com/sindresorhus/refined-github/blob/master/extension/content.js#L235\r\n- https://github.com/sindresorhus/refined-github/blob/master/extension/copy-file.js#L14\r\n- https://github.com/sindresorhus/refined-github/blob/master/extension/reactions-avatars.js#L45\r\n\r\nRather than doing this manually everytime, it's probably worthwhile for us to abstract this.\r\n\r\nI think we have 2 options:\r\n\r\n1. Add our own util to handle this\r\n2. Switch to a different DOM lib besides Sprint ([Zepto](http://zeptojs.com/) is a popular one)\r\n\r\nThoughts?"},"comment":{"url":"https://api.github.com/repos/sindresorhus/refined-github/issues/comments/225464813","html_url":"https://github.com/sindresorhus/refined-github/issues/218#issuecomment-225464813","issue_url":"https://api.github.com/repos/sindresorhus/refined-github/issues/218","id":225464813,"user":{"login":"DrewML","id":5233399,"avatar_url":"https://avatars.githubusercontent.com/u/5233399?v=3","gravatar_id":"","url":"https://api.github.com/users/DrewML","html_url":"https://github.com/DrewML","followers_url":"https://api.github.com/users/DrewML/followers","following_url":"https://api.github.com/users/DrewML/following{/other_user}","gists_url":"https://api.github.com/users/DrewML/gists{/gist_id}","starred_url":"https://api.github.com/users/DrewML/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DrewML/subscriptions","organizations_url":"https://api.github.com/users/DrewML/orgs","repos_url":"https://api.github.com/users/DrewML/repos","events_url":"https://api.github.com/users/DrewML/events{/privacy}","received_events_url":"https://api.github.com/users/DrewML/received_events","type":"User","site_admin":false},"created_at":"2016-06-12T22:40:10Z","updated_at":"2016-06-12T22:40:10Z","body":"Doable. My main concern is that, at this point, something that half-supports the jQuery API feels like a leaky abstraction. I've personally been bitten by this on more than one occasion working on this project.\r\n\r\nExamples:\r\n\r\n- [Incomplete API parity with `.each`](https://github.com/bendc/sprint/pull/42)\r\n- [Usage of `.dom` property to store collection](https://github.com/sindresorhus/refined-github/blob/master/extension/diffheader.js#L83)\r\n\r\nThere are still other parts of jQuery's DOM API that someone may be tempted to use that won't be supported by Sprint. One example is attaching arbitrary data to a `.on` handler, but I'm sure there are more.\r\n\r\nIf we were to go with native DOM APIs, us + other contributors at least have a contract that the API we see documented is what we're getting."}}
{"actor":{"display_login":"DrewML"}}