facebook / lexical

Lexical is an extensible text editor framework that provides excellent reliability, accessibility and performance.
https://lexical.dev
MIT License
19.95k stars 1.7k forks source link

Feature: Deprecate $nodesOfType #6847

Closed etrepum closed 14 hours ago

etrepum commented 3 days ago

Description

The $nodesOfType function is no longer used internally, and does not support node overrides. Generally it was used to work around registerMutationListener not having an initialization phase, but that changed in #6357, so it's no longer useful and generally just causes bugs.

This function should be marked @deprecated with a comment that tells them to use registerMutationListener instead, or to remove their explicit legacy initialization for a mutation listener.

Impact

Using this function causes bugs in apps that use node overrides, we should discourage its use and eventually remove it.

CaioSilvaUT commented 2 days ago

Hello, I'm a student from UTFPR in Brazil, and I'm taking a class where I need to contribute to open source issues. I would like to know if I can take on this issue to work on.

etrepum commented 2 days ago

Sure, go ahead