Repository navigation
[lexical] Modernize Flow type-stub syntax rejected by fb-www flow strict - #8742
Merged
Merged
Conversation
potatowagon
requested review from
acywatson,
etrepum,
fantactuka,
ivailop7 and
zurfyx
as code owners
June 24, 2026 06:32
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
etrepum
approved these changes
Jun 24, 2026
Merged
This branch was successfully deployed
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.
Description
Three OSS Flow type-stub (
.js.flow) files contain a few stragglers using older Flow syntax (and one lib-dependent type) that fb-www@flow strictrejects — this is what breaksflow-checkon the www Lexical sync. The rest of these same files already use the modern equivalents (readonly/unknown/extends), so this just makes the recent additions (mostly from #8694 shadow-root work) consistent with the prevailing style. Mirrors internal www fix D109526234.Changes
1)
packages/lexical/flow/Lexical.js.flowStaticRangedeclared shape: property variance sigils (+) →readonlyisDOMShadowRoot(node: mixed)→node: unknown$insertNodeToNearestRootAtCaret<T: LexicalNode>→<T extends LexicalNode>2)
packages/lexical-link/flow/LexicalLink.js.flow(affects bothregisterClickableLinkoverloads)type AddEventListenerOptions = Exclude<EventListenerOptionsOrUseCapture, boolean>;eventOptions?: Pick<AddEventListenerOptions, 'signal'>→eventOptions?: {signal?: AbortSignal, ...}Pickchain resolves through a DOM lib union that includes the primitiveboolean, which fb-www flow can'tPick; the inline object is portable and equivalent.3)
packages/lexical-react/flow/useLexicalSlotRef.js.flowuseLexicalSlotRef<T: HTMLElement = HTMLElement>→<T extends HTMLElement = HTMLElement>Notes
.js.flowtype stubs only — no runtime/source code changes.flow/subdirectory of each package (the request listed them without theflow/segment; corrected here).