That article is unfortunately worded. npm v3 did not have a true flat dependency structure, but a rather a *flatter *dependency structure. The article referenced gives a good overview of what npm v3 achieved (https://docs.npmjs.com/how-npm-works/npm3). Basically, it installs flat unless there are conflicting versions, then it installs nested. This does not work for front-end dependencies well because you can possibly load two versions of the same library to the client, or you load only one version of a library and it breaks another library because it expected a different version.
Polymer v3 requires a truly flat dependency tree where there are never nested dependencies. When there are conflicting versions of a dependency, a 'resolution' is needed to decide which single version to install. This was achieved in bower through the 'resolutions' key (https://github.com/bower/spec/blob/master/json.md#resolutions). Currently npm does not have an equal feature, but yarn does (https://yarnpkg.com/en/docs/selective-version-resolutions). On Thursday, October 26, 2017 at 12:58:40 AM UTC-5, [email protected] wrote: > > Are you sure? > > https://news.ycombinator.com/item?id=10817978 > > On Thursday, October 19, 2017 at 3:15:42 AM UTC+5:30, Justin Fagnani wrote: >> >> On Wed, Oct 18, 2017 at 8:16 AM, <[email protected]> wrote: >> >>> Specifically, NPM 5 does not accomplish #3 of your list. >>> >> >> This is exactly right >> >> >>> I've heard that they are working on enabling that in a future release >>> but for now the only package manager based off of the npm registry that can >>> handle flat dependency trees is yarn. >>> >>> On Sunday, October 1, 2017 at 9:30:14 AM UTC-5, Mark wrote: >>>> >>>> I was reading Polymer's 3.0 Preview documentation >>>> <https://www.polymer-project.org/blog/2017-08-23-hands-on-30-preview> >>>> and see that they've announced that yarn is a dependency. >>>> >>>> Why? instead of just using NPM 5 >>>> <https://auth0.com/blog/whats-new-in-node8-and-npm5/>, which does a >>>> lot of the same things yarn does? >>>> In the summit, they have said <https://youtu.be/JH6jEcLxJEI?t=8m20s> >>>> that they needed a package manager to: >>>> >>>> 1. Manages dependencies >>>> 2. Resolves version conflicts >>>> 3. Supports a flat dependency tree >>>> 4. Has an active community >>>> >>>> >>>> AFAIK, npm already does this in later versions. So why use yarn which >>>> is unnecessary? >>>> I get that yarn may be the hot dependency manager today but a lot of >>>> people are fine with just using npm. >>>> >>> Follow Polymer on Google+: plus.google.com/107187849809354688692 >>> --- >>> You received this message because you are subscribed to the Google >>> Groups "Polymer" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/polymer-dev/2e9f6920-4a45-4c84-9a5d-7208653c98ba%40googlegroups.com >>> >>> <https://groups.google.com/d/msgid/polymer-dev/2e9f6920-4a45-4c84-9a5d-7208653c98ba%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> Follow Polymer on Google+: plus.google.com/107187849809354688692 --- You received this message because you are subscribed to the Google Groups "Polymer" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/3b394357-2426-49ef-ac8d-cdd8d71e1f28%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
