fix: synchronize mounted component props
Quality / quality (ubuntu-latest) (push) Failing after 9m51s
Quality / quality (windows-latest) (push) Canceled after 0s

This commit is contained in:
2026-08-23 19:42:39 +05:30
parent 56cde5aaf8
commit 53b9947ef9
11 changed files with 159 additions and 10 deletions
+11 -1
View File
@@ -1769,7 +1769,17 @@ export function createHandlers(deps: RuntimeDeps): Handlers {
},
)
: renderComponent();
result += await renderComponents(rendered, translate, language, depth + 1);
// Prop bindings are authored by the parent mount but consumed by the
// rendered child's scope. The mount itself is replaced during SSR, so
// carry those reserved attributes onto the child's scope root.
const propBindings = Array.from(
attrStr!.matchAll(/\s(data-wrn-prop-bind-[A-Za-z0-9_-]+(?:="[^"]*")?)/g),
(match) => ` ${match[1]}`,
).join("");
const bridged = propBindings
? rendered.replace(/(<[A-Za-z][A-Za-z0-9-]*\b[^>]*\bdata-scope="[^"]*")/, `$1${propBindings}`)
: rendered;
result += await renderComponents(bridged, translate, language, depth + 1);
} catch (err) {
console.error(`[wrnexus] component '${name}' failed to render`, err);
deps.devToolbar?.collector.add(