Skip to content

Event delegation for NoteEventPlugin - #4424

Merged
fantactuka merged 1 commit into
mainfrom
node-events-plugin
May 6, 2023
Merged

fantactuka merged 1 commit into
mainfrom
node-events-plugin

Conversation

@fantactuka

Copy link
Copy Markdown
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

vercel Bot commented Apr 28, 2023 •

Copy link
Copy Markdown

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
Copy Markdown
Contributor Author

@trueadm curious what do you think about it

@github-actions

github-actions Bot commented Apr 28, 2023 •

Copy link
Copy Markdown

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

This branch was successfully deployed

2 active deployments
Preview – lexical-playground — f5db8da4 Deployed May 5, 2023 by vercel[bot]
Preview – lexical — f5db8da4 Deployed May 5, 2023 by vercel[bot]
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.

3 participants