{"action":"created","issue":{"url":"https://api.github.com/repos/meteor/react-packages/issues/152","labels_url":"https://api.github.com/repos/meteor/react-packages/issues/152/labels{/name}","comments_url":"https://api.github.com/repos/meteor/react-packages/issues/152/comments","events_url":"https://api.github.com/repos/meteor/react-packages/issues/152/events","html_url":"https://github.com/meteor/react-packages/issues/152","id":123002902,"number":152,"title":"Deprecate or rewrite packages, examples, and documentation to take advantage of modules support in Meteor 1.3","user":{"login":"benjamn","id":5750,"avatar_url":"https://avatars.githubusercontent.com/u/5750?v=3","gravatar_id":"","url":"https://api.github.com/users/benjamn","html_url":"https://github.com/benjamn","followers_url":"https://api.github.com/users/benjamn/followers","following_url":"https://api.github.com/users/benjamn/following{/other_user}","gists_url":"https://api.github.com/users/benjamn/gists{/gist_id}","starred_url":"https://api.github.com/users/benjamn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benjamn/subscriptions","organizations_url":"https://api.github.com/users/benjamn/orgs","repos_url":"https://api.github.com/users/benjamn/repos","events_url":"https://api.github.com/users/benjamn/events{/privacy}","received_events_url":"https://api.github.com/users/benjamn/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-12-18T18:31:07Z","updated_at":"2015-12-21T15:56:44Z","closed_at":null,"body":"- [ ] The `jsx` package will no longer be necessary: https://github.com/meteor/meteor/commit/86b743f96346b66a7b79586823bbb92eeed8a83d\r\n- [ ] Users should `npm install react` in a local `node_modules` directory rather than using the wrapper `react` package from this repository.\r\n- [ ] The `react-meteor-data` and `react-template-helper` packages might as well become npm packages, too.\r\n- [ ] The examples should be rewritten with appropriate `package.json` files.\r\n- [ ] The docs can be drastically simplified, especially https://github.com/meteor/react-packages/blob/devel/docs/client-npm.md."},"comment":{"url":"https://api.github.com/repos/meteor/react-packages/issues/comments/166339606","html_url":"https://github.com/meteor/react-packages/issues/152#issuecomment-166339606","issue_url":"https://api.github.com/repos/meteor/react-packages/issues/152","id":166339606,"user":{"login":"benjamn","id":5750,"avatar_url":"https://avatars.githubusercontent.com/u/5750?v=3","gravatar_id":"","url":"https://api.github.com/users/benjamn","html_url":"https://github.com/benjamn","followers_url":"https://api.github.com/users/benjamn/followers","following_url":"https://api.github.com/users/benjamn/following{/other_user}","gists_url":"https://api.github.com/users/benjamn/gists{/gist_id}","starred_url":"https://api.github.com/users/benjamn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benjamn/subscriptions","organizations_url":"https://api.github.com/users/benjamn/orgs","repos_url":"https://api.github.com/users/benjamn/repos","events_url":"https://api.github.com/users/benjamn/events{/privacy}","received_events_url":"https://api.github.com/users/benjamn/received_events","type":"User","site_admin":false},"created_at":"2015-12-21T15:56:44Z","updated_at":"2015-12-21T15:56:44Z","body":"Per recent discussions with the team, the syntax is probably going to end up looking like `import {Tracker} from \"meteor/tracker\"` (note the extra `meteor/`). The primary reason for this change is that it's much easier to avoid collisions with npm package names if all Meteor packages are namespaced. Indeed, the only possible conflict is with https://www.npmjs.com/package/meteor, which is a wrapper package for Meteor itself, and thus unlikely to be installed within a Meteor application.\r\n\r\nThe reason we were worried about conflicting package names is that we're also getting rid of the top-level `app` directory, which means an app with a top-level `node_modules` directory will actually share that `node_modules` directory with Meteor packages. Since the app developer could install any npm package in the `node_modules` directory (and since npm 3 often hoists deeper dependencies up to the top level), we think it's pretty important to prevent Meteor packages from competing with npm packages over the top-level `node_modules` namespace.\r\n\r\nHere's what the directory structure might look like in an example app:\r\n```\r\nmeteorInstall({\r\n  \"example.css\": ...,\r\n  \"example.html\": ...,\r\n  \"example.js\": function(require, exports, module) {\r\n    // This works, as long as the app developer has installed some version of React.\r\n    var React = require(\"react\");\r\n    // These imports work according to the usual Node module lookup algorithm.\r\n    var Accounts = require(\"meteor/accounts-base\").Accounts;\r\n    var Blaze = require(\"meteor/blaze\");\r\n    ...\r\n  },\r\n  node_modules: {\r\n    // This copy of react was presumably installed by the app developer\r\n    // in the top-level node_modules directory within the app, by simply\r\n    // running `mkdir node_modules; npm install react`. However, because\r\n    // this node_modules directory is shared between app code and\r\n    // Meteor package code, both apps and packages can import this\r\n    // copy of React. In other words, the app developer gets to decide\r\n    // which version of React should be used throughout the application.\r\n    react: {\r\n      \"package.json\": ...,\r\n      \"index.js\": ...,\r\n      ...\r\n    },\r\n    // All Meteor packages get meteorInstall-ed inside node_modules/meteor/,\r\n    // regardless of whether they were local packages or came from Atmosphere.\r\n    meteor: {\r\n      \"accounts-base.js\": function (require, exports, module) {\r\n        // This works, as long as the app developer has installed some version of React.\r\n        var React = require(\"react\");\r\n        ...\r\n      },\r\n      \"blaze.js\": function (require, exports, module) {\r\n        // Meteor packages that don't yet api.use(\"modules\") will have stubs\r\n        // generated for them, so that modules-using code can still import them.\r\n        module.exports = Package[\"blaze\"];\r\n      }\r\n    }\r\n  }\r\n});\r\n```"}}