Skip to content

[pull] master from microsoft:master#474

Merged
pull[bot] merged 1 commit into
code:masterfrom
microsoft:master
May 28, 2026
Merged

[pull] master from microsoft:master#474
pull[bot] merged 1 commit into
code:masterfrom
microsoft:master

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented May 28, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

…les (#36247)

## Previous Behavior

`@fluentui/web-components` had no server-side rendering path. Components were defined and rendered only on the client, so SSR frameworks could not pre-render Fluent web components into HTML and hydrate them on load.

The e2e tests ran against a custom harness that only covered client-side rendering.

## New Behavior

`@fluentui/web-components` now supports SSR via Declarative Shadow DOM, built on `@microsoft/fast-element` and `@microsoft/fast-html`. Every component in the package ships a paired `define-async.ts` / `*.definition-async.ts` module so its template can render on the server and hydrate on the client.

The build also emits two new asset types alongside the JS modules, one pair per component (42 of each), exposed through new package subpath exports:

- `@fluentui/web-components/<component>/template.html`: declarative HTML template wrapped in `<f-template>`, consumed by `@microsoft/fast-html` to render Declarative Shadow DOM on the server.
- `@fluentui/web-components/<component>/styles.css`: plain CSS extracted from the component's styles, importable as a raw stylesheet without pulling in the component's JS.

Currently, the SSR templates and styles are generated at build time and placed in the `dist` output, but we may want to provide them as src assets in the future for easier consumption and customization.

New test harness modules (`test/src/entry-client.ts`, `test/src/entry-server.ts`) and a `test/ssr.html` entry point template exercise the DSD output end-to-end. The e2e pipeline runs SSR tests after CSR tests.

Several components needed template or base adjustments to render correctly under SSR: tooltip (anchor positioning polyfill handling), text-input, textarea, tree, and tree-item. The `theme/set-theme` tests are skipped under SSR.

## Next Steps

This PR lays the groundwork for SSR support in `@fluentui/web-components`, but there are still some follow-up tasks to complete:

- Update to the latest `@microsoft/fast-element` and remove the `@microsoft/fast-html` dependency, as DSD rendering will be directly supported in FAST in the next major release.
- Provide more detailed documentation and examples for using the SSR templates and styles.
- Add more comprehensive SSR tests covering edge cases and hydration scenarios.
@pull pull Bot locked and limited conversation to collaborators May 28, 2026
@pull pull Bot added the ⤵️ pull label May 28, 2026
@pull pull Bot merged commit 8ee8c7e into code:master May 28, 2026
@pull pull Bot had a problem deploying to github-pages May 28, 2026 12:59 Failure
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant