-
-
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
!!!TASK: Remove NodeTypeManager from NodeType #4520
!!!TASK: Remove NodeTypeManager from NodeType #4520
Conversation
Disentangle NodeTypeManager from NodeType. This is breaking because it removes API methods. Resolves: neos#4515
Silly me, after removing everything that uses it I forgot to remove the actual dependency.... will push an update to that effect. |
* @param array<string,mixed> $constraints | ||
*/ | ||
public function __construct( | ||
private readonly array $constraints |
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.
Would be neat to have this be a DTO with the constraints configuration.
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.
yes or at lest an example how this looks would be cool ^^
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.
+1 for DTO
Also there seem to be some overlaps with the NodeTypeConstraints
DTO
@kitsunet i did adjust two minor things as discussed in slack in your branch, i hope that was okay ^^ |
Of course, good stuff |
I just realize also @bwaidelich how would we rector this, given that we would need to insure you have a nodeTypeManager available to you? |
Hmmm ... id nearly argue that the few times people from outside use For example there are 0 migrations for anything more complex. Every person with a custom importer / exporter most likely has to rewrite it. Even The rector migrations are mostly currently for simple read operations. So bevor migrating the dilemma |
I would perfectly agree, I thought @bwaidelich saw this as condition for this change? Anyways, will fix the linter problems and then this should be good to go... |
neos/neos-ui#3621 Adaption of UI |
Wait why does my exception class need an internal or api annotation? (see linter error) |
There are similar cases where we add injection code for the CR registry
No, that was a different one (context.inBackend). I'd still love some migrations but only if it's not too much work ofc
@skurfuerst added this rule IIRC so that we explicitly put all core classes into one of the two buckets. I think it's a great idea. |
Right but how I understand it and how I adjusted the code, you would need a CR registry and build the code to get to a CR id from which then you can get the respective NodeTypeManager? If it was just a simple inject for NodeTypeManager sure, that should be doable. |
@kitsunet yes and this is clearly impossible to adjust for every case like: function something(NodeType $nt) {
$nt->getAutoCreatedChildNodes();
} |
Hi ;) I have two little things: just as info:
Im also wondering since the allowsGrandchildNodeType method is gone if this method should stay here in this place? I also noticed once, that the method namings So when we already move the methods around the whole world we might also rename them to fit better? What do you say @skurfuerst maybe that was your intention when writing those "wrapper" methods? |
For migrations from older versions (where there was only a single CR) we just use the
But this is what rector is for, isn't it? |
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.
This is great already, thanks for the effort!
Just a couple of comments after first quick review
@kitsunet just checking: do you still plan to work on this one for the beta1 or shall we try to find someone to take over? (the migration topic can be skipped of course, we can always add it later if we find the time) |
@bwaidelich what do you say about my comment above?
|
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.
Some more inline comments.
And @mhsdesign:
Im also wondering since the allowsGrandchildNodeType method is gone if this method should stay here in this place?
Its also not often used in userland.
I don't really understand which method you refer to and what you suggest to replace it with
And re
I also noticed once, that the method namings allowsGrandchildNodeType and allowsChildNode might not fit anymore our current naming schema
I agree, but "areNodeTypeConstraintsImposedByGrandparentValid" is a mouthful and not also leaves room for interpretation.
Maybe we should look at the using code again and rethink what we want to evaluate in order to find a better name
* @param array<string,mixed> $constraints | ||
*/ | ||
public function __construct( | ||
private readonly array $constraints |
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.
+1 for DTO
Also there seem to be some overlaps with the NodeTypeConstraints
DTO
I am not married to leaving it there, but it is genuinly information the nodetype has, so it felt alright to have it in there, despite everything else being "displaced" now. @bwaidelich I will continue :) But if anyone wants to do something feel free. |
Sorry @bwaidelich I accidentally omitted the key word for understanding my comment
I’m referring to the |
Sooo did you two discuss this further or can we do that this week? |
no lets discuss our big plan for the nodeType/Manager cleanups ^^ i think @bwaidelich continued already a bit with his other pr. |
Collecting some open questions we should deal with and then get this merged:
|
thanks for the summary, my opinion would be
|
I think in that case lets put the renaming in here so it's a single breaking change for those. |
UI change is up to date with the latest changes. |
Thank you so much for adjusting this and fixing the tests ❤️ I assume this is now ready for a final review? |
Yep all ready from my side :) |
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.
Fine by me
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 for taking care and also adjusting the naming to tethered
❤️
I ran the e2e tests locally of the ui and they succeed and also the neos demo runs fine.
Additionally i had a look at your latest rename adjustments and can only approve ;)
FYI: Neos ui part: neos/neos-ui#3642
Hmm im just wondering if we should allow a union here of otherwise one might need to write this, which feels odd doesnt it?
|
…nger !!! TASK: Followup #4520 Introduce `NodeType::tetheredNodeTypeDefinitions`
Disentangle NodeTypeManager from NodeType.
Upgrade instructions
This is breaking because it removes API methods on the NodeType. If you previously used one of:
getAutoCreatedChildNodes
hasAutoCreatedChildNode
getTypeOfAutoCreatedChildNode
allowsGrandchildNodeType
the
NodeTypeManager
can provide replacements:Resolves: #4515
Resolves: #4570