-
If I understood correctly, yarn pnp stores dependencies to git history. So if I'm writing a library, is it still worth using yarn pnp? Does using pnp make fetching my library any slower or inefficient? Should I ignore Unfortunately, I couldn't find a guide or best practices from the doc on what should I do especially when I am writing a library. I appreciate all your answers and experiences! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Not necessarily (starting from 4.0, PnP doesn't imply checking-in the dependencies by default). So there are multiple angles to this question: Should I use Yarn PnP when working on a library? To that I'd say yes, as PnP ensures you don't depend on packages without listing them in your dependencies. As a result your library is safer for your users, as there are less chances you'd accidentally publish something broken. Should I check-in my dependencies when working on a library? To that I'd say "probably not", although it depends on circumstances and your personal taste - checking in the dependencies has no impact once the package is published (it's only used in development), so it has neither pros nor cons from this perspective. Checking-in dependencies is usually recommended in enterprise settings where you really don't want to access the network from your containers (be it because you're in an airgapped environment, or because you're worried of the registry's transient failures). For open-source libraries it's less of a concern, although it can be nice to avoid having to run |
Beta Was this translation helpful? Give feedback.
Not necessarily (starting from 4.0, PnP doesn't imply checking-in the dependencies by default). So there are multiple angles to this question:
Should I use Yarn PnP when working on a library?
To that I'd say yes, as PnP ensures you don't depend on packages without listing them in your dependencies. As a result your library is safer for your users, as there are less chances you'd accidentally publish something broken.
Should I check-in my dependencies when working on a library?
To that I'd say "probably not", although it depends on circumstances and your personal taste - checking in the dependencies has no impact once the package is published (…