Upgrading Lexical
Lexical is still 0.x, so breaking changes ship in minor releases
(0.52.0 to 0.53.0). All packages are released together at one version.
Upgrade every package at once. Bump lexical and every @lexical/*
package you use to the same version in one step. Each @lexical/* release
depends on the matching lexical version, and an app must resolve exactly
one copy of each package; see One Lexical per app.
Read the changelog between your version and the target.
CHANGELOG.md
lists every release. From v0.23.0 on, each version starts with its breaking
changes and deprecations: every breaking change has a Migration
paragraph with what to change, often with before and after code, plus
Detect hints for finding affected code, and a Verify line when the
change only shows at runtime. Apply the entries of every version after yours
up to and including the target, oldest first. Versions before v0.23.0 only
list their commits. The same file ships in the lexical package, so an app
can read it at node_modules/lexical/CHANGELOG.md, offline and from coding
agents.
To print only what applies to your upgrade, run this in a clone of the repository:
pnpm run changelog:range -- --from 0.40.0 --to 0.52.0 --breaking
Leave out --breaking to include fixes and features, add --json for
output that tools can consume, and pass
--changelog /path/to/app/node_modules/lexical/CHANGELOG.md to read an app's
installed copy. Deprecated APIs keep working until they are
removed in a later breaking change; each deprecation names its replacement,
so moving off them while you upgrade avoids work later.