Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[lexical] Bug Fix: Flow is missing some variables and functions #6977

Merged
merged 2 commits into from
Dec 26, 2024

Conversation

lytion
Copy link
Contributor

@lytion lytion commented Dec 18, 2024

Description

Some variables and function are missing in flow file.

Here are classes affected:

  • EditorThemeClasses
  • BaseSelection
  • NodeSelection
  • RangeSelection
  • DOMConversionFn

This is the following of #6866

- EditorThemeClasses
- BaseSelection
- NodeSelection
- RangeSelection
@facebook-github-bot facebook-github-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 Dec 18, 2024
Copy link

vercel bot commented Dec 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lexical ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 19, 2024 2:51pm
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 19, 2024 2:51pm

Copy link

github-actions bot commented Dec 18, 2024

size-limit report 📦

Path Size
lexical - cjs 31.29 KB (0%)
lexical - esm 31.11 KB (0%)
@lexical/rich-text - cjs 40.34 KB (0%)
@lexical/rich-text - esm 33.04 KB (0%)
@lexical/plain-text - cjs 38.88 KB (0%)
@lexical/plain-text - esm 30.3 KB (0%)
@lexical/react - cjs 42.12 KB (0%)
@lexical/react - esm 34.29 KB (0%)

Comment on lines +476 to +477
isBackward(): boolean;
isCollapsed(): boolean;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it useful to add this here, when it already declares that BaseSelection is implemented?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If I remove those 2 declarations, npm run ci-check return this error

Cannot implement BaseSelection [1] with NodeSelection because property isCollapsed is missing in NodeSelection [2] but exists in BaseSelection [1]. [prop-missing]

@@ -530,6 +538,8 @@ declare export class RangeSelection implements BaseSelection {
insertNodes(nodes: Array<LexicalNode>): void;
getCachedNodes(): null | Array<LexicalNode>;
setCachedNodes(nodes: null | Array<LexicalNode>): void;
forwardDeletion(anchor: PointType, anchorNode: ElementNode | TextNode, isBackward: boolean): boolean;
getStartEndPoints(): null | [PointType, PointType];
Copy link
Collaborator

Choose a reason for hiding this comment

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

This also looks to be the same as BaseSelection

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same as the other comment, if I remove those 2 declarations, npm run ci-check return this error

Cannot implement BaseSelection [1] with RangeSelection because property getStartEndPoints is missing in
RangeSelection [2] but exists in BaseSelection [1]. [prop-missing]

dirty: boolean;
clone(): BaseSelection;
Copy link
Contributor

Choose a reason for hiding this comment

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

curious about the use cases outside of meta for these added api

just a nit, rearranging clone to be after dirty would break the unenforced abc sorting for props

other then that lgtm

@potatowagon potatowagon added this pull request to the merge queue Dec 26, 2024
Merged via the queue into facebook:main with commit 05ddbcc Dec 26, 2024
45 of 46 checks passed
@Husain5796

This comment was marked as spam.

@lytion lytion deleted the fix-missing-var-flow branch December 27, 2024 08:48
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants