tiptap icon indicating copy to clipboard operation
tiptap copied to clipboard

[Bug]: why change isNodeEmpty behavior on a patch version?

Open tdawn0-0 opened this issue 1 year ago • 6 comments

Affected Packages

core

Version(s)

2.5.7

Bug Description

the helper function isNodeEmpty behavior is change on the 2.5.7. this will cause the editor isEmpty return true when the editor is only contain a image content. https://github.com/ueberdosis/tiptap/pull/5393

Browser Used

Chrome

Code Example URL

No response

Expected Behavior

isNodeEmpty behavior as usual on 2.5.x.

Additional Context (Optional)

No response

Dependency Updates

  • [X] Yes, I've updated all my dependencies.

tdawn0-0 avatar Jul 30 '24 01:07 tdawn0-0

Also noticed that due to this change placeholder is now displayed unexpectedly. For example, if paragraph consists of just mentions or emoji nodes the whole paragraph is now considered to be empty.

This is currently reproducible on templates.tiptap.dev.

romansp avatar Jul 30 '24 07:07 romansp

Sorry this was an oversight in the test cases, surprisingly it is not easy to know what is considered "empty"

nperez0111 avatar Jul 30 '24 15:07 nperez0111

Sorry this was an oversight in the test cases, surprisingly it is not easy to know what is considered "empty"

I understand that this is not a simple task. just changing a fundamental function in a patch version should be approached with more caution.

tdawn0-0 avatar Jul 31 '24 00:07 tdawn0-0

I understand that this is not a simple task. just changing a fundamental function in a patch version should be approached with more caution.

Obviously I did not intend to change the behavior of it. Mistakes can happen. Please reconsider berating maintainers of free OSS software.

nperez0111 avatar Jul 31 '24 07:07 nperez0111

We add our own components to the page, which tiptap now considers empty since version 2.5.7. This caused it to sent empty page data to our backend, basically deleting all content of our customers on this page, leading to data loss for these customers.

How can i test the new version works correctly for our usecase?

For example, we define a custom file component: {"type":"fileComponent","attrs":{"fileId":"id","filename":"Test filename"}}

https://tiptap.dev/docs/editor/extensions/custom-extensions/create-new#create-a-node On that page there is no mention that you need to handle a isNodeEmtpy check for custom code.

arendjantetteroo avatar Aug 01 '24 14:08 arendjantetteroo

I understand that this is not a simple task. just changing a fundamental function in a patch version should be approached with more caution.

Obviously I did not intend to change the behavior of it. Mistakes can happen. Please reconsider berating maintainers of free OSS software.

I'm here to discuss a matter. Please accept my apologies if it appeared that I was criticizing you. However, the changes in question are not insignificant.

tdawn0-0 avatar Aug 02 '24 01:08 tdawn0-0

This is now released with v2.5.9

nperez0111 avatar Aug 06 '24 15:08 nperez0111