neos / neos-ui

Neos CMS UI written in ReactJS with Immutable data structures.
GNU General Public License v3.0
265 stars 135 forks source link

AssetEditor pretty much not extensible #2585

Open kitsunet opened 4 years ago

kitsunet commented 4 years ago

Due to the internal structure of the AssetEditor you cannot extend it (compared to eg. the ImageEditor) because the render method calls two sub methods that reset the scope to the original implementation and overwriting those is out of the question because the respectively needed components are not available to the outside. Therefore you are stuck with the default AssetEditor or rewriting a new one from scratch.

dimaip commented 4 years ago

Could you expand a bit more on how you are trying to extend it? Do you mean extending the class? In that case it's definitely not the idiomatic way to do it in JS land. E.g. if we wrote those components today we would not be using classes at all but rather use pure functions + hooks. The way we handled extensibility until now was breaking up things into components (or other things like functions) and putting those components into the registry.

kitsunet commented 4 years ago

Well, I am going with what I have at the moment. I wanted to extend functionality of the media browser and asset search, which means exchanging the secondary editor opener and the asset search endpoint. Currently there is no sensible way of doing that even with extending the class.