Closed thegreatercurve closed 2 weeks ago
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 1, 2024 8:41pm |
lexical-playground | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | May 1, 2024 8:41pm |
Path | Size | Loading time (3g) | Running time (snapdragon) | Total time |
---|---|---|---|---|
packages/lexical/dist/Lexical.js | 23.69 KB (0%) | 474 ms (0%) | 494 ms (+34.45% 🔺) | 968 ms |
packages/lexical-rich-text/dist/LexicalRichText.js | 33.99 KB (+0.23% 🔺) | 680 ms (+0.23% 🔺) | 1.3 s (+22.31% 🔺) | 2 s |
packages/lexical-plain-text/dist/LexicalPlainText.js | 33.95 KB (+0.16% 🔺) | 679 ms (+0.16% 🔺) | 1.1 s (-17.01% 🔽) | 1.8 s |
We should probably have an invariant rather than just clamping, so we can more easily find any bad code that causes this condition.
Closing in favour of https://github.com/facebook/lexical/pull/6003
Description
Since #5070, there are certain circumstances in which the document counts for
rootElementsRegistered
can fall below 0, especially ifremoveRootElementEvents
is called more thanaddRemoveRootElementEvents
.As number of registered root elements should never be fewer than 1 after
addRemoveRootElementEvents
is called, and because the number of root elements should never be fewer than 0 whenremoveRootElementEvents
is called, we should clamp these values.