{"action":"created","issue":{"url":"https://api.github.com/repos/meetecho/janus-gateway/issues/879","repository_url":"https://api.github.com/repos/meetecho/janus-gateway","labels_url":"https://api.github.com/repos/meetecho/janus-gateway/issues/879/labels{/name}","comments_url":"https://api.github.com/repos/meetecho/janus-gateway/issues/879/comments","events_url":"https://api.github.com/repos/meetecho/janus-gateway/issues/879/events","html_url":"https://github.com/meetecho/janus-gateway/issues/879","id":225467717,"number":879,"title":"janus.js should not depend on JQuery","user":{"login":"cmacq2","id":13215950,"avatar_url":"https://avatars3.githubusercontent.com/u/13215950?v=3","gravatar_id":"","url":"https://api.github.com/users/cmacq2","html_url":"https://github.com/cmacq2","followers_url":"https://api.github.com/users/cmacq2/followers","following_url":"https://api.github.com/users/cmacq2/following{/other_user}","gists_url":"https://api.github.com/users/cmacq2/gists{/gist_id}","starred_url":"https://api.github.com/users/cmacq2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmacq2/subscriptions","organizations_url":"https://api.github.com/users/cmacq2/orgs","repos_url":"https://api.github.com/users/cmacq2/repos","events_url":"https://api.github.com/users/cmacq2/events{/privacy}","received_events_url":"https://api.github.com/users/cmacq2/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2017-05-01T16:34:43Z","updated_at":"2017-06-30T11:21:05Z","closed_at":null,"body":"The core `janus.js` library need not depend on JQuery.\r\n\r\nCurrently JQuery is used for two purposes: `$.ajax()` requests to Janus gateway and to check an element for a Chrome extension id/marker value. In modern and even quite a few dated browsers, `$.ajax()` can be replaced with [`fetch()`](https://developer.mozilla.org/en/docs/Web/API/Fetch_API) and the check for the marker could be rewritten quite straightforwardly with [`document.querySelector()`](https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector)\r\n\r\nBenefits are:\r\n\r\n- One dependency less for the core `janus.js` library (and there are polyfills for folks who need backwards compatibility with browsers that lack a native  `fetch()` implementation). \r\n- With `fetch()` the code is typically quite a bit more compact, and it would yield easier to test code compared to nested JQuery callbacks resulting from nested `$.ajax()` calls.\r\n\r\nWould you be interested in merging & carrying a PR that addresses this?"},"comment":{"url":"https://api.github.com/repos/meetecho/janus-gateway/issues/comments/312242591","html_url":"https://github.com/meetecho/janus-gateway/issues/879#issuecomment-312242591","issue_url":"https://api.github.com/repos/meetecho/janus-gateway/issues/879","id":312242591,"user":{"login":"lminiero","id":3684796,"avatar_url":"https://avatars2.githubusercontent.com/u/3684796?v=3","gravatar_id":"","url":"https://api.github.com/users/lminiero","html_url":"https://github.com/lminiero","followers_url":"https://api.github.com/users/lminiero/followers","following_url":"https://api.github.com/users/lminiero/following{/other_user}","gists_url":"https://api.github.com/users/lminiero/gists{/gist_id}","starred_url":"https://api.github.com/users/lminiero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lminiero/subscriptions","organizations_url":"https://api.github.com/users/lminiero/orgs","repos_url":"https://api.github.com/users/lminiero/repos","events_url":"https://api.github.com/users/lminiero/events{/privacy}","received_events_url":"https://api.github.com/users/lminiero/received_events","type":"User","site_admin":false},"created_at":"2017-06-30T11:21:05Z","updated_at":"2017-06-30T11:21:05Z","body":"Sorry for the ultraslow response on this, but I've been busy on other stuff and completely forgot about this (going through some other old issues right now for the very same reason!).\r\n\r\nIf you guys can come up with a simple pull request that makes `janus.nojquery.js` less prone to problems (e.g., \"better\" AJAX shim, in case it needs love), and replaces `janus.js`, I'll definitely consider it for merging (you're probably much better at JS than me!). It would also give people a sandbox to test it in multiple WebRTC compliant environments (Chrome, Firefox, Edge, Safari, mobile browsers), something I most definitely can't do all by myself..."}}
{"actor":{"display_login":"lminiero"}}