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

Bug: Long text tokens cause the editor to collapse #5287

Closed
moy2010 opened this issue Nov 26, 2023 · 4 comments
Closed

Bug: Long text tokens cause the editor to collapse #5287

moy2010 opened this issue Nov 26, 2023 · 4 comments

Comments

@moy2010
Copy link
Contributor

moy2010 commented Nov 26, 2023

Long text tokens can bring down the editor. This is easy to reproduce in the playground, just paste this: SomeVeryLongTextStartsToLagALot. Or you can type it and you'll see how performance starts degrading until the editor becomes unresponsive.

I'm suspicious of Regex-related plugins such as @lexical/markdown and AutoLinkPlugin, but haven't digged deeper. So far I've only narrowed the issue down to the smallest reproducible example after a few hours of debugging.

Lexical version: Tested in both 0.12.4 and 0.12.2. The issue is present in both versions.

It's also worth mentioning that I discovered the issue after opening a text that I created in june this year, so whatever is causing this issue should be part of a very recent version.

Steps To Reproduce

  1. Type a very long text token (i.e. with no white spaces)
    2.Profit

The current behavior

The editor becomes unresponsive.

The expected behavior

The editor should handle long text tokens.

@ivailop7
Copy link
Collaborator

I replicate the slowness. It's either the insertNodes rewrite or indeed a regex somewhere :/ it's indeed a commit in the past 3 months.

@moy2010
Copy link
Contributor Author

moy2010 commented Nov 26, 2023

@ivailop7, I'm playing with the playground right now and I can reproduce it in the plain-text playground. As for the insertNodes rewrite, I don't think that's the issue since I could replicate it on the version 0.12.2.

@ivailop7
Copy link
Collaborator

Can you try the preview in this PR #5201 , I think this PR restores the performance back.

@moy2010
Copy link
Contributor Author

moy2010 commented Nov 26, 2023

That PR indeed fixes the slowness. Let's wait until it gets merged then 😃 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants