-
-
Notifications
You must be signed in to change notification settings - Fork 135
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: Only load content tree nodes on demand #2927
FEATURE: Only load content tree nodes on demand #2927
Conversation
Only non-rendered nodes are loaded
Failing tests in master seems unrelated as it also fails for the other open PRs. |
Tests are green again :) |
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.
Hi @Sebobo,
I've encountered an issue, though I have not identified a root cause yet.
So, I have a Content NodeType that has two auto-created content collections:
'Vendor.Site:Content.Section':
superTypes:
'Vendor.Site:Content': true
// ...
childNodes:
contents:
type: Neos.Neos:ContentCollection
constraints:
nodeTypes:
'Vendor.Site:Content': true
hidden-contents:
type: Neos.Neos:ContentCollection
constraints:
nodeTypes:
'Vendor.Site:Content': true
The collection contents
is being rendered with content element wrapping, while hidden-contents
is not being rendered at all.
This leads to this behavior:
Before | After |
---|---|
https://user-images.githubusercontent.com/2522299/126901010-2d21160f-4c60-4113-842f-12c68083126a.mp4 |
I'll continue to investigate, but maybe you have an immediate idea what might be causing this :)
Hi @grebaldi thanks for testing. Your example was one of the first issues I encountered after turning off the unrendered nodes rendering and had fixed. And with your nodetype definition and the following Fusion I'm not able to reproduce:
See in my video how it has part of the tree initially retrieved from the content and then it automatically loads the missing second collection: two-child-collections.movSo maybe anything special in your Fusion, that I did differently? And can you check if the initial event for |
Fixed two bugs related to selecting content nodes that are not on the current page. @grebaldi did you have another chance to verify your issue? |
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.
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.
I still saw the issue and debugged a bit.
I could assert that the initial check for childrenAreFullyLoaded
in the watchCurrentDocument
saga wasn't performed recursively - that was the cause for the issue I've seen.
I added a suggestion that should fix it :)
Co-authored-by: Wilhelm Behncke <2522299+grebaldi@users.noreply.github.com>
@grebaldi thx! Can't see a difference, but makes sense :) |
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.
Hi @Sebobo,
I added another suggestion that should fix those eslint complaints that were introduced by my other suggestion. Sorry for that 😅
Co-authored-by: Wilhelm Behncke <2522299+grebaldi@users.noreply.github.com>
This way the content tree works even when the guest frame crashes. The information from the guest frame is not needed anymore since #2927 to build the content tree. This also make the UI more responsive as the content tree now loads at the same time as the document tree. It is still necessary sometimes to update the current document node when the guest frame is initialised as the actual rendered page might target a different document node than the one expected. Resolves: #3251
This way the content tree works even when the guest frame crashes. The information from the guest frame is not needed anymore since #2927 to build the content tree. This also make the UI more responsive as the content tree now loads at the same time as the document tree. It is still necessary sometimes to update the current document node when the guest frame is initialised as the actual rendered page might target a different document node than the one expected. Resolves: #3251
This mirrors the following changes in <= 8.3: neos/neos-ui#2926 - neos/neos-ui#2927 - neos/neos-ui@c80b7cf
This mirrors the following changes in <= 8.3: neos/neos-ui#2926 - neos/neos-ui#2927 - neos/neos-ui@c80b7cf
This mirrors the following changes in <= 8.3: neos/neos-ui#2926 - neos/neos-ui#2927 - neos/neos-ui@c80b7cf
Resolves: #2926
What I did
The content tree now behaves the same as the document tree. Only loading the nodes defined by
loadingDepth
initially and not relying purely on the nodedata rendered in the guestframe.Toggling nodes with children also mimimcs the behaviour of the document tree and reloads the children when needed.
That reduces the number of initial db requests during page rendering in the backend from 119 to 78 in my test.
For large number of content nodes on a page this should improve performance considerably, especially if they are not all rendered.
How I did it
nonRenderedNodes
rendering in theNeos.Neos:Page
prototypeloadingDepth
when reloading or switching documents and merge them with data from content (might make loading on toggle in some cases unnecessary later)How to verify it
Work with content tree like before
Example video shows page with content that is not rendered, uncollapsing the parent node then loads the nodes (see loading spinner).
The other page renders all content, no further nodes need to be loaded.
Content.tree.node.loader.mov