Skip to content

Commit aa76170

Browse files
authored
docs: update the documentation for agents and move relevant code docs into a per-package docs folder (#7503)
# Pull Request ## 📖 Description This change updates agent skills for Rust and Documentation and moves the architectural docs for `@microsoft/fast-element` into a `docs/` folder. ## ✅ Checklist ### General - [ ] I have included a change request file using `$ npm run change` - [ ] I have added tests for my changes. - [ ] 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.
1 parent d40f0a7 commit aa76170

12 files changed

Lines changed: 60 additions & 22 deletions

File tree

.github/copilot-instructions.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,13 @@ Each package includes a DESIGN.md file, read that to gain a general understandin
4242
These contain domain-specific guidance. Read when performing related tasks:
4343

4444
- [TypeScript](./skills/typescript/SKILL.md) — compiler constraints, import/export conventions, decorator usage, testing patterns.
45+
- [Rust](./skills/rust/SKILL.md) — general guidance on performing updates between the crate and package.
4546
- [Shipping](./skills/shipping/SKILL.md) — pull request format, change file generation, documentation updates.
4647
- [Pull Request](./skills/fast-pull-request/SKILL.md) — generate a pull request description from the branch diff.
4748
- [Bug Report](./skills/fast-bug-report/SKILL.md) — generate a bug report issue from conversation context.
4849
- [Feature Request](./skills/fast-feature-request/SKILL.md) — generate a feature request issue from conversation context.
4950
- [Testing](./skills/testing/SKILL.md) — running tests locally and in CI, writing Playwright fixture tests.
51+
- [Documentation](./skills/documentation/SKILL.md) — adding documentation in code, markdown files in each package/crate, and the website.
5052

5153
## Commands
5254

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
name: documentation
3+
description: Add documentation for contributors and developers.
4+
---
5+
6+
Documentation exists in 3 forms, code comments, design/architectural documentation that is made up of markdown files describing code flow and core concepts (such as DESIGN.md), and the documentation website.
7+
8+
Design/architectural documentation such as DESIGN.md should always be kept up-to-date.
9+
10+
The website captures the documentation primarily for the `@microsoft/fast-element` package. Other packages are treated as tangential, so testing packages or other utilities should have their own sections.
11+
12+
The website has been written in 11ty and primarily consists of markdown files. When making changes, ensure that the website has been scanned on whichever latest major version is available. These are organized by folder, so if 1.x/2.x/3.x folders are available, you will update the documentation in the 3.x folder.
13+
14+
If you are making a breaking change, ensure the migration document has been updated.
15+
16+
All markdown documentation aside from the package/crate level DESIGN.md files are in that package/crates docs folder.
17+
18+
Any documentation created for the website should be written with the developer implementing the package in mind, it is not intended for other audiences.

.github/skills/rust/SKILL.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
description: Use this guide when working on Rust changes in the FAST monorepo.
3+
name: rust
4+
---
5+
6+
# Working with the Rust crate and the Rust NodeJS CLI
7+
8+
The primary location for the Rust logic should exist within a crate. If the logic is made accessible in the NodeJS environment via wrapping the crate and using a wasm bindgen, as much as possible any logic that exists in Rust should not be duplicated in JavaScript/TypeScript.
9+
10+
## Breaking changes
11+
12+
Understand [semver](https://semver.org/) and check the crate and package version. If the version is currently in a prerelease state, update the APIs with breaking changes as necessary and ensure that any generated pull request descriptions capture this.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "none",
3+
"comment": "docs: update the documentation for agents and move relevant code docs into a per-package docs folder",
4+
"packageName": "@microsoft/fast-element",
5+
"email": "7559015+janechu@users.noreply.github.com",
6+
"dependentChangeType": "none"
7+
}

packages/fast-element/ARCHITECTURE_INTRO.md

Lines changed: 0 additions & 10 deletions
This file was deleted.

packages/fast-element/DESIGN.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ When the tag function is called it invokes `ViewTemplate.create(strings, values)
172172

173173
No DOM nodes are created at this point; compilation is deferred.
174174

175-
See [ARCHITECTURE_HTML_TAGGED_TEMPLATE_LITERAL.md](./ARCHITECTURE_HTML_TAGGED_TEMPLATE_LITERAL.md) for more detail on directives and the `Markup`/`Parser` helpers.
175+
See [docs/architecture/html-tagged-template-literal.md](./docs/architecture/html-tagged-template-literal.md) for more detail on directives and the `Markup`/`Parser` helpers.
176176

177177
---
178178

@@ -217,7 +217,7 @@ See [ARCHITECTURE_HTML_TAGGED_TEMPLATE_LITERAL.md](./ARCHITECTURE_HTML_TAGGED_TE
217217

218218
`ViewBehaviorFactory` (created at template-authoring time) is the blueprint; `ViewBehavior` (created per `HTMLView` instance) is the live runtime object.
219219

220-
See [src/templating/TEMPLATE-BINDINGS.md](./src/templating/TEMPLATE-BINDINGS.md) for the full binding pipeline including `DOMAspect` routing and two-way binding.
220+
See [docs/template-bindings.md](./docs/template-bindings.md) for the full binding pipeline including `DOMAspect` routing and two-way binding.
221221

222222
---
223223

@@ -238,7 +238,7 @@ In async mode, the first `enqueue` call schedules a `requestAnimationFrame` call
238238

239239
Observable setters and `attributeChangedCallback` enqueue their DOM mutations through `Updates`, ensuring that multiple synchronous property changes result in only one DOM update per frame.
240240

241-
See [ARCHITECTURE_UPDATES.md](./ARCHITECTURE_UPDATES.md) for more detail.
241+
See [docs/architecture/updates.md](./docs/architecture/updates.md) for more detail.
242242

243243
---
244244

@@ -472,8 +472,7 @@ src/
472472
│ ├── ref.ts # ref directive
473473
│ ├── render.ts # render directive
474474
│ ├── children.ts # children directive
475-
│ ├── slotted.ts # slotted directive
476-
│ └── TEMPLATE-BINDINGS.md
475+
│ └── slotted.ts # slotted directive
477476
├── styles/
478477
│ ├── css.ts # css tag
479478
│ ├── element-styles.ts # ElementStyles
@@ -501,12 +500,12 @@ src/
501500

502501
| Document | What it covers |
503502
|---|---|
504-
| [ARCHITECTURE_INTRO.md](./ARCHITECTURE_INTRO.md) | Glossary / index for all architecture docs |
505-
| [ARCHITECTURE_OVERVIEW.md](./ARCHITECTURE_OVERVIEW.md) | General FAST usage, compose/define flow, module load sequence |
506-
| [ARCHITECTURE_FASTELEMENT.md](./ARCHITECTURE_FASTELEMENT.md) | FASTElement & ElementController lifecycle in detail |
507-
| [ARCHITECTURE_HTML_TAGGED_TEMPLATE_LITERAL.md](./ARCHITECTURE_HTML_TAGGED_TEMPLATE_LITERAL.md) | `html` tag, directives, binding pre-processing |
508-
| [ARCHITECTURE_UPDATES.md](./ARCHITECTURE_UPDATES.md) | Updates queue, attribute and observable change batching |
509-
| [src/templating/TEMPLATE-BINDINGS.md](./src/templating/TEMPLATE-BINDINGS.md) | Full template binding pipeline: authoring → compilation → binding → DOM updates |
503+
| [docs/architecture/intro.md](./docs/architecture/intro.md) | Glossary / index for all architecture docs |
504+
| [docs/architecture/overview.md](./docs/architecture/overview.md) | General FAST usage, compose/define flow, module load sequence |
505+
| [docs/architecture/fastelement.md](./docs/architecture/fastelement.md) | FASTElement & ElementController lifecycle in detail |
506+
| [docs/architecture/html-tagged-template-literal.md](./docs/architecture/html-tagged-template-literal.md) | `html` tag, directives, binding pre-processing |
507+
| [docs/architecture/updates.md](./docs/architecture/updates.md) | Updates queue, attribute and observable change batching |
508+
| [docs/template-bindings.md](./docs/template-bindings.md) | Full template binding pipeline: authoring → compilation → binding → DOM updates |
510509
| [docs/fast-element-2-changes.md](./docs/fast-element-2-changes.md) | Breaking changes from v1 to v2 |
511510

512511
---

packages/fast-element/ARCHITECTURE_FASTELEMENT.md renamed to packages/fast-element/docs/architecture/fastelement.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# FASTElement
22

3-
The `FASTElement` is our extension of the `HTMLElement`. As such it leverages the lifecycles but also requires additional setup before before the class `constructor` or the `connectedCallback` method is executed which are explained in the [overview](./ARCHITECTURE_OVERVIEW.md). This document explains specifically what `FASTElement` leverages inside the `HTMLElement`s lifecycle hooks.
3+
The `FASTElement` is our extension of the `HTMLElement`. As such it leverages the lifecycles but also requires additional setup before before the class `constructor` or the `connectedCallback` method is executed which are explained in the [overview](./overview.md). This document explains specifically what `FASTElement` leverages inside the `HTMLElement`s lifecycle hooks.
44

55
For an explanation into `HTMLElement` lifecycle hooks refer to the [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_custom_elements#custom_element_lifecycle_callbacks).
66

packages/fast-element/ARCHITECTURE_HTML_TAGGED_TEMPLATE_LITERAL.md renamed to packages/fast-element/docs/architecture/html-tagged-template-literal.md

File renamed without changes.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Introduction
2+
3+
This document (and the linked documents) explains how the exports and side effects of `@microsoft/fast-element` are used to create custom elements.
4+
5+
## Glossary
6+
7+
- [Overview](./overview.md): How the `@microsoft/fast-element` should be used by a developer and what code is executed during the first render.
8+
- [`FASTElement`](./fastelement.md): How the `FASTElement` is architected.
9+
- [`html` tagged template literal](./html-tagged-template-literal.md): How the `html` tagged template literal takes and converts the contents into a `ViewTemplate`.
10+
- [`Updates` queue](./updates.md): How updates to attributes and observables are processed.
File renamed without changes.

0 commit comments

Comments
 (0)