Upgrade Lexical to 0.48 and modernize editor internals#950
Merged
Conversation
Move the complete Lexical graph in lockstep while preserving the package's React, Markdown, and browser contracts. Add real-browser, packed-consumer, and cross-version gates so later feature and architecture changes remain attributable and reversible.
Clip the active editor selection through Lexical's registered node graph, then reuse MDXEditor's existing MDAST visitors and options. This keeps custom constructs and nested editors selection-scoped without mutating full-document state.
Use active-editor Lexical positions as the mutation authority while retaining DOM ranges as public highlight projections. Keep replacement coherent across formatting and editor scopes, with isolated table history and deterministic one-step undo.
Move root, recursive nested, and table editors onto one disposable extension factory while preserving Gurx plugins, visitors, React composer children, and command-based history behavior. Keep Realm setup commit-owned and bridge the initial public ref with ordered, stale-safe method replay.
Capture the changelog assessment, PR #949 analysis, bounded child PRPs, spikes, execution notes, and independently verified evidence. Preserve the decision to keep the public MDAST visitor pipeline authoritative and leave lexical/mdast for a separate initiative.
Make AGENTS.md the canonical tool-neutral guide and retain Claude Code discovery through a relative symlink. Document that native Playwright browsers need elevated launch permission under Codex on macOS so launch-time OS crashes are avoided.
|
🎉 This PR is included in version 4.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This was referenced Jul 19, 2026
Contributor
|
Hi @petyosi , testing the markdown selection as you requested in #949 . I tested with the "Get Selection Markdown" example, here are my comments.
I also tested within my organization's project, and did not find any additional bugs there. And I don't need source/diff for my use-case, so this is fine by me 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Why
The editor had remained on Lexical 0.35 while upstream changed package exports, node contracts, selection behavior, history plumbing, and introduced the extension framework. This updates the dependency boundary without asking consumers to adopt Lexical extensions or replacing MDXEditor's public Markdown visitor architecture.
The work also integrates two useful capabilities made practical by the upgrade: accurate active-selection Markdown export and state-backed search replacement.
@lexical/mdastremains intentionally out of scope because its experimental extension-only model is not a self-contained replacement for MDXEditor's consumer-extensible MDAST pipeline.Compatibility notes
HorizontalRuleExtensionis tracked as separate follow-up workrealmPluginlifecycle, Markdown visitors/options, composer children, and MDXEditor imperative methods remain source-compatibleValidation
npm run lintnpm run typechecknpm run test:once— 78 passed, 1 skipped, 1 todo after post-review hardeningnpm run buildCX-6scenarios across Chromium, Firefox, and WebKitCX-7scenarios across all three enginesThe implementation roadmap and verification records are included under
plans/.