{"action":"created","issue":{"url":"https://api.github.com/repos/dimagi/commcare-hq/issues/9666","labels_url":"https://api.github.com/repos/dimagi/commcare-hq/issues/9666/labels{/name}","comments_url":"https://api.github.com/repos/dimagi/commcare-hq/issues/9666/comments","events_url":"https://api.github.com/repos/dimagi/commcare-hq/issues/9666/events","html_url":"https://github.com/dimagi/commcare-hq/pull/9666","id":122962196,"number":9666,"title":"Use jsUglify and have source maps!","user":{"login":"benrudolph","id":918514,"avatar_url":"https://avatars.githubusercontent.com/u/918514?v=3","gravatar_id":"","url":"https://api.github.com/users/benrudolph","html_url":"https://github.com/benrudolph","followers_url":"https://api.github.com/users/benrudolph/followers","following_url":"https://api.github.com/users/benrudolph/following{/other_user}","gists_url":"https://api.github.com/users/benrudolph/gists{/gist_id}","starred_url":"https://api.github.com/users/benrudolph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benrudolph/subscriptions","organizations_url":"https://api.github.com/users/benrudolph/orgs","repos_url":"https://api.github.com/users/benrudolph/repos","events_url":"https://api.github.com/users/benrudolph/events{/privacy}","received_events_url":"https://api.github.com/users/benrudolph/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dimagi/commcare-hq/labels/No%20lint%20errors","name":"No lint errors","color":"bfe5bf"},{"url":"https://api.github.com/repos/dimagi/commcare-hq/labels/Open%20for%20review:%20hold%20off%20on%20merge","name":"Open for review: hold off on merge","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-12-18T14:54:12Z","updated_at":"2015-12-21T11:39:16Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/dimagi/commcare-hq/pulls/9666","html_url":"https://github.com/dimagi/commcare-hq/pull/9666","diff_url":"https://github.com/dimagi/commcare-hq/pull/9666.diff","patch_url":"https://github.com/dimagi/commcare-hq/pull/9666.patch"},"body":"@biyeun this switches compressor to use uglifyjs as the compressor. i imagine there might be some path issues on deploy with uglifier which shouldn't be too hard to figure out once i give it a go on staging. this should \"just work\". here's the output of the `staticfiles` dir:\r\n<img width=\"722\" alt=\"screen shot 2015-12-18 at 5 01 45 pm\" src=\"https://cloud.githubusercontent.com/assets/918514/11899630/1211aefc-a5a9-11e5-9c71-1c2e83aeaebd.png\">\r\n\r\none step closer to better javascript error reporting!! :runner: \r\n\r\nedit (more context): the original JS compressor didn't provide source maps. this is useful so we can get real numbers of where things broke in the javascript. this change uses a custom filter that basically just calls uglify on each of the concatenated content. uglify comes with options to add source maps. this also gives us more control of how we do our compression in general. though i'm still skeptical that this'll work completely because we concat all the files first so the lines are still messed up :disappointed: one thing we could do is save the uncompressed version along side the compressed version as like `[hex].uncompressed.js`. that way if we ever do error reporting and want to have \"code context\" we can pull from that. open to ideas"},"comment":{"url":"https://api.github.com/repos/dimagi/commcare-hq/issues/comments/166278889","html_url":"https://github.com/dimagi/commcare-hq/pull/9666#issuecomment-166278889","issue_url":"https://api.github.com/repos/dimagi/commcare-hq/issues/9666","id":166278889,"user":{"login":"esoergel","id":2367539,"avatar_url":"https://avatars.githubusercontent.com/u/2367539?v=3","gravatar_id":"","url":"https://api.github.com/users/esoergel","html_url":"https://github.com/esoergel","followers_url":"https://api.github.com/users/esoergel/followers","following_url":"https://api.github.com/users/esoergel/following{/other_user}","gists_url":"https://api.github.com/users/esoergel/gists{/gist_id}","starred_url":"https://api.github.com/users/esoergel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/esoergel/subscriptions","organizations_url":"https://api.github.com/users/esoergel/orgs","repos_url":"https://api.github.com/users/esoergel/repos","events_url":"https://api.github.com/users/esoergel/events{/privacy}","received_events_url":"https://api.github.com/users/esoergel/received_events","type":"User","site_admin":false},"created_at":"2015-12-21T11:39:16Z","updated_at":"2015-12-21T11:39:16Z","body":"Just did some quick googling hoping to find something that maps to the original sources and found a good blog post on the topic: https://roverdotcom.github.io/blog/2014/05/28/javascript-error-reporting-with-source-maps-in-django/  Then I realized that's where this came from.  Oh well.  Did you see \"Gotchyas\" bit at the bottom?  Does that just mean that we won't have source maps for compressed inline js?  (probably fine).\r\n\r\nThere's also [an issue](https://github.com/django-compressor/django-compressor/issues/438) on the django-compressor repo related to source map support."}}