Skip to content

fix: preserve root runtime attrs for plugin templates#358

Closed
akroshg wants to merge 1 commit into
mainfrom
akroshg/fix-todo-fast-events
Closed

fix: preserve root runtime attrs for plugin templates#358
akroshg wants to merge 1 commit into
mainfrom
akroshg/fix-todo-fast-events

Conversation

@akroshg

@akroshg akroshg commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fix root <template> runtime attrs disappearing from plugin client templates.
  • Keep SSR output clean by stripping runtime attrs there.
  • Preserve @, :, ?, and FAST f-* 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_attrs
  • cargo test -p microsoft-webui-parser component_template_strips_shadowrootmode_from_f_template
  • cargo test -p microsoft-webui-parser fast_v3
  • cargo test -p microsoft-webui-parser fast_v2
  • pnpm -C examples/app/todo-fast build
  • pnpm --dir docs build
  • cargo xtask check reaches the existing Windows libc::rusage/getrusage failure in crates/webui/examples/streaming_resource_bench.rs

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>
@akroshg

akroshg commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

#359 has a better fix.

@akroshg

akroshg commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

Closing in favor of #359.

@akroshg akroshg closed this Jun 19, 2026
@akroshg akroshg deleted the akroshg/fix-todo-fast-events branch June 19, 2026 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant