refactor: add template resolver pipeline#7490
Merged
janechu merged 9 commits intomicrosoft:releases/fast-element-v3from Apr 24, 2026
Merged
refactor: add template resolver pipeline#7490janechu merged 9 commits intomicrosoft:releases/fast-element-v3from
janechu merged 9 commits intomicrosoft:releases/fast-element-v3from
Conversation
Move FASTElement definition orchestration to a function-based template resolver pipeline so extensions run before template resolution and concrete templates are assigned before registration. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Drop the templateOptions defer-and-hydrate API from fast-element so the core resolver pipeline no longer preserves the old deferred-template registration path. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
chrisdholt
approved these changes
Apr 24, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
5 tasks
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
janechu
added a commit
that referenced
this pull request
Apr 24, 2026
# Pull Request ## 📖 Description Adds a new **Declarative HTML** documentation section to the 3.x docs site with four pages covering the full declarative template authoring workflow: - **Overview** — Purpose of declarative templates, when to use them, a hello world example, and comparison with imperative `html` tagged templates. - **Writing f-templates** — Template syntax including content/attribute/boolean/event bindings, directives (`f-when`, `f-repeat`, `f-ref`, `f-slotted`, `f-children`), dot-notation paths, execution context access (`$e`, `$c`), and expression limitations. - **Defining Elements** — `TemplateElement` registration, `templateOptions: "defer-and-hydrate"`, lifecycle callbacks (`config()`), element configuration (`options()`), `observerMap` and `attributeMap` usage. - **Server-Side Rendering** — The renderer-agnostic SSR contract, hydration flow, Declarative Shadow DOM output, state propagation, and `@microsoft/fast-build` CLI usage. Also adds cross-references from `packages/fast-element/README.md` and `DECLARATIVE_HTML.md` to the new docs. Based on the declarative template features from PRs #7490, #7491, #7492, and #7493. ## 📑 Test Plan - Website builds successfully with `npm run build -w sites/website` - All four pages render correctly in the 11ty output - `npm run checkchange` passes (no change files needed for docs-only changes to the website) ## ✅ Checklist ### General - [x] I have included a change request file using `$ npm run change` - [ ] I have added tests for my changes. - [x] I have tested my changes. - [x] I have updated the project documentation to reflect my changes. - [x] I have read the [CONTRIBUTING](https://github.com/microsoft/fast/blob/main/CONTRIBUTING.md) documentation and followed the [standards](https://github.com/microsoft/fast/blob/main/CODE_OF_CONDUCT.md#our-standards) for this project.
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
This draft lays the groundwork for definition-aware template resolution in
@microsoft/fast-element.PartialFASTElementDefinition.templateas either a concrete template or a function-based resolverFASTElementDefinition.templateconcrete by resolving async templates before registration completes👩💻 Reviewer Notes
This is the stack base for the declarative-template work. The main areas to review are the resolver API shape in
fast-definitions.tsand the updatedFASTElement.define()sequencing.📑 Test Plan
npm run build:tsc -w @microsoft/fast-elementnpm run doc -w @microsoft/fast-elementnpx @biomejs/biome check --colors=off packages/fast-element/src/components/fast-definitions.pw.spec.ts packages/fast-element/src/components/fast-definitions.ts packages/fast-element/src/components/fast-element.pw.spec.ts packages/fast-element/src/components/fast-element.ts packages/fast-element/src/index.tsnpm run checkchangenpx playwright test src/components/fast-definitions.pw.spec.ts src/components/fast-element.pw.spec.ts --project=chromium✅ Checklist
General
$ npm run change⏭ Next Steps
Follow-up draft PRs will build the declarative
<f-template>publication path, adddeclarativeTemplate(), and then remove the remainingsideEffectsmetadata.