-
Notifications
You must be signed in to change notification settings - Fork 403
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
feat: allow skip hydration for LWR islands #5016
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -368,6 +368,10 @@ function hydrateCustomElement( | |
vnode: VCustomElement, | ||
renderer: RendererAPI | ||
): Node | null { | ||
if (elm.hasAttribute('data-lwc-skip-hydrate')) { | ||
return elm; | ||
} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This skips hydration but I'm not sure what happens if the component is updated afterwards. For example, if the parent has an update that would normally trigger VDOM diffing which would affect the child (e.g. removing it, passing in a new prop, etc.), LWC is not aware of the child, and rendering/callbacks will not be invoked. Ideally we should have tests in The custom element tag name may also not be defined, which could cause potential issues if other code is able to "hijack" it – e.g. someone injects code that does |
||
const { validationOptOut } = vnode.ctor; | ||
const shouldValidateAttr = getValidationPredicate(elm, renderer, validationOptOut); | ||
|
||
|
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 our convention for abstracting differences between
engine-dom
andengine-server
.