Skip to content

[*] Chore: require all changes to be backwards compatible#8634

Merged
potatowagon merged 3 commits into
facebook:mainfrom
potatowagon:agents-backwards-compat
Jun 5, 2026
Merged

[*] Chore: require all changes to be backwards compatible#8634
potatowagon merged 3 commits into
facebook:mainfrom
potatowagon:agents-backwards-compat

Conversation

@potatowagon

Copy link
Copy Markdown
Contributor

Description

This PR updates the AI agent guidance docs (AGENTS.md and CLAUDE.md) to make explicit that all changes made to the Lexical codebase must be backwards compatible.

Lexical is a widely-adopted OSS library, so breaking changes ripple out to every downstream consumer. Agents and automated tools working in this repo should know to:

  • Not remove or rename existing public APIs, exported functions, types, or $ functions — add new APIs alongside the old ones.
  • Not change the signature, return type, or behavior of existing public APIs in breaking ways — prefer additive, optional parameters.
  • Preserve the EditorState / node JSON serialization format so older content keeps deserializing.
  • Deprecate rather than delete when an API genuinely must change.

Changes

  • AGENTS.md: new Backwards Compatibility section before "Important Development Notes".
  • CLAUDE.md: a short pointer to the same rule for Claude Code, linking back to AGENTS.md.

Docs-only change — no code or test impact.

Add a Backwards Compatibility section to AGENTS.md (and a pointer in
CLAUDE.md) so AI agents and automated tools working in this repo know
that all changes must preserve existing public APIs, behavior, and the
EditorState/node JSON serialization format.

Lexical is a widely-adopted OSS library, so breaking changes affect every
downstream consumer. Agents should add new APIs alongside old ones and
deprecate rather than remove.
@vercel

vercel Bot commented Jun 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lexical Ready Ready Preview, Comment Jun 5, 2026 9:01am
lexical-playground Ready Ready Preview, Comment Jun 5, 2026 9:01am

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 4, 2026
@potatowagon potatowagon changed the title docs(agents): require all changes to be backwards compatible Jun 4, 2026
Comment thread CLAUDE.md Outdated
Comment on lines +8 to +11

## Backwards Compatibility

**All changes MUST be backwards compatible.** Do not remove or rename existing public APIs, change their signatures/behavior, or break the `EditorState`/node JSON serialization format. Add new APIs alongside old ones and deprecate rather than delete. See the [Backwards Compatibility section in AGENTS.md](./AGENTS.md#backwards-compatibility) for details.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems redundant, if we are worried that claude isn't reading AGENTS.md maybe we should switch this file to a symlink instead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call — done in 25712e5. Replaced CLAUDE.md with a symlink to AGENTS.md (git mode 120000) so there's a single source of truth and the two can't drift. The Backwards Compatibility section lives only in AGENTS.md now.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update: reverted all changes to CLAUDE.md in e1e71f8 — it's now identical to main. This PR now only touches AGENTS.md, so there's no longer any duplication to worry about. (Disregard the earlier symlink commit; it's been backed out.)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Raised the symlink as its own PR so you can evaluate it independently: #8643. It's off main, single-file change (CLAUDE.mdAGENTS.md, mode 120000). I noted the Windows core.symlinks caveat in the description — take it or leave it, no strong opinion from my side. This PR (#8634) stays scoped to just the AGENTS.md backwards-compat doc.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

made this its own PR so it's super easy to revert on its own if the symlink turns out to be finicky : https://github.com/facebook/lexical/pull/8643/changes,

Per review feedback (etrepum): the duplicated Backwards Compatibility
text in CLAUDE.md was redundant. Replace the file with a symlink to
AGENTS.md so Claude Code reads the single source of truth and the two
files can never drift.
Restore CLAUDE.md to its original state on main. The backwards-compat
guidance lives solely in AGENTS.md now; CLAUDE.md is left untouched.
@potatowagon potatowagon added this pull request to the merge queue Jun 5, 2026
Merged via the queue into facebook:main with commit 2b8bb5b Jun 5, 2026
54 checks passed
@etrepum etrepum mentioned this pull request Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

2 participants