The current implementation of the field plugin library manages three states:
Visual Editor
Library (in createFieldPlugin)
Library hook (in useFieldPlugin)
This is a proof of concept of how the library could look like if we removed the library's state and only kept the state in
Visual Editor
Library hook
This has the benefit of only having to maintain two states.
The problem is as whereas the library syncs the state between the visual editor and the library, this approach moves this responsibility to the hook. Because there is one hook for each framework, this means that we now need to implement the syncing logic once for each framework, instead of once for the library.
❗ Work in progress
The current implementation of the field plugin library manages three states:
createFieldPlugin
)useFieldPlugin
)This is a proof of concept of how the library could look like if we removed the library's state and only kept the state in
This has the benefit of only having to maintain two states.
The problem is as whereas the library syncs the state between the visual editor and the library, this approach moves this responsibility to the hook. Because there is one hook for each framework, this means that we now need to implement the syncing logic once for each framework, instead of once for the library.
What?
Why?
JIRA: EXT-
How to test? (optional)