{"action":"created","issue":{"url":"https://api.github.com/repos/muut/riotjs/issues/380","labels_url":"https://api.github.com/repos/muut/riotjs/issues/380/labels{/name}","comments_url":"https://api.github.com/repos/muut/riotjs/issues/380/comments","events_url":"https://api.github.com/repos/muut/riotjs/issues/380/events","html_url":"https://github.com/muut/riotjs/issues/380","id":57786611,"number":380,"title":"Ideas for modularizing the code","user":{"login":"speier","id":415836,"avatar_url":"https://avatars.githubusercontent.com/u/415836?v=3","gravatar_id":"","url":"https://api.github.com/users/speier","html_url":"https://github.com/speier","followers_url":"https://api.github.com/users/speier/followers","following_url":"https://api.github.com/users/speier/following{/other_user}","gists_url":"https://api.github.com/users/speier/gists{/gist_id}","starred_url":"https://api.github.com/users/speier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/speier/subscriptions","organizations_url":"https://api.github.com/users/speier/orgs","repos_url":"https://api.github.com/users/speier/repos","events_url":"https://api.github.com/users/speier/events{/privacy}","received_events_url":"https://api.github.com/users/speier/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-02-16T10:20:11Z","updated_at":"2015-02-17T11:05:29Z","closed_at":null,"body":"@tipiirai I just wondering if you guys have anything on your mind regarding to a module system?\r\n\r\nI think it would be nice to transform all these plain js files into modules (CommonJS, or something else). Different functions using various global/context variables all around the code makes contributions really hard (at least that's what I was realized when I was working on my pull request https://github.com/muut/riotjs/pull/368).\r\n\r\nI personally vote for CommonJS, and generate the final bundle with `browserify`, however the size of that bundle could be a bit bigger, probably still worth it.\r\n\r\nQuick tests shows that, the final __gzipped__ version could be bigger around ~1K ...\r\n\r\nmaster (_2.0.9_):\r\n```\r\n6.7K 16 Feb 10:57 riot.min.js\r\n3.0K 16 Feb 10:58 riot.min.js.gz\r\n```\r\n\r\ndev (_with `exports` and includes some of my changes to work on node but no external modules_):\r\n```\r\n9.6K 16 Feb 10:58 riot-browserify.min.js\r\n4.0K 16 Feb 10:58 riot-browserify.min.js.gz\r\n``` \r\n\r\nI'm happy to contribute to this, just wanted to discuss about various options before actaully start working on any kind of modules. ;)\r\n\r\nWhat do you think?"},"comment":{"url":"https://api.github.com/repos/muut/riotjs/issues/comments/74651368","html_url":"https://github.com/muut/riotjs/issues/380#issuecomment-74651368","issue_url":"https://api.github.com/repos/muut/riotjs/issues/380","id":74651368,"user":{"login":"tipiirai","id":169330,"avatar_url":"https://avatars.githubusercontent.com/u/169330?v=3","gravatar_id":"","url":"https://api.github.com/users/tipiirai","html_url":"https://github.com/tipiirai","followers_url":"https://api.github.com/users/tipiirai/followers","following_url":"https://api.github.com/users/tipiirai/following{/other_user}","gists_url":"https://api.github.com/users/tipiirai/gists{/gist_id}","starred_url":"https://api.github.com/users/tipiirai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tipiirai/subscriptions","organizations_url":"https://api.github.com/users/tipiirai/orgs","repos_url":"https://api.github.com/users/tipiirai/repos","events_url":"https://api.github.com/users/tipiirai/events{/privacy}","received_events_url":"https://api.github.com/users/tipiirai/received_events","type":"User","site_admin":false},"created_at":"2015-02-17T11:05:28Z","updated_at":"2015-02-17T11:05:28Z","body":"I hope we can use the current system at this point and I suggest we move to commonjs if there is a stronger need. Right now test suites are [being developed](https://github.com/muut/riotjs/issues/375) without commonjs. \r\n"}}