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

Event delegation for NoteEventPlugin #4424

Merged
merged 1 commit into from
May 6, 2023
Merged

Event delegation for NoteEventPlugin #4424

merged 1 commit into from
May 6, 2023

Conversation

fantactuka
Copy link
Contributor

There's couple of problems with current implementation:

  • It relies on mutation listener that does not run for initial state (only for added nodes)
  • It attaches event to specific node, so for nodes like TableCell or Paragraph it can add hundreds or thousands of listeners for longer documents

This on attempts to add event delegation with special handling for mouseenter/leave events via capturing since those don't bubble

@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 Apr 28, 2023
@vercel
Copy link

vercel bot commented Apr 28, 2023

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 May 5, 2023 8:03pm
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 5, 2023 8:03pm

@fantactuka
Copy link
Contributor Author

@trueadm curious what do you think about it

@github-actions
Copy link

github-actions bot commented Apr 28, 2023

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
packages/lexical/dist/Lexical.js 27.01 KB (0%) 541 ms (0%) 302 ms (+13.86% 🔺) 842 ms
packages/lexical-rich-text/dist/LexicalRichText.js 37.86 KB (0%) 758 ms (0%) 519 ms (+23.92% 🔺) 1.3 s
packages/lexical-plain-text/dist/LexicalPlainText.js 37.83 KB (0%) 757 ms (0%) 209 ms (-50.27% 🔽) 966 ms

@fantactuka fantactuka merged commit 639d636 into main May 6, 2023
This was referenced May 23, 2023
@fantactuka fantactuka deleted the node-events-plugin branch July 6, 2023 20:07
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.

None yet

3 participants