-
Notifications
You must be signed in to change notification settings - Fork 175
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
1603 lazy loading option for compound web component mode #3590
Conversation
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.
It looks good to me!
Good Job 👍 .
Small comments regarding documentation.
* @param {*} context the luigi node context | ||
*/ | ||
renderWebComponentCompound(navNode, wc_container, extendedContext) { | ||
const useLazyLoading = navNode.compound?.lazyLoadingOptions?.enabled === true; |
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.
Done...
}); | ||
} | ||
|
||
/** |
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.
Please add a description to the function what it does.
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.
Done...
compoundItemContainer.style.height = temporaryContainerHeight; | ||
} | ||
|
||
/** |
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.
Please add a description to the function what it does.
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.
Done...
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.
LGTM 👍 !
Description
Changes proposed in this pull request:
IntersectionObserver
that triggers the rendering when the container is visible. To support this, each compound item container is rendered with a temporary height, so that not all containers are immediately visible in the viewport.Discussion points:
compound.lazyLoadingOptions
(object) options for lazy loading of the compound.enabled
(boolean) to activate lazy loading mode.temporaryContainerHeight
(CSS length string) height to apply as a default for all children of the compound. If not specified, a default fallback is used, currently "500px".intersectionRootMargin
(CSS length string), to be passed on to the IntersectionObservercompound.children[].layoutConfig.temporaryContainerHeight
(string) CSS height to apply to the individual children of the compound. Overrides the compound default.compound.lazyLoadingOptions.noTemporaryContainerHeight
to suppress the setting/removing of the temporary height to the compound item containers.compound.temporaryContainerHeight
?Known issues:
Related issue(s)
Fixes #1603.