fix(csr): consume document binding metadata
This commit is contained in:
@@ -3537,6 +3537,20 @@ export const REACTIVE_RUNTIME = String.raw`
|
||||
function hydrateScopes(root) {
|
||||
var host = root || document;
|
||||
|
||||
// The document shell can contain server-resolved attributes such as
|
||||
// lang={language} and data-theme={theme}. It has no component scope and
|
||||
// therefore no client-side binding to retain; consume its compiler markers
|
||||
// separately from component hydration.
|
||||
if (host === document || host === document.documentElement) {
|
||||
Array.prototype.slice
|
||||
.call(document.documentElement.attributes)
|
||||
.forEach(function (attribute) {
|
||||
if (attribute.name.indexOf("data-wrn-bind-") === 0) {
|
||||
document.documentElement.removeAttribute(attribute.name);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var scopeSelector =
|
||||
"[data-scope], [data-wrn-scope]";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user