Changelog History
Page 2
-
v3.0.0-rc.2 Changes
yarn set version 3.0.0-rc.2
Few functional changes; mostly intended to fix distribution issues.
- ๐
yarn plugin import
can now install specific versions of the official plugins. - 0๏ธโฃ
yarn plugin import
will now download plugins compatible with the current CLI by default. - ๐ Fixed a bug in
yarn version check
when used with the--prerelease
flag.
- ๐
-
v3.0.0-rc.1 Changes
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.
-
v2.4.3 Changes
yarn set version 2.4.3
- โก๏ธ Updated TypeScript patch to cover TypeScript 4.4.
-
v2.4.2 Changes
yarn set version 2.4.2
- โก๏ธ Updated TypeScript patch to cover TypeScript 4.3.
-
v2.4.1 Changes
yarn set version 2.4.1
Compatibility
- ๐ The release of TypeScript 4.2 couldn't be installed due to patch conflicts. This is now fixed. This version only includes a fix specific to 4.2, but future Yarn releases starting from 3.0 will be more tolerant of this kind of situation and won't cause such errors.
-
v2.4.0 Changes
yarn set version 2.4.0
Installs
๐ The resolution pipeline got reimplemented. We previously used a multi-pass approach where we performed SAT optimization between each pass, but after investigating it turned out the SAT optims had little impact and added performance bottlenecks. We now run the resolution using a much simpler and more efficient algorithm.
๐ Linkers can now define custom data to cache between Yarn invocations. The builtin linkers new use those new capabilities to cache package information that can't change between runs. In practice, this translates into much faster recurrent installs (when running an install that adds few new packages, if any).
๐ฆ Warnings are now reported when
packageExtensions
rules are either unused or redundant with the original package definition.Potentially breaking, but it was intended this way from the start: the
packageExtensions
field cannot be used to replace dependencies anymore (only to add missing ones). Prefer using theresolutions
field to replace existing ones.๐ Progress bars are rendered less often, which should help performances on some terminals.
๐ฆ Aliased packages no longer include themselves in node_modules installs
CLI
โฌ๏ธ The
upgrade-interactive
command will now only show upgrade suggestions for packages that have available upgrades (rather than all of them).โฌ๏ธ The
upgrade-interactive
command has received UI improvements that should make it easier to look at.The
yarn workspaces focus
command will now only run thepostinstall
scripts for the focused workspaces.A new
yarn npm audit
command lets you query audit information from the npm registry.The
yarn workspaces foreach
command has a new flag,-R,--recursive
, which will run a command on the current workspace and all others it depends on.๐ A new
--skip-builds
option onyarn install
will let you skip the build scripts without impacting the generated Yarn artifacts (contrary toenableScripts
, which would also stop unplugging the packages that would otherwise be unplugged due to containing build scripts).
Binaries
It's now possible to run dependency binaries when using the node-modules linker even if one of your other dependencies is reported as incompatible with your system.
โก๏ธ By default Windows automatically requests for administrator rights before spawning any binary whose filename contains "install", "setup", "update", or "patch" (it thinks they are installers). We now explicitly opt-out of this behavior in the binary jumpers we use on Windows.
๐ By default, arguments passed to MinGW-compiled programs are automatically expanded by a basic glob pattern engine. We now explicitly opt-out of this behavior in the binary jumpers we use on Windows.
๐ The Windows binary jumpers will now report the right exit code.
Settings
Using empty fallbacks in Yarnrc environment variables (
${VAR:-}
) will now work.๐ You can now use the new
logFilters
setting to turn warnings into either errors or info, or to hide them entirely. Note that we plan to significantly improve the peer dependency warnings in the next release, so perhaps don't silence them just now even if you have a bunch of them.
Shell
- ๐ Some shell errors (
No matches found
,Bad file descriptor
,Unbound variable
,Unbound argument
) will now be recoverable errors that make the shell continue on to the next command in the chain instead of hard crashes. Fixes cases such asrm -rf ./inexistentFolder/* || true
.
VSCode ZipFS Extension
- The extension will now activate even if the workspace doesn't contain zip files (usually because you excluded them).
Compatibility
๐ Some patches went missing for TypeScript <4. This is now fixed.
Calling
fs.exists(undefined)
won't crash anymore.TypeScript import suggestions should now be correct even when the imported module is deep within a workspace.
TypeScript in watch mode (both using
-w
and within VSCode) will now detect new dependencies as you add them.๐ Some particular multi-dependency-trees setups will be better supported on Plug'n'Play installs.
โก๏ธ Using
ctrl+click
on imports in VSCode won't take you to virtual packages anymore (require an SDK update).
-
v2.3.1 Changes
yarn set version 2.3.1
CLI
- 0๏ธโฃ Take into account peer dependency defaults when inheriting workspace peer dependencies in the node_modules linker
-
v2.3.0 Changes
yarn set version 2.3.0
CLI
- The
yarn tag
set of commands has been ported over from Yarn Classic asyarn npm tag
. - ๐ฆ Running
yarn info
will now print many information about your dependencies. Various options are available to tweak the output, including--json
. Plugin authors can provide their own information sections via thefetchPackageInfo
hook. - ๐ Running
yarn stage
with the-r,--reset
flag will now unstage all changes that seem related to Yarn. - ๐ All commands now document each of their options (run
yarn add -h
to see an example). - Publish registry errors will now be reported as is rather than being collapsed into a generic error message.
- ๐ A native binary jumper will now be used on Windows to avoid the
Terminate batch job (Y/N)?
prompts when invoking dependency binaries.
Installs
PnP API
0๏ธโฃ The following changes only apply to the
pnp
linker (which is the default install strategy):- The
pnpapi
module now exposes a new function calledgetAllLocators
allow you to access the list of all locators in the map without having to traverse the dependency tree. This method is considered a Yarn extension, so you should check for its existence if you plan to use it in your code. - ๐ฆ When using a portal to a package that had peer dependencies, Yarn would loose the information required to resolve those peer dependencies. It will now properly resolve them the same way as all other packages in the dependency tree.
The following changes only apply to the
node-modules
linker:- ๐ The bin symlinks will now be properly removed from the
node_modules/.bin
folder as their corresponding dependencies are removed. - A new setting called
nmHoistingLimits
has appeared. It replaces what was previously known asnohoist
in Yarn 1. - ๐ฆ We are now more forgiving for packages that make incorrect assumptions about the hoisting layout by first trying to maximize package exposure at the top-level. Only after the top-level has been populated will we deduplicate the remaining packages.
- ๐ Fixed some pathological cases around peer dependencies. In particular, workspaces' peer dependencies will now be resolved against their closest workspace ancestor (according to the directory hierarchy) rather than be ignored. Note that peer dependencies are inherently problematic with workspaces when using the
node-modules
linker, and that the strictly correct behavior can only be obtained by using the default Plug'n'Play linker. - โ Running install after an interrupted install is supported now and will result in a consistent install state
Shell
- โ Added support for
$$
and$PPID
- ๐ Fixes some pathological globbing problems.
๐ Bugfixes
- The
yarn constraints --fix
command will now properly persist the changes on disk. - ๐ฆ The
yarn unplug
command will now work when used on packages with peer dependencies. - The
yarn stage
command will now allow to stage files when called without the-c,--commit
flag. - ๐ Fixes a performance regression when using FSEvents.
Miscellaneous
- โ Removes extraneous subprocesses when using the
yarnPath
setting.
Third-party integrations
- โก๏ธ Updated the VSCode SDK to take into account changes in the TypeScript server protocol.
- โ Added a few builtin extensions to improve compatibility with packages that weren't correctly listing their dependencies.
- โก๏ธ Updatedd the TypeScript patch to cover TypeScript 4.1.
- The
-
v2.2.0 Changes
yarn set version 2.2.0
Ecosystem
- ๐ Packages can now use the
publishConfig.executableFiles
field in their manifests to indicate which files should keep the executable flag once packed in the archive. This is important as for portability reasons Yarn strips the executable flag from all files during packing (otherwiseyarn pack
would yield different outputs when run on Posix vs Windows). Files listed in thebin
field are assumed executable by default, so you don't need to explicitly list them inexecutableFiles
.
๐ Bugfixes
- โฑ Requests won't timeout anymore as long as the server is still sending data.
yarn pack
will properly include main/module/bin files, even when not explicitly referenced through thefiles
field.- Local git repositories can now be fetched via the
git+file:
protocol. - ๐ The progress bars will be properly styled when using the new Windows terminal on certain days.
- ๐ Yarn will now avoid using deprecated versions of the dependencies, unless only deprecated versions are available for the requested ranges.
- ๐ Build keys are now properly computed, which fixes issues where build scripts weren't always triggered when they should have been.
- Negated glob patterns in the
workspace
field will now be processed correctly. - Yarn will now allow relative paths inside the
workspace:
protocol to start with./
- Yarn will now show the actual error when it fails to resolve a request during
yarn add
andyarn up
- ๐ The portable shell will now support calling
cd
andexit
without arguments - Yarn will now show the exit code when a lifecycle script fails
- Yarn's portable shell will now also pipe the stderr when using the
|&
pipeline - Yarn's portable shell will now respect the left associativity of list operators
CLI
- Yarn will now report an error when run through an incompatible Node version.
- ๐ง
yarn add
andyarn up
will now respect thepreferInteractive
configuration option. - โก๏ธ
yarn config set
now supports the-H,--home
flag, which causes it to update the home configuration instead of the project configuration.
๐ง Configuration
- ๐ง The settings found in the home configuration file won't cause exceptions when consumed by older Yarn versions. Unsupported options will simply be silently ignored. This should improve the user experience when working with multiple projects configured with different Yarn versions.
- ๐ A new
immutablePaths
setting allow you to specify paths that must not change when running Yarn with the--immutable
flag set. You can use it to detect unforeseen changes to your install artifacts, be it.pnp.js
ornode_modules
files.
Miscellaneous
- Scripts can now use the
$RANDOM
variable as well as simple calculations using+
,-
,*
,/
and()
inside$(())
- Scripts can now use grouping curly braces (
{echo foo}
) to execute a command in the context of the current shell (without creating a subshell like in the case of(echo foo)
). - Scripts can now end with a semicolon.
- ๐ PnP linker will not remove lingering node_modules inside folders matching
pnpIgnorePatterns
Third-party integrations
- ๐ป The PnP hook will now display clearer error message when requiring Node builtins from contexts that can't access them out of the box (for example when accessing the
fs
module from within a Webpack browser bundle).
- ๐ Packages can now use the
-
v2.1.1 Changes
yarn set version 2.1.1
- ๐ Fixed hyperlink rendering on iTerm