-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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]: React renderer is causing update for each nodeview when unique-id extension is used #4695
Comments
This is relevant here too: #4492 I've prepared an awfully over-engineered solution that is able to preserve 100% of the current behaviour(as far as I can tell) of Though, I am not sure whether this is needed. I feel like better solution would be to batch those updates somewhere upstream, perhaps directly before or after applying new state to the editor view? I tried playing with it, but I lack expertise here and I am not sure if it wouldn't require changes at ProseMirror's Check this out bartlomiej-korpus#1 I can confirm this works and doesn't have a performance penalty of previous solution while working correctly with Lets discuss how to make it better from here |
Dumb question but does this problem go away if the unique id set on storage instead of as an attribute? At least in my case, I only want the id to pass to other non-tiptap components. Although, storage doesn't work with TipTap cloud, if I understand correctly. |
Storage is only per plugin, not per node instance, right? I'm not sure how that would work, but I'm also not very experienced with both PM and TipTap. By the way
This part here is not exactly right, document with 400 react-rendered node views will see 160_000 rerenders during unique-id My fix has still one outstanding issue which I'm going to resolve this week |
This will be resolved by #5273 |
This is now resolved with 2.6.0 |
Which packages did you experience the bug in?
react, extension/unique-id
What Tiptap version are you using?
2.1.13
What’s the bug you are facing?
This issue was reported on our Discord by Bartlomiej.
https://discord.com/channels/818568566479257641/818569721934774272/1184601997912068167
Basically because the node view renderer will cause a new transaction when it's attributes change and the unique-id extension will add ids to all nodes that don't have one will cause tons of rerenders on all nodes because we flushSync inbetween each update.
I think Bartlomiej already worked on a fix for this as discussed in this message:
https://discord.com/channels/818568566479257641/818569721934774272/1184609761061257236
I'll ask him to open a PR for this issue if his fix is working.
What browser are you using?
Chrome
Code example
No response
What did you expect to happen?
Don't cause 400 rerenders because of 400 node views.
Anything to add? (optional)
No response
Did you update your dependencies?
Are you sponsoring us?
The text was updated successfully, but these errors were encountered: