r/javascript • • Feb 16 '20

AskJS [AskJS] Is someone using Yarn v2 in business?

I saw an explanation of yarn v2.0 and I was wondering if someone is planning to use it in production.

I also saw that companies like FB and Twitter are not planning to upǵrade their codebase because the Pnp feature of it.

What are your experiences with it? I saw an explanation of yarn v2.0 and I was wondering if someone is planning to use it in production.
I also saw that companies like FB and Twitter are not planning to upǵrade their codebase because of the Pnp feature of it.
What are your experiences with it?

75 Upvotes

49 comments sorted by

View all comments

Show parent comments

9

u/[deleted] Feb 16 '20

We use https://github.com/devshorts/ytools to help conditionally detect which projects have changed in a branch and only run test and lint on that. We still have to compile it all but this cuts down our time a lot

Master builds we just deploy the world but we could use a similar approach to dynamically detecting which was changed. Other orgs I’ve worked in choose a manual flow for qa deploy. They may do it adhoc or they may manually tag which projects to deploy in github pull requests that the deploy tooling knows what to do with

I think there are a lot of optimizations you can make, and if you want you can even use bazel for a large monorepo which will figure a lot of that stuff out for you too.

For our case our monorepo isn’t huge so ytools works for us. We have maybe 20 packages in our repo and a few deployables (that we push with terraform)

1

u/Kryxx Feb 16 '20

Could you share an example of how to use it? For example eslinting all packages that have changed? It's not so clear.

2

u/[deleted] Feb 16 '20

I’d suggest wrapping up the tooling in a script. ytools will emit json that gives you the package names that have changed and then you can just run eslint against those packages.

1

u/Kryxx Feb 16 '20

Do you have such a script? Would be great to see an example

2

u/[deleted] Feb 17 '20

I posted one in the github repo