{"action":"created","issue":{"url":"https://api.github.com/repos/jspm/jspm-cli/issues/441","labels_url":"https://api.github.com/repos/jspm/jspm-cli/issues/441/labels{/name}","comments_url":"https://api.github.com/repos/jspm/jspm-cli/issues/441/comments","events_url":"https://api.github.com/repos/jspm/jspm-cli/issues/441/events","html_url":"https://github.com/jspm/jspm-cli/issues/441","id":55763246,"number":441,"title":"how to deal with require hackery","user":{"login":"faassen","id":327472,"avatar_url":"https://avatars.githubusercontent.com/u/327472?v=3","gravatar_id":"","url":"https://api.github.com/users/faassen","html_url":"https://github.com/faassen","followers_url":"https://api.github.com/users/faassen/followers","following_url":"https://api.github.com/users/faassen/following{/other_user}","gists_url":"https://api.github.com/users/faassen/gists{/gist_id}","starred_url":"https://api.github.com/users/faassen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/faassen/subscriptions","organizations_url":"https://api.github.com/users/faassen/orgs","repos_url":"https://api.github.com/users/faassen/repos","events_url":"https://api.github.com/users/faassen/events{/privacy}","received_events_url":"https://api.github.com/users/faassen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-01-28T14:35:33Z","updated_at":"2015-01-28T14:41:53Z","closed_at":null,"body":"I just tried to use the pretender library with jspm.\r\n\r\nThis fails -- it tries a request for ``/base/jspm_packages/npm/pretender@0.4.2/bower_components/FakeXMLHttpRequest/fake_xml_http_request.js`` but no such ``bower_components directory`` exists.\r\n\r\nThis is due to some hackery at the start of this file:\r\n\r\nhttps://github.com/trek/pretender/blob/master/pretender.js\r\n\r\nFirst it tries to detect whether it's in a node evironment and if so does a hardcoded import from ``bower_components``.\r\n\r\nClearly this isn't going to work. The question is how we help library authors to rewrite code like this so it does work with jspm. Better documentation?\r\n\r\nOne bit I don't understand is that it tries to detect whether things are running in node or the browser, and then the code (even though I have it running in Chrome through karma) thinks it's in node. If it thought it was in the browser things might very well have worked -- not sure.\r\n\r\nSee also https://github.com/trek/pretender/issues/54"},"comment":{"url":"https://api.github.com/repos/jspm/jspm-cli/issues/comments/71844809","html_url":"https://github.com/jspm/jspm-cli/issues/441#issuecomment-71844809","issue_url":"https://api.github.com/repos/jspm/jspm-cli/issues/441","id":71844809,"user":{"login":"guybedford","id":598730,"avatar_url":"https://avatars.githubusercontent.com/u/598730?v=3","gravatar_id":"","url":"https://api.github.com/users/guybedford","html_url":"https://github.com/guybedford","followers_url":"https://api.github.com/users/guybedford/followers","following_url":"https://api.github.com/users/guybedford/following{/other_user}","gists_url":"https://api.github.com/users/guybedford/gists{/gist_id}","starred_url":"https://api.github.com/users/guybedford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guybedford/subscriptions","organizations_url":"https://api.github.com/users/guybedford/orgs","repos_url":"https://api.github.com/users/guybedford/repos","events_url":"https://api.github.com/users/guybedford/events{/privacy}","received_events_url":"https://api.github.com/users/guybedford/received_events","type":"User","site_admin":false},"created_at":"2015-01-28T14:41:53Z","updated_at":"2015-01-28T14:41:53Z","body":"The above can be stored as an override in the registry to make this work for others, or added to the package.json of the original repo (ideally probably both)."}}