Skip to content

feat: add webui-todo-app example with declarative FAST HTML and webui prerendering#7424

Draft
janechu wants to merge 1 commit intomainfrom
users/janechu/update-webui-todo-example
Draft

feat: add webui-todo-app example with declarative FAST HTML and webui prerendering#7424
janechu wants to merge 1 commit intomainfrom
users/janechu/update-webui-todo-example

Conversation

@janechu
Copy link
Copy Markdown
Collaborator

@janechu janechu commented Apr 10, 2026

Pull Request

📖 Description

Adds a new examples/webui-todo-app that demonstrates FAST declarative HTML templates with @microsoft/webui prerendering and client-side hydration. This replaces and supersedes the approach from #7362.

Key features:

  • Declarative templates: Uses .html and .css files instead of imperative html/css tagged template literals
  • Server-side prerendering: webui serve --plugin=fast compiles declarative templates and renders initial state into static HTML with Declarative Shadow DOM
  • Client-side hydration: @microsoft/fast-html TemplateElement picks up prerendered DOM and attaches FAST reactive bindings via RenderableFASTElement with defineAsync and defer-and-hydrate
  • webui 0.0.6: Uses the latest @microsoft/webui release
  • esbuild bundling: Lightweight client-side bundling with esbuild
  • Todo functionality: Add items, toggle completion, delete items, remaining count display

Architecture follows the todo-fast example from the webui repo.

🎫 Issues

📑 Test Plan

  • All existing tests pass (10,917 tests)
  • npm run build succeeds for all packages including the new example
  • npm run biome:check passes with no errors

✅ Checklist

General

  • I have included a change request file using $ npm run change
  • I have added tests for my changes.
  • I have tested my changes.
  • I have updated the project documentation to reflect my changes.
  • I have read the CONTRIBUTING documentation and followed the standards for this project.

⏭ Next Steps

… prerendering

Adds a new examples/webui-todo-app that demonstrates FAST declarative HTML
templates with @microsoft/webui prerendering and client-side hydration:

- Declarative HTML templates (.html) with {{}} bindings for server rendering
  and {} bindings for client-only event handlers and refs
- CSS files co-located with component templates
- RenderableFASTElement mixin with defineAsync and defer-and-hydrate
- TemplateElement configuration with observer maps for reactive tracking
- webui CLI for serving with --plugin=fast for FAST-aware template processing
- esbuild for client-side bundling
- Initial state via data/state.json
- Todo functionality: add items, toggle completion, delete, remaining count

Based on the webui todo-fast example from microsoft/webui, adapted for
the FAST monorepo with @microsoft/webui 0.0.6.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant