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-yjs] Bug Fix: Add missing setLocalStateField method to ProviderAwareness type #6683

Conversation

collierrgbsitisfise
Copy link
Contributor

Description

The current type definition doesn't include the setLocalStateField method, which can lead to TypeScript errors when using this method and prevents proper code completion in IDEs. This change improves type safety and developer experience when working with the lexical-yjs package.

This PR adds the missing setLocalStateField method to the ProviderAwareness type in the lexical-yjs package(ref). This method is present in the actual implementation of awareness providers but was not reflected in the TypeScript type definition.

Test plan

Before

--

After

--

Copy link

vercel bot commented Sep 29, 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 Sep 30, 2024 6:41am
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 30, 2024 6:41am

@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 Sep 29, 2024
Copy link

github-actions bot commented Sep 29, 2024

size-limit report 📦

Path Size
lexical - cjs 29.82 KB (0%)
lexical - esm 29.67 KB (0%)
@lexical/rich-text - cjs 38.42 KB (0%)
@lexical/rich-text - esm 31.51 KB (0%)
@lexical/plain-text - cjs 37.01 KB (0%)
@lexical/plain-text - esm 28.9 KB (0%)
@lexical/react - cjs 40.17 KB (0%)
@lexical/react - esm 32.97 KB (0%)

Copy link
Collaborator

@etrepum etrepum left a comment

Choose a reason for hiding this comment

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

The tests don't typecheck with this change because it adds a new required property where one wasn't needed before. It's unclear what the utility of this backwards incompatible change would be since this method isn't called anywhere in @lexical/yjs

@collierrgbsitisfise
Copy link
Contributor Author

The tests don't typecheck with this change because it adds a new required property where one wasn't needed before. It's unclear what the utility of this backwards incompatible change would be since this method isn't called anywhere in @lexical/yjs

Updated tests as well according new awareness contract. Nothing functional to test, so i replaced functional implementation with // TODO placeholder by analogy with on/off methods

Copy link
Collaborator

@ivailop7 ivailop7 left a comment

Choose a reason for hiding this comment

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

LGTM

@etrepum etrepum added this pull request to the merge queue Sep 30, 2024
Merged via the queue into facebook:main with commit fd44490 Sep 30, 2024
44 checks passed
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.

4 participants