awcodes / filament-tiptap-editor

A Rich Text Editor plugin for Filament Forms.
MIT License
261 stars 71 forks source link

Editor very slow with code blocks inside #430

Closed AntoineCrzt closed 3 weeks ago

AntoineCrzt commented 1 month ago

Filament Version

3.4.3

Plugin Version

3.2.92

PHP Version

8.2.20 (also tested on PHP 8.3.7)

Problem description

After writing one or multiple code blocks inside the editor, it becomes very slow. I cannot even continue writing on it ; the characters I type on my keyboard appear with too much delay and it completely shuffles the letters. I have here the profile extracted from Firefox Developer Edition : https://share.firefox.dev/45UswcZ At 6'80sec, it is when I start typing new text in my editor containing already a few lines and 2 blocks of code. Tested on Safari / Mozilla Firefox / Chromium

Expected behavior

Just have the editor still working even with 100 blocks of code if needed :D

Steps to reproduce

Reproduction repository

https://github.com/AntoineCrzt/issue-slowness-tiptap-filament

Relevant log output

https://share.firefox.dev/45UswcZ
awcodes commented 1 month ago

hmm. I'll get the occasional lag in your repro, but nothing longer than a like 200ms. My best guess is an issue in Tiptap. They just release 2.5 a few days ago that is suppose to address performance issues. I will update the dependency as soon as I can, hopefully that will resolved the issue.

AntoineCrzt commented 1 month ago

Hi @awcodes, thanks for your feedback. I'm having a lag a lot longer than 200ms as you can see in the Firefox report. I've just tried on another computer, and it's true the lag is not as long, but still present. Weird issue.

Anyway, thanks for letting me know that it's likely to be a Tiptap issue. I'm looking forward to this new version then. I will keep you updated.

awcodes commented 3 weeks ago

I've just released v3.4.7 which builds against Tiptap v2.5. Hope that helps. Not sure if there's really anything else I can do about it at the moment.