-
Notifications
You must be signed in to change notification settings - Fork 2.9k
feat(web-components): add SSR support via Declarative Shadow DOM modules #36247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
radium-v
merged 44 commits into
microsoft:master
from
radium-v:users/radium-v/wc-add-ssr-support
May 27, 2026
Merged
Changes from all commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
557e291
feat(web-components): update dependencies and add SSR build scripts
radium-v 230bf46
update fast-test-harness dependency to version 0.3.0
radium-v 39ac840
add SSR entry modules and HTML template for testing
radium-v eb9d85f
add DSD modules for accordion and accordion-item
radium-v f482514
add DSD modules for anchor-button
radium-v a998a3c
add DSD modules for avatar
radium-v 3272a3e
add DSD modules for badge
radium-v e168e22
add DSD modules for button
radium-v d29a066
add DSD modules for checkbox
radium-v c1c5f62
add DSD modules for compound-button
radium-v 199bd60
add DSD modules for counter-badge
radium-v 4f029f9
add DSD modules for dialog and dialog-body
radium-v 746c0fc
add DSD modules for divider
radium-v 0e594c9
add DSD modules for drawer and drawer-body
radium-v 92aa7d8
add DSD modules for dropdown, listbox, and option
radium-v a9f66f8
add DSD modules for field
radium-v bc6ea6e
add DSD modules for image
radium-v 2956f84
add DSD modules for label
radium-v 74a14d8
add DSD modules for link
radium-v d51875e
add DSD modules for menu
radium-v 317ebdd
add DSD modules for menu-button
radium-v 0a4d80a
add DSD modules for menu-item
radium-v 91729b4
add DSD modules for menu-list
radium-v cb73195
add DSD modules for message-bar
radium-v 84f14e4
add DSD modules for progress-bar
radium-v ee00a68
add DSD modules for radio
radium-v 2417a00
add DSD modules for radio-group
radium-v 62faef2
add DSD modules for rating-display
radium-v 34f1968
add DSD modules for slider
radium-v 8fdbf83
add DSD modules for spinner
radium-v f2b6fee
add DSD modules for switch
radium-v 77fa800
add DSD modules for tab
radium-v f7c474e
add DSD modules for tablist
radium-v 0c87661
add DSD modules for text
radium-v 57c4a16
add DSD modules for text-input
radium-v 7e5457d
add DSD modules for textarea
radium-v 0771f9c
skip setTheme tests in SSR
radium-v 7f862e9
add DSD modules for toggle-button
radium-v 1c85fe3
add DSD modules for tooltip
radium-v adf3a10
update tooltip anchor positioning polyfill handling
radium-v 898d6ce
add DSD modules for tree and tree-item
radium-v 7a8fb3a
add changefile
radium-v d9b43de
address PR feedback
radium-v c80688c
add SSR support to Playwright configuration and streamline e2e test e…
radium-v File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
change/@fluentui-web-components-ff6dd466-4b60-4451-ab21-3929917fa50a.json
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "type": "prerelease", | ||
| "comment": "feat(web-components): add SSR support via Declarative Shadow DOM modules", | ||
| "packageName": "@fluentui/web-components", | ||
| "email": "863023+radium-v@users.noreply.github.com", | ||
| "dependentChangeType": "patch" | ||
| } | ||
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,42 @@ | ||
| import defaultConfig from '@microsoft/fast-test-harness/playwright.config.mjs'; | ||
| import { defineConfig } from '@playwright/test'; | ||
| import { defineConfig, devices } from '@playwright/test'; | ||
|
|
||
| const CI = process.env.CI === 'true'; | ||
|
|
||
| // Duplicate each browser project across CSR and SSR rendering modes so a | ||
| // single `playwright test` run exercises both. Per-test overrides | ||
| // (e.g. `test.use({ ssr: true })`) still take precedence over the | ||
| // project-level value. | ||
| // | ||
| // TODO: Remove this local axis once the equivalent change lands in | ||
| // @microsoft/fast-test-harness/playwright.config.mjs. | ||
| const browsers = [ | ||
| { name: 'chromium', use: devices['Desktop Chrome'] }, | ||
| { name: 'firefox', use: devices['Desktop Firefox'] }, | ||
| { | ||
| name: 'webkit', | ||
| use: { | ||
| ...devices['Desktop Safari'], | ||
| deviceScaleFactor: 1, | ||
| }, | ||
| }, | ||
| ]; | ||
|
|
||
| const modes = [ | ||
| { suffix: 'csr', ssr: false }, | ||
| { suffix: 'ssr', ssr: true }, | ||
| ]; | ||
|
|
||
| const projects = browsers.flatMap(browser => | ||
| modes.map(mode => ({ | ||
| name: `${browser.name}-${mode.suffix}`, | ||
| use: { ...browser.use, ssr: mode.ssr }, | ||
| })), | ||
| ); | ||
|
|
||
| export default defineConfig({ | ||
| ...defaultConfig, | ||
| projects, | ||
| reporter: CI ? 'github' : 'list', | ||
| testMatch: 'src/**/*.spec.ts', | ||
| }); |
15 changes: 15 additions & 0 deletions
15
packages/web-components/src/accordion-item/accordion-item.definition-async.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| import type { PartialFASTElementDefinition } from '@microsoft/fast-element'; | ||
| import { tagName } from './accordion-item.options.js'; | ||
|
|
||
| /** | ||
| * The async definition configuration for the fluent-accordion-item element. | ||
| * | ||
| * @public | ||
| * @remarks | ||
| * This is used in server-side rendering (SSR) scenarios where the template | ||
| * is provided as a deferred option to be hydrated later. | ||
| */ | ||
| export const definition: PartialFASTElementDefinition = { | ||
| name: tagName, | ||
| templateOptions: 'defer-and-hydrate', | ||
| }; |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| import { RenderableFASTElement } from '@microsoft/fast-html'; | ||
| import { definition } from './accordion-item.definition-async.js'; | ||
| import { AccordionItem } from './accordion-item.js'; | ||
|
|
||
| RenderableFASTElement(AccordionItem).defineAsync(definition); |
15 changes: 15 additions & 0 deletions
15
packages/web-components/src/accordion/accordion.definition-async.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| import { type PartialFASTElementDefinition } from '@microsoft/fast-element'; | ||
| import { tagName } from './accordion.options.js'; | ||
|
|
||
| /** | ||
| * The async definition configuration for the fluent-accordion element. | ||
| * | ||
| * @public | ||
| * @remarks | ||
| * This is used in server-side rendering (SSR) scenarios where the template | ||
| * is provided as a deferred option to be hydrated later. | ||
| */ | ||
| export const declarativeDefinition: PartialFASTElementDefinition = { | ||
|
radium-v marked this conversation as resolved.
|
||
| name: tagName, | ||
| templateOptions: 'defer-and-hydrate', | ||
| } as const; | ||
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| import { RenderableFASTElement } from '@microsoft/fast-html'; | ||
| import { declarativeDefinition } from './accordion.definition-async.js'; | ||
| import { Accordion } from './accordion.js'; | ||
|
|
||
| RenderableFASTElement(Accordion).defineAsync(declarativeDefinition); |
15 changes: 15 additions & 0 deletions
15
packages/web-components/src/anchor-button/anchor-button.definition-async.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| import type { PartialFASTElementDefinition } from '@microsoft/fast-element'; | ||
| import { tagName } from './anchor-button.options.js'; | ||
|
|
||
| /** | ||
| * The async definition configuration for the fluent-anchor-button element. | ||
| * | ||
| * @public | ||
| * @remarks | ||
| * This is used in server-side rendering (SSR) scenarios where the template | ||
| * is provided as a deferred option to be hydrated later. | ||
| */ | ||
| export const definition: PartialFASTElementDefinition = { | ||
| name: tagName, | ||
| templateOptions: 'defer-and-hydrate', | ||
| }; |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| import { RenderableFASTElement } from '@microsoft/fast-html'; | ||
| import { definition } from './anchor-button.definition-async.js'; | ||
| import { AnchorButton } from './anchor-button.js'; | ||
|
|
||
| RenderableFASTElement(AnchorButton).defineAsync(definition); |
15 changes: 15 additions & 0 deletions
15
packages/web-components/src/avatar/avatar.definition-async.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| import type { PartialFASTElementDefinition } from '@microsoft/fast-element'; | ||
| import { tagName } from './avatar.options.js'; | ||
|
|
||
| /** | ||
| * The async definition configuration for the fluent-avatar element. | ||
| * | ||
| * @public | ||
| * @remarks | ||
| * This is used in server-side rendering (SSR) scenarios where the template | ||
| * is provided as a deferred option to be hydrated later. | ||
| */ | ||
| export const definition: PartialFASTElementDefinition = { | ||
| name: tagName, | ||
| templateOptions: 'defer-and-hydrate', | ||
| }; |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| import { RenderableFASTElement } from '@microsoft/fast-html'; | ||
| import { definition } from './avatar.definition-async.js'; | ||
| import { Avatar } from './avatar.js'; | ||
|
|
||
| RenderableFASTElement(Avatar).defineAsync(definition); |
15 changes: 15 additions & 0 deletions
15
packages/web-components/src/badge/badge.definition-async.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| import type { PartialFASTElementDefinition } from '@microsoft/fast-element'; | ||
| import { tagName } from './badge.options.js'; | ||
|
|
||
| /** | ||
| * The async definition configuration for the fluent-badge element. | ||
| * | ||
| * @public | ||
| * @remarks | ||
| * This is used in server-side rendering (SSR) scenarios where the template | ||
| * is provided as a deferred option to be hydrated later. | ||
| */ | ||
| export const definition: PartialFASTElementDefinition = { | ||
| name: tagName, | ||
| templateOptions: 'defer-and-hydrate', | ||
| }; |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| import { RenderableFASTElement } from '@microsoft/fast-html'; | ||
| import { definition } from './badge.definition-async.js'; | ||
| import { Badge } from './badge.js'; | ||
|
|
||
| RenderableFASTElement(Badge).defineAsync(definition); |
15 changes: 15 additions & 0 deletions
15
packages/web-components/src/button/button.definition-async.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| import type { PartialFASTElementDefinition } from '@microsoft/fast-element'; | ||
| import { tagName } from './button.options.js'; | ||
|
|
||
| /** | ||
| * The async definition configuration for the fluent-button element. | ||
| * | ||
| * @public | ||
| * @remarks | ||
| * This is used in server-side rendering (SSR) scenarios where the template | ||
| * is provided as a deferred option to be hydrated later. | ||
| */ | ||
| export const definition: PartialFASTElementDefinition = { | ||
| name: tagName, | ||
| templateOptions: 'defer-and-hydrate', | ||
| }; |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| import { RenderableFASTElement } from '@microsoft/fast-html'; | ||
| import { definition } from './button.definition-async.js'; | ||
| import { Button } from './button.js'; | ||
|
|
||
| RenderableFASTElement(Button).defineAsync(definition); |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.