feat(web-components): enable DSD/SSR support and testing#36105
Draft
radium-v wants to merge 25 commits intomicrosoft:masterfrom
Draft
feat(web-components): enable DSD/SSR support and testing#36105radium-v wants to merge 25 commits intomicrosoft:masterfrom
radium-v wants to merge 25 commits intomicrosoft:masterfrom
Conversation
📊 Bundle size report✅ No changes found |
|
Pull request demo site: URL |
Contributor
There was a problem hiding this comment.
Pull request overview
Migrates @fluentui/web-components from its custom Playwright harness to @microsoft/fast-test-harness, adds SSR/DSD-oriented entrypoints and generated assets, and updates the web-components test suite to run under the new infrastructure.
Changes:
- Replaced the package-local Playwright harness/config with FAST test-harness/Vite-based setup and SSR client/server entries.
- Added
define-async.tshydration entrypoints across many web components plus new tests for previously uncovered components. - Updated many existing specs to the new fixture lifecycle and added generated-token CSS support for SSR fixtures.
Reviewed changes
Copilot reviewed 118 out of 120 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| yarn.lock | Locks new FAST SSR/test-harness dependencies |
| packages/web-components/test/vite.config.ts | Configures Vite test harness public assets |
| packages/web-components/test/ssr.html | Adds SSR HTML shell |
| packages/web-components/test/src/vite-env.d.ts | Adds Vite client typings |
| packages/web-components/test/src/main.ts | Switches CSR bootstrapping to glob-based registration |
| packages/web-components/test/src/entry-server.ts | Adds SSR renderer entry |
| packages/web-components/test/src/entry-client.ts | Adds hydration client entry |
| packages/web-components/test/playwright/index.ts | Removes old local Playwright harness |
| packages/web-components/test/playwright/fast-fixture.ts | Removes old custom fixture implementation |
| packages/web-components/test/playwright/assertions.ts | Removes old custom assertions |
| packages/web-components/test/index.html | Updates CSR harness HTML |
| packages/web-components/test/harness/vite.config.ts | Removes legacy harness config |
| packages/web-components/src/tree/tree.spec.ts | Migrates test import |
| packages/web-components/src/tree/define-async.ts | Adds async define entry |
| packages/web-components/src/tree-item/tree-item.template.ts | Removes slot binding from template root |
| packages/web-components/src/tree-item/tree-item.spec.ts | Migrates test import |
| packages/web-components/src/tree-item/tree-item.base.ts | Moves slot assignment to connectedCallback |
| packages/web-components/src/tree-item/define-async.ts | Adds async define entry |
| packages/web-components/src/tooltip/tooltip.spec.ts | Migrates tests and explicit setup |
| packages/web-components/src/tooltip/define-async.ts | Adds async define entry |
| packages/web-components/src/toggle-button/toggle-button.ts | Uses elementInternals guard |
| packages/web-components/src/toggle-button/toggle-button.spec.ts | Migrates tests and explicit setup |
| packages/web-components/src/toggle-button/define-async.ts | Adds async define entry |
| packages/web-components/src/theme/set-theme.spec.ts | Migrates test import |
| packages/web-components/src/textarea/textarea.spec.ts | Updates fixture usage and stability |
| packages/web-components/src/text/text.styles.ts | Removes duplicate style rule |
| packages/web-components/src/text/text.spec.ts | Migrates tests and default content |
| packages/web-components/src/text/define-async.ts | Adds async define entry |
| packages/web-components/src/text-input/text-input.spec.ts | Migrates tests and explicit setup |
| packages/web-components/src/text-input/define-async.ts | Adds async define entry |
| packages/web-components/src/tablist/tablist.spec.ts | Migrates tests and setup flow |
| packages/web-components/src/tablist/define-async.ts | Adds async define entry |
| packages/web-components/src/tab/tab.spec.ts | Migrates test import |
| packages/web-components/src/tab/define-async.ts | Adds async define entry |
| packages/web-components/src/switch/switch.spec.ts | Migrates tests and explicit setup |
| packages/web-components/src/switch/define-async.ts | Adds async define entry |
| packages/web-components/src/spinner/spinner.spec.ts | Switches repeated setup to updates |
| packages/web-components/src/spinner/define-async.ts | Adds async define entry |
| packages/web-components/src/slider/slider.spec.ts | Migrates tests and explicit setup |
| packages/web-components/src/slider/define-async.ts | Adds async define entry |
| packages/web-components/src/rating-display/rating-display.spec.ts | Migrates tests and explicit setup |
| packages/web-components/src/rating-display/define-async.ts | Adds async define entry |
| packages/web-components/src/radio/radio.spec.ts | Migrates test import |
| packages/web-components/src/radio/define-async.ts | Adds async define entry |
| packages/web-components/src/radio-group/radio-group.spec.ts | Migrates test import |
| packages/web-components/src/radio-group/define-async.ts | Adds async define entry |
| packages/web-components/src/progress-bar/progress-bar.spec.ts | Migrates tests and explicit setup |
| packages/web-components/src/progress-bar/define-async.ts | Adds async define entry |
| packages/web-components/src/option/option.spec.ts | Migrates test import |
| packages/web-components/src/option/define-async.ts | Adds async define entry |
| packages/web-components/src/message-bar/message-bar.spec.ts | Migrates tests and updateTemplate usage |
| packages/web-components/src/message-bar/define-async.ts | Adds async define entry |
| packages/web-components/src/menu/menu.spec.ts | Migrates tests and focus/contextmenu handling |
| packages/web-components/src/menu/define-async.ts | Adds async define entry |
| packages/web-components/src/menu-list/menu-list.template.ts | Removes slot binding from template root |
| packages/web-components/src/menu-list/menu-list.spec.ts | Migrates tests and explicit setup |
| packages/web-components/src/menu-list/menu-list.base.ts | Moves submenu slot assignment to connectedCallback |
| packages/web-components/src/menu-list/define-async.ts | Adds async define entry |
| packages/web-components/src/menu-item/menu-item.spec.ts | Adds new menu-item tests |
| packages/web-components/src/menu-item/define-async.ts | Adds async define entry |
| packages/web-components/src/menu-button/menu-button.styles.ts | Adds local style re-export |
| packages/web-components/src/menu-button/menu-button.spec.ts | Adds new menu-button test coverage |
| packages/web-components/src/menu-button/menu-button.definition.ts | Switches to local style module |
| packages/web-components/src/menu-button/index.ts | Reorders/extends exports |
| packages/web-components/src/menu-button/define-async.ts | Adds async define entry |
| packages/web-components/src/listbox/listbox.spec.ts | Migrates test import |
| packages/web-components/src/listbox/define-async.ts | Adds async define entry |
| packages/web-components/src/link/link.spec.ts | Migrates tests and updateTemplate usage |
| packages/web-components/src/link/define-async.ts | Adds async define entry |
| packages/web-components/src/label/label.spec.ts | Migrates tests and updateTemplate usage |
| packages/web-components/src/label/define-async.ts | Adds async define entry |
| packages/web-components/src/image/image.spec.ts | Migrates tests and fixture asset path |
| packages/web-components/src/image/define-async.ts | Adds async define entry |
| packages/web-components/src/field/field.spec.ts | Migrates test import |
| packages/web-components/src/field/define-async.ts | Adds async define entry with focus delegation |
| packages/web-components/src/dropdown/dropdown.spec.ts | Migrates tests and stabilizes form interactions |
| packages/web-components/src/dropdown/define-async.ts | Adds async define entry |
| packages/web-components/src/drawer/drawer.styles.ts | Removes redundant max-width |
| packages/web-components/src/drawer/drawer.spec.ts | Migrates tests and explicit nested body setup |
| packages/web-components/src/drawer/define-async.ts | Adds async define entry |
| packages/web-components/src/drawer-body/drawer-body.spec.ts | Adds new drawer-body tests |
| packages/web-components/src/drawer-body/define-async.ts | Adds async define entry |
| packages/web-components/src/divider/divider.spec.ts | Migrates tests and adds slot-content case |
| packages/web-components/src/divider/define-async.ts | Adds async define entry |
| packages/web-components/src/dialog/dialog.spec.ts | Migrates tests and explicit setup |
| packages/web-components/src/dialog/define-async.ts | Adds async define entry |
| packages/web-components/src/dialog-body/dialog-body.styles.ts | Fixes stylesheet block structure |
| packages/web-components/src/dialog-body/dialog-body.spec.ts | Adds new dialog-body tests |
| packages/web-components/src/dialog-body/define-async.ts | Adds async define entry |
| packages/web-components/src/counter-badge/define-async.ts | Adds async define entry |
| packages/web-components/src/counter-badge/counter-badge.spec.ts | Migrates tests and updateTemplate usage |
| packages/web-components/src/compound-button/define-async.ts | Adds async define entry |
| packages/web-components/src/compound-button/compound-button.template.ts | Aligns template root with button |
| packages/web-components/src/compound-button/compound-button.spec.ts | Adds broad compound-button coverage |
| packages/web-components/src/checkbox/define-async.ts | Adds async define entry |
| packages/web-components/src/checkbox/checkbox.spec.ts | Migrates tests and setup details |
| packages/web-components/src/checkbox/checkbox.base.ts | Uses elementInternals guard |
| packages/web-components/src/button/define-async.ts | Adds async define entry |
| packages/web-components/src/button/button.spec.ts | Migrates tests and SSR autofocus skip |
| packages/web-components/src/badge/define-async.ts | Adds async define entry |
| packages/web-components/src/badge/badge.spec.ts | Refactors repeated attribute tests |
| packages/web-components/src/avatar/define-async.ts | Adds async define entry |
| packages/web-components/src/avatar/avatar.spec.ts | Migrates tests and splits step-based cases |
| packages/web-components/src/anchor-button/define-async.ts | Adds async define entry |
| packages/web-components/src/anchor-button/anchor-button.spec.ts | Adjusts navigation assertions for harness |
| packages/web-components/src/accordion/define-async.ts | Adds async define entry |
| packages/web-components/src/accordion/accordion.spec.ts | Migrates tests and avoids dependent WC in one case |
| packages/web-components/src/accordion-item/define-async.ts | Adds async define entry |
| packages/web-components/src/accordion-item/accordion-item.spec.ts | Updates waitFor dependency |
| packages/web-components/scripts/generate-tokens.js | Generates TS tokens and CSS token stylesheet |
| packages/web-components/scripts/e2e.js | Removes legacy e2e wrapper |
| packages/web-components/rollup.config.js | Sets rollup context |
| packages/web-components/playwright.config.ts | Switches to FAST test-harness Playwright config |
| packages/web-components/package.json | Adds SSR build steps/exports and updates scripts |
| packages/web-components/.gitignore | Ignores generated token CSS |
| packages/charts/chart-web-components/package.json | Removes unused FAST dependency |
| package.json | Adds root FAST SSR/test-harness deps |
| change/@fluentui-web-components-9e4886ef-09cc-426e-a4bf-b570d204e14b.json | Adds web-components change file |
| change/@fluentui-chart-web-components-8ab5a04f-bd00-487d-a7d5-0cd8b395e1bb.json | Adds chart package housekeeping change file |
| apps/vr-tests-web-components/package.json | Removes unused FAST dependency |
165fb07 to
902e9be
Compare
241521b to
e1c9a1d
Compare
…s run in DSD mode
…heck in setValidity and setPressedState methods
…body, drawer, and text styles
…, and adjust TypeScript config
e1c9a1d to
f1d2da5
Compare
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.
Previous Behavior
The
@fluentui/web-componentspackage used a custom internal test harness (test/playwright/) with hand-rolled fixture classes, a separate Vite build step, and Node version detection workarounds inscripts/e2e.js. Tests ran exclusively in client-side rendering (CSR) mode — there was no support for server-side rendering (SSR) or Declarative Shadow DOM (DSD) testing. The@fluentui/tokenstheme was applied only through the runtime JSsetTheme()API, making it unavailable in SSR contexts. Thefluent-compound-buttoncomponent had no tests.New Behavior
The package now uses
@microsoft/fast-test-harnessas its Playwright test infrastructure, with support for both CSR and SSR/DSD testing across all components.test/playwright/harness with@microsoft/fast-test-harness. All spec files importtestandexpectfrom the harness package. Thee2e.jsscript is simplified to generate the token stylesheet and forward toplaywright test.test/ssr.html,test/src/entry-client.ts, andtest/src/entry-server.tsusingcreateSSRRendererfor WASM-based declarative shadow DOM rendering. Addeddefine-async.tsmodules across all components to support DSD hydration viaRenderableFASTElement.defineAsync(). Entry client eagerly imports all define-async modules viaimport.meta.glob.scripts/generate-tokens.jsto also producepublic/fluent-tokens.css— a plain CSS stylesheet with allwebLightThemetoken values under:root, enabling theme support in SSR fixtures without runtime JS.fluent-compound-buttoncovering form submission, focus management, disabled states, and the description slot.test.steploops withupdateTemplate()for attribute iteration tests in avatar, tablist, and textarea specs. Fixed flaky tests. Every test now explicitly callsfastPage.setTemplate().$fastController.isConnectedwithelementInternalschecks in checkbox and toggle-button. Moved slot population toconnectedCallbackin tree-item and drawer. Cleaned up redundant style properties in dialog-body, drawer, and text. Updated compound-button template to stay in sync with button.build:ssr:templatesandbuild:ssr:stylesscripts using thefast-test-harnessCLI to generate f-template HTML and extracted CSS files intodist/esm/. Addeddefine-async.jsandtemplate.html/styles.cssto the package exports map.