{"action":"created","issue":{"url":"https://api.github.com/repos/systemjs/builder/issues/167","labels_url":"https://api.github.com/repos/systemjs/builder/issues/167/labels{/name}","comments_url":"https://api.github.com/repos/systemjs/builder/issues/167/comments","events_url":"https://api.github.com/repos/systemjs/builder/issues/167/events","html_url":"https://github.com/systemjs/builder/issues/167","id":75182250,"number":167,"title":"AMD define replacement is not always reliable","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},"labels":[],"state":"closed","locked":false,"assignee":{"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},"milestone":null,"comments":5,"created_at":"2015-05-11T11:07:26Z","updated_at":"2015-10-07T21:07:47Z","closed_at":"2015-06-05T13:12:18Z","body":"From https://github.com/jspm/jspm-cli/issues/732#issuecomment-100714216, in Kendo UI we get:\r\n\r\n```javascript\r\n(function (f, define) {\r\n    define([], f)\r\n})(function () { \r\n      <<SOURCE CODE HERE>> \r\n}, typeof define == \"function\" && define.amd ? define : function (_, f) {\r\n    f()\r\n});\r\n```\r\n\r\nTurned into\r\n\r\n```javascript\r\n(function() {\r\nfunction define(){};  define.amd = {};\r\n(function(f, define) {  <-- Actual start of library source\r\n  define([], f);\r\n})(function() {\r\n  <<SOURCE CODE HERE>>\r\n}, typeof define == \"function\" && define.amd ? define : function(_, f) {\r\n  f();\r\n}); <-- Actual end of library source\r\n})();\r\n```\r\n\r\nBecause the define function is passed as a function parameter, the AMD transformer doesn't detect this pass to be able to replace the call of define with `System.register`.\r\n\r\nIt may be preferable to alter the AMD conversion to rather include the `System.register` call within the dummy define function at the top rather so we can handle these cases."},"comment":{"url":"https://api.github.com/repos/systemjs/builder/issues/comments/146329793","html_url":"https://github.com/systemjs/builder/issues/167#issuecomment-146329793","issue_url":"https://api.github.com/repos/systemjs/builder/issues/167","id":146329793,"user":{"login":"codylindley","id":115456,"avatar_url":"https://avatars.githubusercontent.com/u/115456?v=3","gravatar_id":"","url":"https://api.github.com/users/codylindley","html_url":"https://github.com/codylindley","followers_url":"https://api.github.com/users/codylindley/followers","following_url":"https://api.github.com/users/codylindley/following{/other_user}","gists_url":"https://api.github.com/users/codylindley/gists{/gist_id}","starred_url":"https://api.github.com/users/codylindley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codylindley/subscriptions","organizations_url":"https://api.github.com/users/codylindley/orgs","repos_url":"https://api.github.com/users/codylindley/repos","events_url":"https://api.github.com/users/codylindley/events{/privacy}","received_events_url":"https://api.github.com/users/codylindley/received_events","type":"User","site_admin":false},"created_at":"2015-10-07T21:07:47Z","updated_at":"2015-10-07T21:07:47Z","body":"Sweet! Just tested now. And the bundling works with Kendo UI AMD. Thank you!\r\n\r\nhttps://www.dropbox.com/s/0abez5aqrsiijvp/Screenshot%202015-10-07%2015.02.45.png?dl=0\r\n\r\n"}}