News for hackers. Stuff that matters.
Re:NPM v4.0.0 by octref on Sunday October 23, 2016 @01:40AM (#12772143)
After using yarn for a week, I can't imagine going back to npm.

I use npm 90% for install, and yarn does this so much better.

Installs are 3-4 times faster. Output is minimal and readable (compared to npm's wall of text that I never read). Packages are cached so I can work with slow connections in coffee shops.

Sorry to be blunt, but I feel none of the release features gonna help my daily usage of npm. How about actually fixing the tab completion, which has been slow and broken forever?

Re:NPM v4.0.0 by scrollaway on Sunday October 23, 2016 @01:44AM (#12772152)
I'm super excited to use yarn but, just a heads up, we hit this pretty severe issue when setting it up for our projects: https://github.com/yarnpkg/yarn/issues/761
Re:NPM v4.0.0 by po1nter on Sunday October 23, 2016 @05:52AM (#12772782)
And if you are using npm & bower in the same project then this other issue is a show stopper https://github.com/yarnpkg/yarn/issues/616
Re:NPM v4.0.0 by ceejayoz on Sunday October 23, 2016 @12:09PM (#12774073)
Out of curiosity, why use npm and bower in the same project?
Re:NPM v4.0.0 by joshstrange on Sunday October 23, 2016 @12:51PM (#12774265)
Not op but I'll chime in. My team uses npm for our build tools and bower for our frontend libraries (moment, chats, lodash, etc). Our re-write only uses npm but at the time (and possibly even now) there were frontend libraries that only provide bower packages and bower seemed like the right tool for the job anyways.
Re:NPM v4.0.0 by gotofritz on Sunday October 23, 2016 @06:34PM (#12775757)
It doesn't sound ideal having two tools that do pretty much the same thing, you are just adding a potential extra point of failure. Migrating from bower to npm is incredibly easy.
Re:NPM v4.0.0 by ferentchak on Monday October 24, 2016 @03:48PM (#12782193)
I remember wondering this same thing myself when Bower was the the new hotness.

"Don't I already have a tool that does exactly this?"

Re:NPM v4.0.0 by Sacho on Sunday October 23, 2016 @11:53PM (#12776696)
How would you migrate libraries that are only on bower, not npm?
Re:NPM v4.0.0 by ceejayoz on Monday October 24, 2016 @08:34AM (#12778216)
How many of those are a) left and b) still maintained?
Re:NPM v4.0.0 by gotofritz on Tuesday October 25, 2016 @05:06AM (#12786385)
If there are still any in 2016 it's a good sign they are not begin actively maintained
Re:NPM v4.0.0 by octref on Sunday October 23, 2016 @01:50AM (#12772170)
Yeah I wouldn't use it in production until it becomes more stable. However the team behind it seems to iterate really fast. Look at the issues fixed between public release and 0.16[0], which is only 7 days.

[0]: https://github.com/yarnpkg/yarn/releases/tag/v0.16.0

Re:NPM v4.0.0 by amasad on Sunday October 23, 2016 @02:04AM (#12772216)
I've been using it in production for a large app for the past week and it's been great. CI is faster, deploying is faster and dev is faster.
Re:NPM v4.0.0 by Etheryte on Sunday October 23, 2016 @05:09AM (#12772680)
Likewise, can't wait for yarn to finish its growing pains, until then it's still npm.
Re:NPM v4.0.0 by vonklaus on Sunday October 23, 2016 @09:13AM (#12773413)
It looks like they want to just eat bower. Tbh, if webpack or browserify can eat a tooling & dev stack, and yarn can eat bower and do package management, it would be a nice workflow.

I wouldn't want 1 tool to rule them all, but a single tooling/dev/task kit and a single dependency/pckg manager would be nice.

Re:NPM v4.0.0 by cel1ne on Sunday October 23, 2016 @05:57AM (#12772799)
It seem to ignore shrinkwrapped packages as well: https://medium.com/@boennemann/avoid-yarn-for-packages-and-f...
Re:NPM v4.0.0 by lucaspiller on Sunday October 23, 2016 @10:12AM (#12773630)
Except now there's another competing standard in the JavaScript world. How long until a feature is added to Yarn and not NPM or vice versa, and a package only works in one of them?

I don't mean to be rude, but your last paragraph comes across a bit strange, it sounds like you have a sense of entitlement to having NPM work the way you want. The project is open source, you can fix it, send a pull request, and the whole community will benefit. I wonder if it would have been better if the Yarn developers would had done the same.

Re:NPM v4.0.0 by klodolph on Sunday October 23, 2016 @10:36AM (#12773726)
I don't agree with the whole "it's open source, so if you don't fix it yourself you're just being entitled".

1. We have a finite amount of time each week just like everyone else. Fixing a problem with an open source project might consume a couple weeks of free time just for a tiny bug fix, because of the time it takes to learn a new code base, get tests running, and other administrative details. Larger fixes might consume an entire year.

2. Sometimes, problems are design flaws and can't really be made into pull requests. I have a strong suspicion that some of the problems with NPM fall into this camp, based on my personal experiences with NPM and how badly it performs some of its basic tasks relative to the project's age and maturity.

I'm going to flip this around, so please forgive if this seems trite, but it sounds like you have a sense of entitlement yourself. Users do not "owe" the projects they use pull requests just because it's possible. Users have their own goals and motivations, and if a competing program is simply better than the program you like (from some users' perspective) it's absurd to blame the users for it.

(I mean, from personal experience NPM is an astoundingly poor package manager. I've had it OOM on me on VMs for the most basic of tasks, and some commands are completely unusable.)

Re:NPM v4.0.0 by lucaspiller on Monday October 24, 2016 @06:45AM (#12777792)
Your argument is valid, but I think you misunderstood my point. I'm not saying that you have to fix it, just that you can. And you/we should take advantage of that.

We as developers can work together on open source projects, and make them better for everyone. It's not like closed source software where the choices are a) use a competing product or b) write our own. And by work I don't mean just writing code: writing documentation and even reporting issues is just as valuable.

It seems to me that the JavaScript community is very quick to say "this is s..t, I can do better!" and throw away all the work someone has done and reimplement it from scratch. Sometimes developers take criticism very badly, so I agree it isn't always an possible to say "how about you try this", and I agree sometimes the code is beyond saving and it is better just to start afresh. But as someone who is mainly an outsider to the community, it seems like there is very much an epidemic of NIH syndrome, and people aren't even willing to try contributing.

Maybe you are right about my sense of entitlement, but I do truly believe if we would work together more and be less self-centred, society would benefit greatly from it.

Re:NPM v4.0.0 by klodolph on Monday October 24, 2016 @09:16AM (#12778451)
I don't think I misunderstood your point at all. Your comment here seems to be splitting hairs between whether I think that you are claiming that you "have to" fix things or whether you are claiming we "should" fix things. I don't think that the distinction between "have to" or "should" is particularly relevant.

You're right that the JS community is quick to dump a project. You're also right that sometimes code is beyond saving and it's better to start afresh. As someone who claims to be an outsider to the JS community, maybe you don't understand just how broken NPM is, and how much we welcome the appearance of something like Yarn.

This is the real beauty of having a separate package repository and package manager, and the beauty of open source software when it's made out of components with well-defined interfaces. Yarn can still use the NPM repository, but Yarn will suffer from far fewer of the deficiencies that NPM has. The exact same thing has happened in other communities many times. Haskell went from Cabal to Stack, Python went from easy_install to pip, and most Linux distros have been through their fair share of package managers. As someone who has personally migrated from Cabal to Stack and from easy_install to pip, the change from NPM to Yarn seems familiar.

Or in other words, the replacement of NPM (the package manager) with Yarn is a healthy thing that is happening for good reasons (because reporting issues, writing documentation, and submitting PRs will not make NPM do what you want, and saying that we "should" do those things is wrong).

Re:NPM v4.0.0 by sotojuan on Sunday October 23, 2016 @11:04AM (#12773841)
> The project is open source, you can fix it, send a pull request, and the whole community will benefit. I wonder if it would have been better if the Yarn developers would had done the same.

Yeah right. It's not as easy as "hey here's a big PR that overhauls the install algorithm and caching!" and npm will be like "ok merged". A PR (or series of PRs) like these would stall for months or even longer (just check out the amount of open PRs and issues in the npm repo).

Re:NPM v4.0.0 by i__believe on Sunday October 23, 2016 @10:44AM (#12773766)
Often times I see this argument made, and on it's face seems like a good one.

However, experience has proven that it is difficult to actually contribute--even in active repo like npm. Every project has there own standards and unwritten rules. Further, many repo maintainers are unresponsive after initial contact, adding frustration to an already frustrating process of getting work put in.

Let's take npm/npm as an example. There is no easy to find contributing guidelines, thousands of open issues, and pull requests that have been open for months where the author requests more info so they can complete their work but without an answer. All of this leads to a contributor-hostile experience.

I think we as a community should consolidate the contribution process, and start treating that as a product and gets the same love the code does.

Re:NPM v4.0.0 by otar on Sunday October 23, 2016 @10:37AM (#12773733)
Yarn may be something worth investing time in, but in the announcement blog post I found this part exceedingly ridiculous:

"The easiest way to get started is to run: npm install -g yarn"

Re:NPM v4.0.0 by steveklabnik on Sunday October 23, 2016 @04:22PM (#12775248)
They also have binaries you can install without npm, however, it's extremely likely that their target audience already has npm installed, so that is indeed the easiest.

(Also, something something "easy_install pip" or "gem install bundler")

Re:NPM v4.0.0 by cr3ative on Monday October 24, 2016 @10:23AM (#12779024)
It's a drop-in replacement for an audience who almost certainly have npm already. Path of least resistance for your audience is where you should be.
Re:NPM v4.0.0 by raindev on Sunday October 23, 2016 @05:55AM (#12772790)
I went to DuckDuckGo to check out what yarn is. The front page makes no mention of JavaScript at all (at least on mobile). Accordingly to DuckDuckGo the whole site mentions "JavaScript" only three times. The same is true about the GitHub readme: no mentions of JavaScript at all. Before praising something, makes sense to tell people what it is.

/rant

Thanks for the highlight, I use npm solely for global installs, will give yarn a try.

Re:NPM v4.0.0 by scriptdevil on Sunday October 23, 2016 @09:39AM (#12773510)
I used DDG too, Generally, one would search for something like "yarn npm" in which case it is like the second link is the yarn homepage and the first link is a npm vs yarn post. DDG isn't as good as Google in figuring out context because it doesn't assume you are a programmer because it doesn't track or bubble you.
Re:NPM v4.0.0 by coldtea on Sunday October 23, 2016 @08:48AM (#12773336)
>I went to DuckDuckGo to check out what yarn is.

And DuckDuckGo (mentioned twice in the comment) is relevant because?

Re:NPM v4.0.0 by raindev on Sunday October 23, 2016 @09:10AM (#12773401)
Because DuckDuckGo's index of the yarn's website could be screwed or out of date. Also, because people communicate using language, not axioms.
Re:NPM v4.0.0 by coldtea on Sunday October 23, 2016 @01:13PM (#12774359)
>Because DuckDuckGo's index of the yarn's website could be screwed or out of date.

And why should we know about DDG's index info about Yarn?

Just visit Yarn's actual project site (which is what you're supposed to be criticizing), and focus your critique on what's actually there now.

>Also, because people communicate using language, not axioms.

So? How does that justify adding off-topic/redundant information on one's critique?

Re:NPM v4.0.0 by Kiro on Sunday October 23, 2016 @07:49AM (#12773127)
> Before praising something, makes sense to tell people what it is.

I don't know where you've been but anyone who is even remotely invested in the npm ecosystem probably knows what Yarn is at this point.

Re:NPM v4.0.0 by sametmax on Sunday October 23, 2016 @08:44AM (#12773321)
This is irrelevant. You may be just a new comer, or not a professional developer, and still want to use yarn. A clear website seems a basic requirement to me for any project.
Re:NPM v4.0.0 by coldtea on Sunday October 23, 2016 @08:50AM (#12773343)
>A clear website seems a basic requirement to me for any project.

Well, you can't always depend on that, and in the end of the day, nothing beats actually researching and asking around.

The GNU tools have some of the worst webpages -- and yet they are some of the most useful, and commonly used, packages.

Re:NPM v4.0.0 by raindev on Sunday October 23, 2016 @09:18AM (#12773438)
Let's take a look at GNU tar [1] and GNU social [2] webpages as examples. The first thing they tell a user is what the project is. I would say, both of them are order of magnitude better than the yarn homepage.

1. https://www.gnu.org/software/tar/ 2. https://gnu.io/social/

Re:NPM v4.0.0 by coldtea on Sunday October 23, 2016 @01:16PM (#12774373)
>GNU Tar provides the ability to create tar archives

Really descriptive.

Re:NPM v4.0.0 by Hbthegreat on Sunday October 23, 2016 @06:56AM (#12772966)
Yarn has been the talk of the dev world for the last week man. It had a large upswing on both here and reddit.
Re:NPM v4.0.0 by raindev on Sunday October 23, 2016 @09:11AM (#12773408)
Not everyone reads news all the time.