Executable migration guide

Migrate from Lexical to RichTextEditor

Map common configuration and transfer real document content with the package adapter, while keeping unsupported features visible for review.

Install and run
import { migrateConfig, migrateEditor } from
  "@richscripts/richtexteditor/migration";

const plan = migrateConfig("lexical", legacyConfig);
const result = migrateEditor("lexical", legacyEditor, rte);
console.table(result.warnings);

Content handoff

editor.getEditorState().toJSON() is the source API. Common Lexical nodes and text-format bit flags are converted to semantic HTML.

Configuration result

migrateConfig() returns target config, mapped commands, unmapped items and warnings. Review the report before replacing production initialization.

Automated coverage

  • Handles headings, paragraphs, quotes, lists, tables, code, links and inline formatting.
  • Rejects unsafe link protocols and reports their removal.
  • Reports custom nodes while retaining convertible child content.

Manual review remains

  • Registered custom nodes need explicit migration rules.
  • Node transforms, commands and theme classes are behavior—not portable document content.

Acceptance checklist

  1. Run the adapter on repository fixtures and representative production documents.
  2. Review every warning and unmapped toolbar item.
  3. Compare saved HTML—not only rendered appearance.
  4. Rebuild custom commands, uploads, permissions and collaboration data explicitly.
  5. Test undo, paste, keyboard, mobile and assistive-technology workflows before cutover.