{"action":"created","issue":{"url":"https://api.github.com/repos/lerna/lerna/issues/334","repository_url":"https://api.github.com/repos/lerna/lerna","labels_url":"https://api.github.com/repos/lerna/lerna/issues/334/labels{/name}","comments_url":"https://api.github.com/repos/lerna/lerna/issues/334/comments","events_url":"https://api.github.com/repos/lerna/lerna/issues/334/events","html_url":"https://github.com/lerna/lerna/issues/334","id":175871851,"number":334,"title":"Automatic hoisting of common dependencies to repo root","user":{"login":"gigabo","id":115908,"avatar_url":"https://avatars.githubusercontent.com/u/115908?v=3","gravatar_id":"","url":"https://api.github.com/users/gigabo","html_url":"https://github.com/gigabo","followers_url":"https://api.github.com/users/gigabo/followers","following_url":"https://api.github.com/users/gigabo/following{/other_user}","gists_url":"https://api.github.com/users/gigabo/gists{/gist_id}","starred_url":"https://api.github.com/users/gigabo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gigabo/subscriptions","organizations_url":"https://api.github.com/users/gigabo/orgs","repos_url":"https://api.github.com/users/gigabo/repos","events_url":"https://api.github.com/users/gigabo/events{/privacy}","received_events_url":"https://api.github.com/users/gigabo/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/lerna/lerna/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":19,"created_at":"2016-09-08T21:41:22Z","updated_at":"2016-09-12T20:38:21Z","closed_at":null,"body":"This was left out of #237 to reduce its scope, but is still a valuable improvement!\r\n\r\nHoisting external dependencies that are shared across packages:\r\n\r\n- dramatically speeds up bootstrap\r\n- reduces the storage footprint of a Lerna repo\r\n- handles the singleton problem where a common dependency (e.g. React) must be shared\r\n\r\nShould this be default behavior, or an option (`lerna bootstrap --hoist-external`)?\r\n\r\nIt definitely needs a way to opt-out at the dependency level (we have deps internally at Redfin that _can't_ be hoisted).  What does that look like?  An option like `--no-hoist=<externalDep>`?"},"comment":{"url":"https://api.github.com/repos/lerna/lerna/issues/comments/246484177","html_url":"https://github.com/lerna/lerna/issues/334#issuecomment-246484177","issue_url":"https://api.github.com/repos/lerna/lerna/issues/334","id":246484177,"user":{"login":"thejameskyle","id":952783,"avatar_url":"https://avatars.githubusercontent.com/u/952783?v=3","gravatar_id":"","url":"https://api.github.com/users/thejameskyle","html_url":"https://github.com/thejameskyle","followers_url":"https://api.github.com/users/thejameskyle/followers","following_url":"https://api.github.com/users/thejameskyle/following{/other_user}","gists_url":"https://api.github.com/users/thejameskyle/gists{/gist_id}","starred_url":"https://api.github.com/users/thejameskyle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thejameskyle/subscriptions","organizations_url":"https://api.github.com/users/thejameskyle/orgs","repos_url":"https://api.github.com/users/thejameskyle/repos","events_url":"https://api.github.com/users/thejameskyle/events{/privacy}","received_events_url":"https://api.github.com/users/thejameskyle/received_events","type":"User","site_admin":false},"created_at":"2016-09-12T20:38:21Z","updated_at":"2016-09-12T20:38:21Z","body":"> Solve the problem where the problem exists\r\n\r\nThe problem of singleton projects doesn't appear in the monorepo. Lerna handles them just fine as they are intended to be installed. If you were working outside of a monorepo in just a bunch of folders it would work exactly this way.\r\n\r\nThis issue arises when you start using something like browserify or webpack, those are the tools that need to de-duplicate things. Set it up there and fix your entire build chain. You're just going to have to solve it twice if you push it down into Lerna.\r\n\r\n> There is always a tradeoff between power and ease of use.\r\n\r\nThat's not true, prioritize low level APIs for extension, don't build high-level APIs. High level APIs are less powerful and less easy to use. Lower level APIs allow for people to build the things that they need. Read the extensible web manifesto if you need inspiration.\r\n\r\n> What is the answer for devs who want this feature?\r\n\r\nThe answer is find a better solution, build on top of Lerna, if you need a hook request it. Don't push every bit of complexity into one location. You likely already have everything you need:\r\n\r\n```js\r\n$ npm install\r\n$ lerna bootstrap --ignore react,react-dom\r\n$ npm install react react-dom\r\n```\r\n\r\nAnd then add your resolves to Browserify and Webpack or whatever tool you are using.\r\n\r\nIf that doesn't work, think of the minimal lowest level API you need to make it work and request that. It's more likely to be useful to others."}}
{"actor":{"display_login":"thejameskyle"}}