From 24b6b094090d796e74c2839bd4b1007514c553f7 Mon Sep 17 00:00:00 2001 From: Jane Chu <7559015+janechu@users.noreply.github.com> Date: Thu, 2 Jul 2026 11:17:48 -0700 Subject: [PATCH 1/6] Support authored FAST f-template components Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- Cargo.lock | 14 +- DESIGN.md | 34 ++ README.md | 13 + crates/webui-parser/src/component_registry.rs | 483 ++++++++++++++++-- crates/webui-parser/src/diagnostic.rs | 2 + crates/webui-parser/src/lib.rs | 220 +++++++- crates/webui-parser/src/plugin/fast_v2.rs | 4 + crates/webui-parser/src/plugin/fast_v3.rs | 4 + crates/webui-parser/src/plugin/mod.rs | 9 + docs/guide/concepts/plugins/index.md | 53 ++ 10 files changed, 767 insertions(+), 69 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 35fc5375..920af549 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -289,7 +289,7 @@ version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -300,7 +300,7 @@ checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" dependencies = [ "anstyle", "once_cell_polyfill", - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -1081,7 +1081,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -2735,7 +2735,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -2974,7 +2974,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52d1cfed4120b4d927bf7c0f86d2087a4a7d6027c906d9f9d525a80573b9be51" dependencies = [ "libc", - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -3072,7 +3072,7 @@ dependencies = [ "getrandom 0.4.3", "once_cell", "rustix", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -3533,7 +3533,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] diff --git a/DESIGN.md b/DESIGN.md index a7346dd9..96994e40 100644 --- a/DESIGN.md +++ b/DESIGN.md @@ -1226,6 +1226,7 @@ pub trait ParserPlugin { component: &Component, processed_template: &str, ) -> Result<()>; + fn uses_fast_template_artifacts(&self) -> bool { false } fn classify_attribute(&mut self, attr_name: &str) -> AttributeAction; fn finish_element(&mut self, binding_attribute_count: u32) -> Option>; fn into_artifacts(self: Box) -> Result; @@ -1237,6 +1238,7 @@ pub trait ParserPlugin { - **Attribute loop**: `classify_attribute` decides whether framework-owned attrs are kept, skipped, or skipped-and-counted as bindings - **Element completion**: `finish_element` runs with the final binding count after all attrs are processed; returned bytes are emitted as a `Plugin` fragment - **Component registration**: `register_component_template` receives the plugin-facing component template HTML after HTML/CSS comment stripping. Authored root `