{"action":"created","issue":{"url":"https://api.github.com/repos/marcuswestin/store.js/issues/116","labels_url":"https://api.github.com/repos/marcuswestin/store.js/issues/116/labels{/name}","comments_url":"https://api.github.com/repos/marcuswestin/store.js/issues/116/comments","events_url":"https://api.github.com/repos/marcuswestin/store.js/issues/116/events","html_url":"https://github.com/marcuswestin/store.js/issues/116","id":56346457,"number":116,"title":"UMD (Universal Module Definition) patterns for JavaScript modules that work everywhere.","user":{"login":"whitehat101","id":1093593,"avatar_url":"https://avatars.githubusercontent.com/u/1093593?v=3","gravatar_id":"","url":"https://api.github.com/users/whitehat101","html_url":"https://github.com/whitehat101","followers_url":"https://api.github.com/users/whitehat101/followers","following_url":"https://api.github.com/users/whitehat101/following{/other_user}","gists_url":"https://api.github.com/users/whitehat101/gists{/gist_id}","starred_url":"https://api.github.com/users/whitehat101/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whitehat101/subscriptions","organizations_url":"https://api.github.com/users/whitehat101/orgs","repos_url":"https://api.github.com/users/whitehat101/repos","events_url":"https://api.github.com/users/whitehat101/events{/privacy}","received_events_url":"https://api.github.com/users/whitehat101/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-03T08:11:32Z","updated_at":"2015-02-13T23:31:34Z","closed_at":"2015-02-13T23:31:34Z","body":"https://github.com/umdjs/umd\r\n\r\nI stumbled upon a project that may provide the cross-environment module loading goodness Marcus has been dreaming about. The issue title / repo description pretty much says it all. I haven't tested any of this personally, but I'm optimistic.\r\n\r\nI believe the CommonJs Strict example is the most compatible flavor out there. I'm not a Node developer. If CommonJs is just for loading backend Node dependencies, then this may not be the best flavor. However, the project is well documented, and I expect a little bit of reading will answer most questions.\r\n\r\nI'd love to polish this into a PR, but I have a bunch on my plate right now.\r\n\r\nHope it helps.\r\n\r\nhttps://github.com/umdjs/umd/blob/master/commonjsStrict.js:\r\n```javascript\r\n// Uses CommonJS, AMD or browser globals to create a module.\r\n\r\n// If you just want to support Node, or other CommonJS-like environments that\r\n// support module.exports, and you are not creating a module that has a\r\n// circular dependency, then see returnExports.js instead. It will allow\r\n// you to export a function as the module value.\r\n\r\n// Defines a module \"commonJsStrict\" that depends another module called \"b\".\r\n// Note that the name of the module is implied by the file name. It is best\r\n// if the file name and the exported global have matching names.\r\n\r\n// If the 'b' module also uses this type of boilerplate, then\r\n// in the browser, it will create a global .b that is used below.\r\n\r\n// If you do not want to support the browser global path, then you\r\n// can remove the `root` use and the passing `this` as the first arg to\r\n// the top function.\r\n\r\n(function (root, factory) {\r\n    if (typeof define === 'function' && define.amd) {\r\n        // AMD. Register as an anonymous module.\r\n        define(['exports', 'b'], factory);\r\n    } else if (typeof exports === 'object') {\r\n        // CommonJS\r\n        factory(exports, require('b'));\r\n    } else {\r\n        // Browser globals\r\n        factory((root.commonJsStrict = {}), root.b);\r\n    }\r\n}(this, function (exports, b) {\r\n    //use b in some fashion.\r\n\r\n    // attach properties to the exports object to define\r\n    // the exported module properties.\r\n    exports.action = function () {};\r\n}));\r\n```"},"comment":{"url":"https://api.github.com/repos/marcuswestin/store.js/issues/comments/74345897","html_url":"https://github.com/marcuswestin/store.js/issues/116#issuecomment-74345897","issue_url":"https://api.github.com/repos/marcuswestin/store.js/issues/116","id":74345897,"user":{"login":"marcuswestin","id":131967,"avatar_url":"https://avatars.githubusercontent.com/u/131967?v=3","gravatar_id":"","url":"https://api.github.com/users/marcuswestin","html_url":"https://github.com/marcuswestin","followers_url":"https://api.github.com/users/marcuswestin/followers","following_url":"https://api.github.com/users/marcuswestin/following{/other_user}","gists_url":"https://api.github.com/users/marcuswestin/gists{/gist_id}","starred_url":"https://api.github.com/users/marcuswestin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcuswestin/subscriptions","organizations_url":"https://api.github.com/users/marcuswestin/orgs","repos_url":"https://api.github.com/users/marcuswestin/repos","events_url":"https://api.github.com/users/marcuswestin/events{/privacy}","received_events_url":"https://api.github.com/users/marcuswestin/received_events","type":"User","site_admin":false},"created_at":"2015-02-13T23:31:34Z","updated_at":"2015-02-13T23:31:34Z","body":"@whitehat101 you're awesome.\r\n\r\nNow let's see if amdjs holds up to its promise."}}