Skip to content

Commit 8eb2a69

Browse files
authored
feat: move declarative html into fast-element (#7482)
# Pull Request ## 📖 Description Move the declarative HTML runtime from `@microsoft/fast-html` into `@microsoft/fast-element` under a dedicated `@microsoft/fast-element/declarative.js` entrypoint. This PR: - moves the declarative runtime, fixtures, scripts, Playwright configs, and package docs into `packages/fast-element` - updates internal consumers, website/API docs generation, and the WebUI integration workflow to use the new declarative subpath - removes the `packages/fast-html` workspace and its legacy changefiles Closes #7314 ## 👩‍💻 Reviewer Notes Review the migration in roughly this order: 1. `packages/fast-element/src/declarative.ts` and `packages/fast-element/package.json` for the new public entrypoint and export wiring. 2. `packages/fast-element/test/declarative/` and `packages/fast-element/scripts/declarative/` for the moved fixture/test infrastructure. 3. `sites/website/scripts/generate-docs.cjs` and `sites/website/src/docs/3.x/` for the new declarative API/docs publication path. ## 📑 Test Plan - `npm run build` - `npm run checkchange` - `npm run test:chromium:declarative -w @microsoft/fast-element` - `cd packages/fast-element && npx playwright test --config=playwright.declarative.config.ts test/declarative/fixtures/ecosystem/deprecated-event-warning/deprecated-event-warning.spec.ts --workers=1` - `cd packages/fast-element && npx playwright test --config=playwright.declarative.config.ts test/declarative/fixtures/extensions/attribute-map-naming-strategy/attribute-map-naming-strategy.spec.ts --project=webkit --workers=1` - `npm run test` in the shared CLI environment reached the declarative Playwright matrix and failed intermittently while another repo was reusing port `5174`; the focused reruns above passed. ## ✅ 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.
1 parent 746579f commit 8eb2a69

309 files changed

Lines changed: 3815 additions & 2814 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/copilot-instructions.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,15 @@ applyTo: '**/*'
1212

1313
## Repository Overview
1414

15-
FAST (`@microsoft/fast`) is a Microsoft open-source monorepo for building W3C-standards-compliant Web Components. The core package is `@microsoft/fast-element` — a lightweight, performant Web Component authoring library. Additional packages provide routing and declarative HTML support.
15+
FAST (`@microsoft/fast`) is a Microsoft open-source monorepo for building W3C-standards-compliant Web Components. The core package is `@microsoft/fast-element` — a lightweight, performant Web Component authoring library with a declarative HTML entrypoint. Additional packages provide routing plus declarative build and test tooling.
1616

1717
## Packages
1818

1919
Each package includes a DESIGN.md file, read that to gain a general understanding of the code for that package.
2020

2121
| Package | Status | Purpose |
2222
|---|---|---|
23-
| `@microsoft/fast-element` | Stable (v2) | Core Web Component library |
24-
| `@microsoft/fast-html` | Alpha | Declarative HTML parser |
23+
| `@microsoft/fast-element` | Stable (v2) | Core Web Component library, including declarative HTML via `@microsoft/fast-element/declarative.js` |
2524
| `@microsoft/fast-router` | Alpha | Web Component router |
2625
| `@microsoft/fast-build` | Prerelease | Declarative HTML server side renderer |
2726
| `@microsoft/fast-test-harness` | Prerelease | Testing utilities for FASTElement components |

.github/skills/shipping/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Use [conventional commit](https://www.conventionalcommits.org/) format for PR ti
4848
Common types: `feat`, `fix`, `chore`, `docs`, `refactor`, `test`, `perf`.
4949

5050
Examples:
51-
- `feat: add shadow DOM support to fast-html parser`
51+
- `feat: add shadow DOM support to declarative templates`
5252
- `fix: resolve memory leak in template binding`
5353
- `chore: update dev dependencies`
5454

.github/skills/testing/SKILL.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,22 @@ All commands are run from the **monorepo root**. Use `-w` to target a specific p
2727
|---|---|
2828
| Run all tests (all browsers) | `npm run test` |
2929
| Run all tests (Chromium only) | `npm run test:chromium` |
30-
| Test a single package (all browsers) | `npm run test -w @microsoft/fast-html` |
31-
| Test a single package (Chromium only) | `npm run test:chromium -w @microsoft/fast-html` |
30+
| Test a single package (all browsers) | `npm run test -w @microsoft/fast-element` |
31+
| Test a single package (Chromium only) | `npm run test:chromium -w @microsoft/fast-element` |
3232
| Test changed packages only | `npx lage test:node test:chromium --since origin/main` |
3333

3434
#### Interactive / debug workflows
3535

36-
For `@microsoft/fast-html`, these additional scripts are available:
36+
For FAST declarative tests in `@microsoft/fast-element`, these additional scripts are available:
3737

3838
| Task | Command |
3939
|---|---|
40-
| Playwright UI mode | `npm run test:ui -w @microsoft/fast-html` |
41-
| Start Vite dev server only | `npm run test-server -w @microsoft/fast-html` |
42-
| Dev mode (watch + server) | `npm run dev -w @microsoft/fast-html` |
43-
| Rebuild fixtures | `npm run build:fixtures -w @microsoft/fast-html` |
44-
| Build fixtures with webui | `npm run build:fixtures:webui -w @microsoft/fast-html` |
45-
| Run webui integration tests | `npm run test:webui-integration -w @microsoft/fast-html` |
40+
| Playwright UI mode | `npm run test:ui:declarative -w @microsoft/fast-element` |
41+
| Start Vite dev server only | `npm run test-server:declarative -w @microsoft/fast-element` |
42+
| Dev mode (watch + server) | `npm run dev:declarative -w @microsoft/fast-element` |
43+
| Rebuild fixtures | `npm run build:fixtures -w @microsoft/fast-element` |
44+
| Build fixtures with webui | `npm run build:fixtures:webui -w @microsoft/fast-element` |
45+
| Run webui integration tests | `npm run test:webui-integration -w @microsoft/fast-element` |
4646

4747
**Playwright UI mode** (`test:ui`) starts a visual test runner where you can select and debug individual tests, view traces, and inspect DOM snapshots.
4848

@@ -80,7 +80,7 @@ A dedicated workflow for validating FAST's integration with `@microsoft/webui`.
8080
The workflow builds all packages, installs Playwright Chromium, and runs:
8181

8282
```bash
83-
npm run test:webui-integration -w @microsoft/fast-html
83+
npm run test:webui-integration -w @microsoft/fast-element
8484
```
8585

8686
This builds each fixture with `webui build --plugin=fast`, renders the protocol with the fixture's `state.json`, and runs the same Playwright specs against the webui-rendered output.
@@ -105,13 +105,13 @@ FAST tests are [Playwright](https://playwright.dev/) integration tests that run
105105
- Fixture tests live inside their fixture directory: `test/fixtures/<category>/<feature>/<feature>.spec.ts`.
106106
- Source-level tests are co-located next to the code they test: `src/<feature>/<feature>.pw.spec.ts`.
107107

108-
### Writing fixture tests for fast-html
108+
### Writing declarative fixture tests
109109

110-
Fixture tests for `@microsoft/fast-html` are the primary way to verify declarative template features. Each fixture is a self-contained test case with its own HTML, state, templates, and component definitions.
110+
Fixture tests in `@microsoft/fast-element/test/declarative/fixtures` are the primary way to verify declarative template features. Each fixture is a self-contained test case with its own HTML, state, templates, and component definitions.
111111

112112
For a complete guide on creating fixtures — including how to write `entry.html`, `state.json`, `templates.html`, `main.ts`, and spec files — see:
113113

114-
📄 **[Writing Fixtures](../../../packages/fast-html/test/fixtures/WRITING_FIXTURES.md)**
114+
📄 **[Writing Fixtures](../../../packages/fast-element/test/declarative/fixtures/WRITING_FIXTURES.md)**
115115

116116
### Quick example
117117

.github/workflows/ci-webui-integration.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ jobs:
4747
run: npx playwright install --with-deps chromium
4848

4949
- name: Run WebUI integration tests
50-
run: npm run test:webui-integration -w @microsoft/fast-html
50+
run: npm run test:webui-integration -w @microsoft/fast-element
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "none",
3+
"comment": "Update fast-build documentation to reference the fast-element declarative HTML docs.",
4+
"packageName": "@microsoft/fast-build",
5+
"email": "7559015+janechu@users.noreply.github.com",
6+
"dependentChangeType": "none"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "none",
3+
"comment": "Simplify fast-element declarative package documentation and test configuration without changing the published API.",
4+
"packageName": "@microsoft/fast-element",
5+
"email": "7559015+janechu@users.noreply.github.com",
6+
"dependentChangeType": "none"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "major",
3+
"comment": "Move declarative HTML APIs into @microsoft/fast-element/declarative.js and remove the @microsoft/fast-html package.",
4+
"packageName": "@microsoft/fast-element",
5+
"dependentChangeType": "none",
6+
"email": "7559015+janechu@users.noreply.github.com"
7+
}

change/@microsoft-fast-html-1776500147.json

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

change/@microsoft-fast-html-2751da26-46f3-4c7d-ae10-4437c26b800b.json

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

change/@microsoft-fast-html-30f1b1bf-454c-4952-a54c-7a0a5131b741.json

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

0 commit comments

Comments
 (0)