Skip to content

Commit 2b8bb5b

Browse files
potatowagonpotatowagon
andauthored
[*] Chore: require all changes to be backwards compatible (facebook#8634)
Co-authored-by: potatowagon <potatowagon@users.noreply.github.com> Co-authored-by: potatowagon <potatowagon@devvm17254.pnb0.facebook.com>
1 parent 8cb382d commit 2b8bb5b

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

AGENTS.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,16 @@ This codebase uses **both TypeScript and Flow**:
163163

164164
When adding/modifying APIs, types must be maintained for both systems.
165165

166+
## Backwards Compatibility
167+
168+
**All changes MUST be backwards compatible.** Lexical is a widely-adopted OSS library, and breaking changes ripple out to every downstream consumer.
169+
170+
- Do NOT remove or rename existing public APIs, exported functions, types, or `$` functions. Add new APIs alongside the old ones instead.
171+
- Do NOT change the signature, return type, or behavior of existing public APIs in ways that could break callers. Prefer additive, optional parameters.
172+
- Preserve the serialization format of `EditorState` and node JSON. Serialized content produced by older versions must continue to deserialize correctly.
173+
- If an API genuinely must change, deprecate the old one first (keep it working, document the replacement) rather than removing it outright.
174+
- When in doubt, assume external code depends on the current behavior and keep it intact.
175+
166176
## Important Development Notes
167177

168178
### Reconciliation and Updates

0 commit comments

Comments
 (0)