yarn v3.0.0-rc.1 Release Notes
-
yarn set version 3.0.0-rc.1
๐ฅ Breaking Changes
- ๐ Node 10 isn't supported anymore.
- ๐ Plugins can't access
yup
anymore (we migrated to Typanion as part of Clipanion v3).- To upgrade
workspace-tools
, remove it from your.yarnrc.yml
, upgrade, then import it back.
- To upgrade
- ๐ท The
enableImmutableInstalls
will now default totrue
on CI (we still recommend to explicitly use--immutable
on the CLI).- You can re-allow mutations by adding
YARN_ENABLE_IMMUTABLE_INSTALLS=false
in your environment variables.
- You can re-allow mutations by adding
- ๐ง The
initVersion
andinitLicense
configuration options have been removed.initFields
should be used instead. - Yarn will now generate
.pnp.cjs
files (instead of.pnp.js
) when using PnP, regardless of what thetype
field inside the manifest is set to. - The virtual folder (used to disambiguate peer dependencies) got renamed from
$$virtual
into__virtual__
. - ๐ The
-a
alias flag ofyarn workspaces foreach
got removed; use-A,--all
instead, which is strictly the same. - The old PnPify SDK folder (
.vscode/pnpify
) won't be cleaned up anymore. - ๐ The
bstatePath
configuration option has been removed. The build state (.yarn/build-state.yml
) has been moved into the install state (.yarn/install-state.gz
) - The cache files need to be regenerated. We had to change their timestamps in order to account for a flaw in the zip spec that was causing problems with some third-party tools.
API
- ๐
structUtils.requirableIdent
got removed; usestructUtils.stringifyIdent
instead, which is strictly the same. - ๐ง
configuration.format
got removed; useformatUtils.pretty
instead, which is strictly the same, but type-safe. - ๐
httpUtils.Options['json']
got removed; usehttpUtils.Options['jsonResponse']
instead, which is strictly the same. - ๐ฆ
PackageExtension['description]
got removed, useformatUtils.json(packageExtension, formatUtils.Type.PACKAGE_EXTENSION)
instead, which is strictly the same. - ๐
Project.generateBuildStateFile
has been removed, the build state is now inProject.storedBuildState
. Project.tryWorkspaceByDescriptor
andProject.getWorkspaceByDescriptor
now match on virtual descriptors.
Installs
๐ The node-modules linker now does its best to support the
portal:
protocol. This support comes with two important limitations:- Projects that make use of such dependencies will have to be run with the
--preserve-symlinks
Node option if they wish to access their dependencies. - Because Yarn installs will never modify files outside of the project due to security reasons, sub-dependencies of packages with
portal:
must be hoisted outside of the portal. Failing that (for example if the portal package depends on something incompatible with the version hoisted via another package), the linker will produce an error and abandon the install.
- Projects that make use of such dependencies will have to be run with the
The node-modules linker can now utilize hardlinks. The new setting
nmMode: classic | hardlinks-local | hardlinks-global
specifies whichnode_modules
strategy should be used:classic
- standardnode_modules
layout, without hardlinkshardlinks-local
- standardnode_modules
layout with hardlinks inside the project onlyhardlinks-global
- standardnode_modules
layout with hardlinks pointing to global content storage across all the projects using this option
๐ Bugfixes
- Yarn now has a proper governance model.
- The
node-modules
linker will now ensure that the generated install layouts are terminal, by doing several rounds when needed. - โ The
node-modules
linker will no longer print warnings about postinstall scripts when a workspace depends on another workspace listing install scripts. - Peer dependencies depending on their own parent are now properly hoisted by the node-modules linker.
- ๐ง Boolean values will be properly interpreted when specified inside the configuration file via the
${ENV_VAR}
syntax. - Should any of
preinstall
,install
,postinstall
fail, the remaining scripts will be skipped. - 0๏ธโฃ The
git:
protocol will now default to fetchingHEAD
(rather than the hardcodedmaster
). - ๐ฆ The
SIGTERM
signal will now be propagated to child processes. - ๐ And a bunch of smaller fixes.
Settings
- ๐ Various
initFields
edge cases have been fixed. - The
preferAggregateCacheInfo
flag will now also aggregate cleanup reports. - A new
enableMessageNames
flag can be set tofalse
to exclude theYNxxxx
from the output.
Commands
- โฌ๏ธ
yarn set version from sources
will now upgrade the builtin plugins as well unless--skip-plugins
is set. - ๐
yarn version apply
now support a new--prerelease
flag which replaces how prerelease were previously handled. yarn run
should be significantly faster to boot on large projects.- ๐จ
yarn workspaces foreach --verbose
will now print when processes start and end, even if they don't have an output. yarn patch-commit
can now be used as many times as you want on the same patch folder.- ๐จ
yarn patch-commit
now support a new-s,--save
flag which will save the patch instead of just printing it. - โฌ๏ธ
yarn up
now support a new-R,--recursive
flag which will upgrade the specified package, regardless where it is. - ๐ง
yarn config unset
is a new command that will remove a setting from the local configuration (or home if-H
is set).
Compatibility
- 0๏ธโฃ Running
yarn install
inside a Yarn v1 project will now automatically enable thenode-modules
linker. This should solve most of the problems people have had in their migrations. We still recommend to keep the default PnP for new projects, but the choice is yours. - ๐ The patched filesystem now supports file URLs,
bigint
, andfstat
. - ๐ An official ESBuild resolver is now provided under the name
@yarnpkg/esbuild-plugin-pnp
. We use it to bundle Yarn itself! - ๐ฆ PnP projects can now use the Node
exports
field - regardless of the Node version. - ๐ง The Prettier SDK does not use PnPify anymore since it was its only remaining use, and was fairly invasive; as a result, the Prettier plugins must be specified in Prettier's
plugins
configuration property. - โ Builtin patches that fail to apply will no longer cause an error (they'll emit a warning and the original sources will be used instead).
- Remember that patches are a problem for our team too, and that we only do this because we don't have any other option available to us right now - if you wish to help, consider upvoting the relevant pull request in the TypeScript repository or, if you work at Microsoft, perhaps mention to your TypeScript team next door that fixing this would benefit you.
Miscellaneous
- Reporting for HTTP errors has been improved, which should help you investigate registry issues.