You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`src/build/dom-shim.ts`| Minimal DOM shim for running FAST Element's `css` and `html` tagged templates in Node.js |
69
73
|`src/build/generate-stylesheets.ts`| Extracts compiled FAST `ElementStyles` JS modules into plain `.css` files |
70
74
|`src/build/generate-templates.ts`| Converts compiled FAST `ViewTemplate` JS modules into declarative `<f-template>` HTML files |
75
+
|`src/build/generate-webui-templates.ts`| Converts compiled FAST `ViewTemplate` JS modules into WebUI-compatible declarative shadow DOM `<template>` HTML files |
71
76
|`src/ssr/render.ts`|`createSSRRenderer` factory — scans for component build artifacts and uses the `@microsoft/fast-build` WASM module to produce SSR output |
72
77
|`src/ssr/entry-client.ts`| SSR hydration entry point — defines `<f-template>` for the browser |
73
78
|`server.mjs`| Node.js HTTP server with Vite middleware — serves CSR pages and handles SSR fixture generation |
74
-
|`start.mjs`| CLI entry point (`fast-test-harness` bin) — parses `--port`, `--base`, `--root`, `--config`, `--debug`flags via `node:util``parseArgs` and calls `startServer()`|
75
-
|`playwright.config.ts`| Shared Playwright configuration (browsers, web server, test matching) |
79
+
|`start.mjs`| CLI entry point (`fast-test-harness` bin) — supports subcommands (`serve`, `generate-templates`, `generate-stylesheets`, `generate-webui-templates`) and flags via `node:util``parseArgs`|
80
+
|`playwright.config.mjs`| Shared Playwright configuration (browsers, web server, test matching) |
76
81
|`vite.config.mjs`| Shared Vite configuration (port, resolve conditions, build settings) |
77
82
|`public/styles.css`| Base CSS reset served as a Vite public asset |
78
83
@@ -207,26 +212,31 @@ Browser GET /
207
212
208
213
The `/generate-fixture` POST endpoint handles SSR fixture generation:
209
214
210
-
```
211
-
Browser POST /generate-fixture { testId, tagName, attributes, … }
→ if debug: write to temp/ssr-<testId>.html (for inspection)
226
-
→ respond with { url: "/ssr-<testId>.html" }
215
+
```mermaid
216
+
sequenceDiagram
217
+
participant B as Browser
218
+
participant S as Server
219
+
participant V as Vite
220
+
participant E as entry-server.ts
221
+
222
+
B->>S: POST /generate-fixture { testId, tagName, … }
223
+
S->>S: Validate testId, parse attributes & styles
224
+
S->>S: Check pendingGenerations (dedup)
225
+
S->>S: Read ssr.html template
226
+
S->>V: ssrLoadModule("/src/entry-server.js")
227
+
V-->>S: entry-server module
228
+
S->>E: render(body)
229
+
E-->>S: { template, fixture, preloadLinks }
230
+
S->>S: Replace placeholders in ssr.html
231
+
S->>V: transformIndexHtml(url, assembled)
232
+
V-->>S: Transformed HTML
233
+
S->>S: Cache in fixtureCache
234
+
S-->>B: { url: "/ssr-testId.html" }
235
+
B->>S: GET /ssr-testId.html
236
+
S-->>B: Cached fixture HTML
227
237
```
228
238
229
-
A dedicated `GET /ssr-:id.html` handler serves cached fixtures directly from the in-memory `fixtureCache`. The temp file writes (when debug is enabled) are a secondary output for post-mortem inspection.
239
+
When `debug` is enabled, the server also writes fixtures to `temp/ssr-<testId>.html`for post-failure inspection.
230
240
231
241
### Caching and Deduplication
232
242
@@ -288,10 +298,10 @@ The `src/ssr/render.ts` module exports `createSSRRenderer`, a factory that scans
288
298
| Setting | Value |
289
299
|---------|-------|
290
300
|`retries`|`3` in CI, `1` locally |
291
-
|`timeout`|`30_000` in CI, `10_000` locally |
292
-
|`fullyParallel`|`true`|
301
+
|`timeout`|`10_000` in CI, `5_000` locally |
302
+
|`fullyParallel`|`true`locally, `false` in CI |
293
303
|`use.contextOptions.reducedMotion`|`"reduce"`|
294
-
|`testMatch`|`src/**/*.pw.spec.ts`|
304
+
|`testMatch`|`**/*.pw.spec.ts`|
295
305
|`reporter`|`"list"`|
296
306
|`webServer.command`|`fast-test-harness`|
297
307
|`webServer.port`|`3278` (configurable via `PORT` env var) |
@@ -316,10 +326,10 @@ The `src/ssr/render.ts` module exports `createSSRRenderer`, a factory that scans
Copy file name to clipboardExpand all lines: packages/fast-test-harness/README.md
+21-8Lines changed: 21 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -123,15 +123,17 @@ setTheme(lightTheme);
123
123
</html>
124
124
```
125
125
126
-
**`entry-client.ts`** registers components for DSD hydration using `defineAsync`:
126
+
**`entry-client.ts`**imports the harness SSR entry (which defines the `<f-template>` element) and registers components for DSD hydration using `defineAsync`:
**`entry-server.ts`** exports a `render()` function that the server calls for each `setTemplate()` request. It returns three strings that get injected into `ssr.html`:
0 commit comments