Skip to content

Rewrite v3 Getting Started docs#7569

Draft
radium-v wants to merge 6 commits into
releases/fast-element-v3from
users/radium-v/fast-element-v3-docs
Draft

Rewrite v3 Getting Started docs#7569
radium-v wants to merge 6 commits into
releases/fast-element-v3from
users/radium-v/fast-element-v3-docs

Conversation

@radium-v

@radium-v radium-v commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Pull Request

📖 Description

Rewrites and expands the FAST Element v3 documentation site. The getting-started guides were dense and in places out of date; this branch reworks them and adds the missing DOM Policy reference.

  • Reworked the Quick Start, FAST Element, and HTML Templates guides.
  • Added a DOM Policy advanced guide.
  • Added previous/next pagination navigation, with supporting Eleventy includes and styles.
  • Added the --incremental flag to the website's watch mode so local rebuilds are faster.

📑 Test Plan

Everything here touches sites/website/** (content, Eleventy config, styles). Run npm run start in sites/website, then check the updated pages render and the prev/next navigation links to the right neighbors. All existing tests pass.

✅ Checklist

General

  • I have tested my changes.
  • I have updated the project documentation to reflect my changes.
  • I have read the CONTRIBUTING documentation and followed the standards for this project.

@radium-v radium-v changed the title Users/radium v/fast element v3 docs Rewrite v3 Getting Started docs Jun 8, 2026
@janechu janechu requested a review from Copilot June 11, 2026 21:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR rewrites and expands the FAST Element v3 documentation site’s getting-started content, adds a new DOM Policy guide, and introduces prev/next pagination derived from the Eleventy navigation tree. It also tweaks the website dev workflow by enabling Eleventy incremental builds in watch mode.

Changes:

  • Reworked v3 getting-started docs (Quick Start, FASTElement, HTML Templates) and added navigation ordering.
  • Added a new v3 advanced “DOM Policies” guide and linked it from template/security guidance.
  • Implemented prev/next pagination UI (Nunjucks include + CSS) and added a prevNext Eleventy filter; enabled --incremental in the site start script.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
sites/website/src/docs/3.x/getting-started/quick-start.md Rewritten Quick Start guide; introduces tsconfig guidance and an end-to-end component example.
sites/website/src/docs/3.x/getting-started/html-templates.md Expanded template authoring/binding reference, including DOMPolicy mention and host bindings.
sites/website/src/docs/3.x/getting-started/fast-element.md Reworked FASTElement overview; adds lifecycle/define/compose guidance and controller notes.
sites/website/src/docs/3.x/advanced/dom-policy.md New DOMPolicy advanced guide describing Trusted Types integration and withPolicy().
sites/website/src/css/main.css Adds pagination navigation styling and hides pagination in print.
sites/website/src/_includes/pagination-nav.njk New prev/next pagination include driven by eleventy-navigation ordering.
sites/website/src/_includes/3x-container.njk Renders pagination include for v3 pages.
sites/website/package.json Adds --incremental to Eleventy serve/watch startup script.
sites/website/eleventy.config.js Adds a prevNext filter to compute siblings from the navigation tree.

"module": "ESNext",
"moduleResolution": "Bundler",
"target": "ES2022",
"useDefineForClassFields": false // should be false when targeting ES2022 or newer (see FAST#5261)
Comment on lines +67 to +70
class HelloWorld extends FASTElement {
@attr
name: string;
}
Comment on lines 148 to 151
class HelloWorld extends FASTElement {
@attr
name: string;
@attr
name?: string;
}
Comment on lines +154 to +156
### Event Bindings

Event bindings are used to attach event listeners to elements within the template. They are denoted by prefixing an attribute binding with an at symbol (`@`). The value returned by the binding function is expected to be a function, which is registered as an event listener for the specified event type.
Comment on lines +140 to +142
:::tip
FAST's `Observable` API can be used independently of custom elements, so you can create observable objects and properties in any JavaScript class, not just those that extend `FASTElement`. Read the [Reactivity](/docs/advanced/reactivity.md) section for more details on using observables in FAST.
:::
Comment on lines +193 to 195
:::note
Overriding `connectedCallback` can affect the timing of when your template is bound and when behaviors run, so it's generally recommended to call `super.connectedCallback()` at the beginning of your override. Conversely, for `disconnectedCallback` and `attributeChangedCallback`, it's usually best to call the super method at the end of your override to ensure that your custom logic runs while the element is still in a consistent state.
:::
Comment on lines +37 to +43
const trustedType = trustedTypes.createPolicy("my-app", {
createHTML(value) {
// Run the value through a sanitizer such as DOMPurify
// before returning it.
return sanitize(value);
},
});

This guide assumes you're building a browser bundle with TypeScript, via a build tool such as esbuild, Rollup, Vite, or Webpack.

Install `@microsoft/fast-element` as a dev dependency:

```bash
npm install --save @microsoft/fast-element
npm install --save-dev @microsoft/fast-element
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.

2 participants