Repository navigation
feat: add explicit f-host and f-shadow declarations - #7799
Open
Jane Chu (janechu) wants to merge 3 commits into
Open
Jane Chu (janechu) wants to merge 3 commits into
Jane Chu (janechu) wants to merge 3 commits into
Conversation
Use f-host for declarative host defaults and bindings in the browser runtime, SSR, and conversion pipelines. Remove legacy template host forwarding and document the migration. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Jane Chu (janechu)
requested review from
Chris Holt (chrisdholt) and
John Kreitlow (radium-v)
as code owners
November 5, 2026 00:08
Use f-shadow for canonical shadow-root options across runtime, SSR and converters. Retain outer and inner template shadowroot configuration with TODOs referencing #7800 for removal in FAST Element vNext. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use shadowrootmode, shadowrootdelegatesfocus, shadowrootclonable and shadowrootserializable consistently in runtime, SSR, converters, fixtures and documentation. Reject abbreviated aliases while preserving the existing legacy template compatibility paths. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This branch has not been deployed
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
Add optional direct-child metadata declarations:
<f-host>for custom-element host defaults and bindings, and<f-shadow>for shadow-root configuration:The browser runtime consumes these declarations without registering or rendering metadata custom elements in the component. Static host attributes are defaults, preserving explicit instance attributes. Existing reactive bindings and event listeners continue through the normal template pipeline.
<f-shadow>accepts staticshadowrootmode,shadowrootdelegatesfocus,shadowrootclonable, andshadowrootserializableoptions and defaults its mode toopen. Attribute names match HTML's lowercase native DSD names without abbreviation or camel-casing. The same declaration configures browser-created roots, server-rendered native DSD, and conversion targets.fast-build emits supported initial host values on the custom element before Declarative Shadow DOM, including streamed rendering, so CSS need not wait for client-side repair.
Remove legacy host-attribute forwarding from declarative definition/template elements. Update the authoring, design, SSR, and migration documentation and migrate the host-binding fixtures.
🎫 Issues
Closes #7797.
Follow-up compatibility removal: #7800, assigned to FAST Element vNext.
👩💻 Reviewer Notes
Breaking markup change: Move host attributes and bindings from declarative
<f-template>/ inner<template>elements onto<f-host>. The JavaScripthtmltagged-template host-binding API is unchanged.Document only
<f-shadow>for authored shadow-root options. Undocumented compatibility retainsshadowroot*options on both outer<f-template>and inner<template>elements, with inner options taking precedence. An explicit<f-shadow>overrides legacy shadow configuration entirely. Browser, renderer, and converter compatibility paths carryTODO(#7800)comments for their breaking removal in vNext; this PR does not close #7800.Native
parse_f_templatesnow returnsResult<Vec<FTemplate>, RenderError>so malformed host declarations can fail explicitly. Successful WASM metadata retains the existinghostAttributesshape. Conversion targets consume the same declaration rather than silently losing host attributes.Keep document-embedded definitions hidden: these metadata elements are not browser-native inert elements before JavaScript executes.
hiddenon<f-template>is not forwarded to the component.Both affected packages disallow major Beachball changes, so release notes use the repository-permitted minor type. The markup migration is documented explicitly for release review.
📑 Test Plan
npm run build -- --no-cache(bypasses stale local WASM cache entries).<f-shadow>: 624 passed. After aligning all<f-shadow>attributes with HTML-standard names, reran all 60 runtime declaration tests and 45 host fixture tests across Chromium, Firefox, and WebKit, including no-JavaScript SSR and hydration.npm run checkchangewrapper fails withspawnSync npx ENOENT;npm exec -- beachball check --branch origin/main --no-fetchpasses. Whole-crate rustfmt checks report pre-existing differences in unchanged files; changed Rust lines/new tests are formatted.✅ Checklist
General
$ npm run changeAgents