-
-
Notifications
You must be signed in to change notification settings - Fork 222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
!!! FEATURE: NodeTypeManager
remove NodeType fallback handling
#4466
Conversation
…andling trait Also remove access on NodeType::getName()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
THANK YOU SO MUCH for this quick implementation.
I did a full visual review - it was a little harder because you also adjusted more code to use the NodeTypeNameFactory
and avoid now magic strings like 'Neos.Neos:Document'
but thank you for that as well.
I have a few points to discuss left - but overall i approve mostly already ;)
Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/NodeFactory.php
Outdated
Show resolved
Hide resolved
Neos.ContentRepository.Core/Classes/Projection/ContentGraph/Node.php
Outdated
Show resolved
Hide resolved
Neos.ContentRepository.StructureAdjustment/src/Adjustment/LoadNodeTypeTrait.php
Outdated
Show resolved
Hide resolved
....ContentRepositoryRegistry/Classes/Factory/NodeTypeManager/DefaultNodeTypeManagerFactory.php
Show resolved
Hide resolved
Neos.ContentRepositoryRegistry/Classes/Command/ContentCommandController.php
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me by reading! Thank you
Neos.ContentRepositoryRegistry/Classes/Utility/ContentRepositoryRegistryProvider.php
Outdated
Show resolved
Hide resolved
…rotected var pattern in trait Introducing the pattern with the additional `ContentRepositoryRegistryProvider` makes things just more complex and less obvious. While not perfectly "clean" we instead import in the `NodeTypeWithFallbackProvider` trait the `ContentRepositoryRegistry` via $_contentRepositoryRegistry. This pattern is already used across the codebase.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adjusting to the feedback from the weekly.
But i think we misunderstood each other about the traits.
With 364a230 you added the ContentRepositoryRegistryProvider
and i think you wanted to implement bastians suggestion, but this would require an abstract method getContentRepositoryById
.
Instead i propose to delay this discussion - or do nothing fancy here at all and just import the ContentRepositoryRegistry
directly in the NodeTypeWithFallbackProvider
as prefixed variable.
This pattern - while not especially pretty - has already been used across the codebase and we might just as well do it here too before blocking this pr any longer with this discussion.
Edit: i just found out that phpstan will perfectly analyze the traits, so we only have to use the property in the trait and declare it at another place: https://phpstan.org/blog/how-phpstan-analyses-traits
I implemented the suggestion here - feel free to merge it into this pr: :D
#4559
…yRegistry` but declare that property must exist phpstan will catch invalid use of this trait
TASK: Review of "Node type fallback handling"
NodeTypeManager
remove NodeType fallback handling
I think we’ll need a NodeType for node helper for eel aswell? im not sure how we handle Those questions need to be answered so that our users now what to expect and we know when to deprecate/remove it. |
!!! TASK: Remove `NodeType::getName()` and replace usages
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes a lot of sense to me, I just wonder about the changed linter rules
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In combination with neos/neos-ui#3632 the neos ui e2e tests succeed locally
This moves node type fallback handling from the CR to the outer applications, e.g. Neos.
!!! Nodes now have an optional node type which is null if the NodeTypeName is not known to the NodeTypeManager.
Neos has been adjusted to
For 3rd party applications relying on fallback NodeTypes, there now is the
Neos\Neos\Utility\NodeTypeWithFallbackProvider trait
availableRelated: #4447
Checklist
FEATURE|TASK|BUGFIX
!!!
and have upgrade-instructions