feat(examples): add chat-app and webui-todo-app SSR examples with design tokens#7526
Closed
janechu wants to merge 1 commit into
Closed
feat(examples): add chat-app and webui-todo-app SSR examples with design tokens#7526janechu wants to merge 1 commit into
janechu wants to merge 1 commit into
Conversation
- Add examples/ssr/chat-app/ — declarative FAST chat demo using @microsoft/fast-build for SSR pre-rendering and hidden-iframe streaming for assistant replies. Uses the dark theme statically. - Add examples/ssr/webui-todo-app/ — todo app using @microsoft/webui for server-side prerendering and @microsoft/fast-html for hydration. Uses the light theme statically. - Both apps consume @microsoft/fast-examples-design-system tokens via CSS custom properties. No hard-coded design values; no runtime theme switching. - Add 'examples/ssr/*' to the root workspaces config and update the workspace-level README.md, DESIGN.md, and .github/copilot-instructions to describe the new ssr/ subfolder. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Collaborator
Author
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.
Pull Request
📖 Description
Adds two new SSR example apps and adopts the shared CSS design system that landed in #7524.
examples/ssr/chat-app/— declarative FAST chat demo. Initial markup is pre-rendered with@microsoft/fast-build; each assistant reply is streamed into the transcript with the hidden-iframe +document.write()technique. Hard-coded dark theme.examples/ssr/webui-todo-app/— todo app pre-rendered by@microsoft/webuiand hydrated by@microsoft/fast-htmlvia<f-template>. Hard-coded light theme.Both apps live under the new
examples/ssr/folder (separate fromexamples/csr/) because both rely on a server-side rendering backend rather than a client-only bootstrap. Both consume@microsoft/fast-examples-design-systemfor every color, type ramp, spacing, corner, stroke, shadow, duration, and easing value throughvar(--fast-...)tokens. Neither app implements a runtime theme toggle;data-themeis set statically in the entry HTML.This change supersedes the two open PRs for these example apps:
webui-todo-app. Now rebased underexamples/ssr/and updated for the shared design system.chat-app. Now rebased underexamples/ssr/and updated for the shared design system.The merged PRs #7523 (todo-mobx-app) and #7524 (CSS-only design system) provide the conventions this PR follows.
👩💻 Reviewer Notes
examples/csr/keeps purely client-rendered examples.examples/ssr/now holds examples whose initial markup is produced server-side and hydrated in the browser. The workspace-level README, DESIGN.md, and.github/copilot-instructions.mddescribe this split.@microsoft/fast-examples-design-system/tokens.cssexactly once from its TypeScript entry. The webui-todo-app'ssrc/index.tstriggers esbuild to emitdist/index.css, whichsrc/index.htmllinks before the inline page-shell styles. The chat-app'sentry.htmllinkspublic/styles.cssdirectly, and that stylesheet is shared with every component shadow root via<link rel="stylesheet">inside each<template shadowrootmode="open">.<html data-theme="dark">(chat-app) and<html data-theme="light">(webui-todo-app). No runtime toggle, no theme persistence."@microsoft/fast-element": "^3.0.0-rc.1", so npm installs the v3 RC into the chat-app's localnode_modules. The webui-todo-app uses the workspacefast-element 2.x. Both build cleanly from the same checkout.index.html.examples/ssr/chat-app/index.htmlis regenerated bybuild-markup.mjsfromentry.html+state.json+templates.htmlon every build, so it is gitignored at the example level.📑 Test Plan
From the monorepo root:
Manual smoke test:
✅ Checklist
General
$ npm run change⏭ Next Steps