{"action":"created","issue":{"url":"https://api.github.com/repos/soyjavi/monocle/issues/11","labels_url":"https://api.github.com/repos/soyjavi/monocle/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/soyjavi/monocle/issues/11/comments","events_url":"https://api.github.com/repos/soyjavi/monocle/issues/11/events","html_url":"https://github.com/soyjavi/monocle/issues/11","id":18416343,"number":11,"title":"Monocle.Templates cache system can be broken after minification","user":{"login":"atabel","id":1849576,"avatar_url":"https://avatars.githubusercontent.com/u/1849576?v=3","gravatar_id":"","url":"https://api.github.com/users/atabel","html_url":"https://github.com/atabel","followers_url":"https://api.github.com/users/atabel/followers","following_url":"https://api.github.com/users/atabel/following{/other_user}","gists_url":"https://api.github.com/users/atabel/gists{/gist_id}","starred_url":"https://api.github.com/users/atabel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atabel/subscriptions","organizations_url":"https://api.github.com/users/atabel/orgs","repos_url":"https://api.github.com/users/atabel/repos","events_url":"https://api.github.com/users/atabel/events{/privacy}","received_events_url":"https://api.github.com/users/atabel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2013-08-22T14:26:36Z","updated_at":"2015-01-27T14:52:18Z","closed_at":null,"body":"This issue is related to:\r\nhttps://github.com/jashkenas/coffee-script/issues/2052\r\n\r\nIn https://github.com/soyjavi/monocle/blob/master/src/monocle.view.coffee, ``Monocle.Templates`` is used to cache the templates:\r\n```coffee\r\n_loadTemplateFrom: (url) ->\r\n        className = @constructor.name\r\n\r\n        unless Monocle.Templates[className]\r\n            loader = if $$? then $$ else $\r\n            response = loader.ajax\r\n                            url: url\r\n                            async: false\r\n                            dataType: 'text'\r\n                            error: -> console.error arguments\r\n            response = response.responseText unless $$?\r\n            Monocle.Templates[className] = response\r\n\r\n        @template = Monocle.Templates[className]\r\n```\r\nThe used cache key is ``@constructor.name``, which can be anything after minification, so it can generate key duplicates.\r\nAs a result, two different views could end sharing the same template by error if both views were minified to the same variable name.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/soyjavi/monocle/issues/comments/71659823","html_url":"https://github.com/soyjavi/monocle/issues/11#issuecomment-71659823","issue_url":"https://api.github.com/repos/soyjavi/monocle/issues/11","id":71659823,"user":{"login":"grigorov","id":898954,"avatar_url":"https://avatars.githubusercontent.com/u/898954?v=3","gravatar_id":"","url":"https://api.github.com/users/grigorov","html_url":"https://github.com/grigorov","followers_url":"https://api.github.com/users/grigorov/followers","following_url":"https://api.github.com/users/grigorov/following{/other_user}","gists_url":"https://api.github.com/users/grigorov/gists{/gist_id}","starred_url":"https://api.github.com/users/grigorov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grigorov/subscriptions","organizations_url":"https://api.github.com/users/grigorov/orgs","repos_url":"https://api.github.com/users/grigorov/repos","events_url":"https://api.github.com/users/grigorov/events{/privacy}","received_events_url":"https://api.github.com/users/grigorov/received_events","type":"User","site_admin":false},"created_at":"2015-01-27T14:52:18Z","updated_at":"2015-01-27T14:52:18Z","body":"Not fix? "}}