Repository navigation
feat: add webui-framework-prerelease conversion target with strip-and-warn directives - #7738
Merged
Merged
Conversation
Jane Chu (janechu)
requested review from
Chris Holt (chrisdholt) and
John Kreitlow (radium-v)
as code owners
October 9, 2026 20:30
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: afc59809-2e01-4c2a-8849-b740fe5056d3
Jane Chu (janechu)
force-pushed
the
feat/fast-convert-webui-native-target
branch
from
October 9, 2026 20:40
5ad771b to
00a7e53
Compare
…s with warnings
Consolidates the native webui conversion target into webui-prerelease,
so there is a single WebUI conversion target that performs Shadow/Light
DOM attribute transfer, f-ref -> w-ref conversion, and $e event-argument
rewriting. f-slotted and f-children are no longer hard errors: they are
stripped from the output and reported via a new warnings list instead,
while all other unsupported constructs remain hard errors.
- Add warning.rs with ConvertWarning/ConvertOutput; convert_template and
convert_template_with_options now return Result<ConvertOutput, ConvertError>
- Merge webui_native.rs logic into syntax/webui.rs (webui-prerelease target),
delete webui_native.rs and the separate SYNTAX_METADATA entry
- Rename UnsupportedNativeWebUIEventContext -> UnsupportedEventContext and
drop UnsupportedNativeWebUIDirective (now a warning, not an error)
- Update wasm bindings with a ConvertResult struct exposing output/warnings
to JS, and update fast.js to print warnings to stderr
- Update DESIGN.md/README.md for the merged single-target design
- Add/adjust crate and fast-build tests for the new behavior
- Exclude fast-build convert fixtures from biome's HTML formatter so
literal ${ / {{ }} test content isn't mistaken for bindings
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: afc59809-2e01-4c2a-8849-b740fe5056d3
Split the previously-merged shadow-DOM/f-ref/event-rewriting conversion logic out of webui-prerelease into a new, separate syntax target named webui-framework-prerelease. webui-prerelease is restored to its original, unmodified behavior (simple f-repeat/f-when conversion with passthrough of other FAST attributes). webui-framework-prerelease converts FAST's declarative syntax into the Microsoft WebUI Framework's own declarative runtime syntax: it transfers Shadow/Light DOM attributes from the outer <f-template> onto the inner <template>, converts f-ref to a braced w-ref, rewrites FAST's $e event argument to bare e, and rejects $c (and other $-prefixed event context tokens) since WebUI Framework has no repeat-context equivalent. Unsupported f-slotted/f-children directives are stripped from the output with a ConvertWarning instead of a hard error, surfaced to CLI callers as "Warning: <message>" on stderr. - crates/microsoft-fast-convert: new syntax/webui_framework_prerelease.rs module; syntax/webui.rs reverted to its original implementation; converter.rs/syntax/mod.rs/lib.rs updated for the 3-target dispatch; tests/conversions.rs and tests/errors.rs rewritten to cover all three targets. - packages/fast-build: config.test.js's warning CLI test now targets --syntax=webui-framework-prerelease; convert fixture/test files reverted to their original webui-prerelease-compatible form since that target no longer requires braced f-ref or rejects $c. - Updated DESIGN.md/README.md in both packages for the 3-target design. - Updated beachball change file to describe the additive new target instead of a breaking change to webui-prerelease. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: afc59809-2e01-4c2a-8849-b740fe5056d3
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: afc59809-2e01-4c2a-8849-b740fe5056d3
Chris Holt (chrisdholt)
approved these changes
Oct 9, 2026
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.
Pull Request
📖 Description
Adds a new conversion target,
webui-framework-prerelease, tomicrosoft-fast-convert/@microsoft/fast-build, alongside the existingwebui-prereleaseandfast-v3-tstargets.webui-prereleaseis unchanged by this PR — it continues to emit HTML for WebUI's own FAST parser plugin exactly as before.webui-framework-prereleaseconverts FAST's declarative syntax into the Microsoft WebUI Framework's own declarative runtime syntax, to be leveraged by their web component framework:shadowroot-prefixed attributes move from the outer<f-template>wrapper onto the inner<template>, deduping identical values and rejecting conflicting ones (ConflictingShadowRootMode) or unsupported outer attributes (UnsupportedPublisherAttribute).f-ref="{input}"→w-ref="{input}", rejecting non-braced values (InvalidAttributeValue).$eto bareeand rejects$c/other FAST event-context tokens that have no equivalent (UnsupportedEventContext).f-slottedandf-childrenare stripped from the output with a warning instead of being hard errors or passed through verbatim — WebUI Framework has no equivalent for these directives, but failing the whole conversion for them was too strict. Every other unsupported construct remains a hardConvertError.Because conversion can now produce non-fatal warnings,
convert_template/convert_template_with_optionsreturn a newConvertOutput { output, warnings }(Rust) /ConvertResult(wasm, withoutput/warningsgetters) instead of a bare string, for all three targets — though onlywebui-framework-prereleaseever returns a non-emptywarnings. Thefast convertCLI prints each warning to stderr asWarning: <message>and still writes the converted output; it doesn't fail the command.convert_stylesheetis unaffected and still returns a plain string.The target's name,
webui-framework-prerelease, reflects that the WebUI Framework project itself is currently in prerelease — it isn't a statement about the stability of this conversion target's implementation; that wording is intentionally not used elsewhere.👩💻 Reviewer Notes
Most review attention should go to the new
crates/microsoft-fast-convert/src/syntax/webui_framework_prerelease.rs(shadow-DOM/f-ref/event logic, strip-with-warning),src/warning.rs(ConvertWarning/ConvertOutput), andsrc/wasm.rs'sConvertResultstruct.syntax/webui.rsis untouched (restored to its original, pre-PR content).packages/fast-build/bin/fast.jshas one updated call site that now destructures{ output, warnings }for every target, andtest/config.test.jshas a new CLI test exercising--syntax=webui-framework-prerelease's warning output.📑 Test Plan
cargo testincrates/microsoft-fast-convert: all tests pass (metadata for all 3 targets, originalwebui-prereleasebehavior,webui-framework-prereleasepublisher/DOM mode, directive, event, strip-with-warning, robustness, and Avatar-fixture coverage).cargo clippy --all-targetsandcargo fmt --checkincrates/microsoft-fast-convert: clean.npm run build -w @microsoft/fast-build: wasm rebuilt successfully.npm run test:node -w @microsoft/fast-build: all 83 tests pass, including a CLI test asserting warnings are printed to stderr whenwebui-framework-prereleasestripsf-slotted/f-children.<f-template>with--syntax=webui-framework-prereleaseconfirmedshadowrootmodetransfer,w-refconversion,$e→erewriting, andf-slottedstripping with a printed warning, end-to-end; a separate smoke test with--syntax=webui-prereleaseconfirmed output is unchanged from before this PR.npm run checkchangeandnpm run biome:check: pass.✅ Checklist
General
$ npm run changeAgents
⏭ Next Steps
WebUIConvertOptions(e.g. configurable event-object/unsupported-directive modes). This remains deferred as out of scope; a follow-up PR can add it if needed.crates/microsoft-fast-convert's own crate version was not bumped as part of this PR (unrelated to the beachball change file added for@microsoft/fast-build's wasm artifact); that's left to the maintainers' normal crates.io release process.