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

[0.8] feat: set the update tag from yjs based on the origin #3608

Merged

Conversation

husseinraoouf
Copy link
Contributor

This PR makes the updates tags for updates coming from yjs change based on origin, so if the changes came from UndoManger the tag is set to collaboration-history and if the updates came from other places like websocket the tag is set to collaboration,

this is to be able to know which updates came from the user's interaction and which updates came from other users through yjs

@vercel
Copy link

vercel bot commented Dec 21, 2022

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

Name Status Preview Comments Updated
lexical ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Jan 4, 2023 at 1:58PM (UTC)
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Jan 4, 2023 at 1:58PM (UTC)

@facebook-github-bot
Copy link
Contributor

Hi @husseinraoouf!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@fantactuka
Copy link
Contributor

fantactuka commented Dec 21, 2022

I'd call it historic to allow plugins to rely on the same tag for both collab and non-collab cases, and it should go as a part of release (0.8) as it's a breaking change.

It would also require adjustments for syncLexicalUpdateToYjs that checks for tag

@husseinraoouf
Copy link
Contributor Author

husseinraoouf commented Dec 21, 2022

@fantactuka Makes sense I will update the pr

it should go as a part of release (0.8) as it's a breaking change.

Can I ask What is the expected release date for 0.8

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@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 21, 2022
@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@husseinraoouf
Copy link
Contributor Author

husseinraoouf commented Dec 21, 2022

@fantactuka @trueadm I updated the pr with the requested changes, thank you for the review

@acywatson
Copy link
Contributor

Can I ask What is the expected release date for 0.8

Theres's no specific release date for 0.8, but we can do it in the next few days probably.

@ivailop7
Copy link
Collaborator

ivailop7 commented Jan 3, 2023

Hey @acywatson any outlook on merging this one in soon?

@acywatson
Copy link
Contributor

Hey @acywatson any outlook on merging this one in soon?

It needs to pass the integrity check first - looks like a prettier error

@@ -234,7 +235,7 @@ export function syncLexicalUpdateToYjs(
// types a character and we get it, we don't want to then insert
// the same character again. The exception to this heuristic is
// when we need to handle normalization merge conflicts.
if (tags.has('collaboration')) {
if (tags.has('collaboration') || tags.has('historic')) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to do this part in order to accomplish the goal set out in the PR description? This seems like a behavioral change for the core, whereas I thought this PR was just trying to pass through the tags.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@acywatson I thought i should handle both tags here because now the changes that come from the collaboration plugin could come with either of those two tags but if you want i can revert that

@trueadm trueadm changed the title feat: set the update tag from yjs based on the origin [0.8] feat: set the update tag from yjs based on the origin Jan 24, 2023
@trueadm trueadm merged commit 77d46bf into facebook:main Feb 9, 2023
@thegreatercurve thegreatercurve mentioned this pull request Feb 9, 2023
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.

6 participants