fix: preserve root runtime attrs for plugin templates#358
Closed
akroshg wants to merge 1 commit into
Closed
Conversation
Keep runtime attributes on plugin-facing component templates while continuing to strip them from SSR output. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
Author
|
#359 has a better fix. |
Contributor
Author
|
Closing in favor of #359. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
<template>runtime attrs disappearing from plugin client templates.@,:,?, and FASTf-*attrs only for plugin-facing templates.Why
PR #307 made the parser preserve authored
<template>wrappers. That is correct for SSR, but runtime attrs on the wrapper were stripped before FAST received the client template artifact. Apps with root event handlers, like todo-fast and Edge Downloads BTR, rendered correctly but did not wire those handlers.This fixes the split at the parser boundary: SSR gets the stripped template, while plugins get the client artifact with root runtime attrs preserved. That is better than changing apps or adding FAST-specific restoration logic.
Validation
cargo test -p microsoft-webui-parser plugin_artifact_template_keeps_root_runtime_attrscargo test -p microsoft-webui-parser component_template_strips_shadowrootmode_from_f_templatecargo test -p microsoft-webui-parser fast_v3cargo test -p microsoft-webui-parser fast_v2pnpm -C examples/app/todo-fast buildpnpm --dir docs buildcargo xtask checkreaches the existing Windowslibc::rusage/getrusagefailure incrates/webui/examples/streaming_resource_bench.rs