mirror of
https://github.com/dotnet/skills.git
synced 2026-09-20 09:49:54 +08:00
198e58c983
* Add dotnet-blazor plugin and convert-blazor-server-to-webapp skill Add the dotnet-blazor plugin with 9 skills covering Blazor Web App development: - plan-ui-change: Plan and scaffold UI features in Blazor Web Apps - create-blazor-project: Create new Blazor projects with proper render mode setup - author-component: Author Razor components with parameters, events, lifecycle - coordinate-components: Share state across components using CascadingValueSource/scoped services - use-js-interop: Call JavaScript from Blazor and vice versa - fetch-and-send-data: HTTP data access with proper service patterns - configure-auth: Set up ASP.NET Core Identity and authorization in Blazor - collect-user-input: Build forms with EditForm, validation, and file uploads - support-prerendering: Handle prerendering lifecycle and state persistence Add convert-blazor-server-to-webapp skill to the dotnet-aspnet plugin for migrating .NET 7 Blazor Server apps to .NET 8+ Blazor Web App architecture. All 10 skills pass evaluation with quality improvements ranging from 12-50% and overfitting scores within acceptable thresholds. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Update eng/allowed-external-deps.txt * Update .gitignore --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
69 lines
3.5 KiB
YAML
69 lines
3.5 KiB
YAML
scenarios:
|
|
- name: "Equipment inventory loaded once"
|
|
prompt: |
|
|
I have an existing Blazor Web App with Interactive Server (per-page).
|
|
|
|
I need an interactive /inventory page that shows a table of equipment items
|
|
(Id, Name, Location, LastInspected date). The data comes from an EquipmentService
|
|
you should create (just return fake data, 5-10 items).
|
|
|
|
The page should show "Loading inventory..." until data is ready, then display
|
|
the table. The important thing is that when the page first loads I see the HTML
|
|
instantly (fast initial paint), but the equipment data should NOT be fetched
|
|
twice — once during the initial server render and again when the page becomes
|
|
interactive. It should only call the service once and carry that data across.
|
|
assertions:
|
|
- type: "file_exists"
|
|
path: "**/Inventory.razor"
|
|
- type: "file_contains"
|
|
path: "**/Inventory.razor"
|
|
value: "PersistentState"
|
|
- type: "file_contains"
|
|
path: "**/Inventory.razor"
|
|
value: "InteractiveServer"
|
|
- type: "file_contains"
|
|
path: "**/Inventory.razor"
|
|
value: "??="
|
|
rubric:
|
|
- "Data persists across the prerender-to-interactive handoff — uses state persistence ([PersistentState] or PersistentComponentState) with ??= pattern to avoid duplicate data fetches"
|
|
- "Component correctly shows loading state when data is null, then displays the equipment table when loaded"
|
|
- "Does NOT disable prerendering — preserves the fast initial HTML response while avoiding duplicate loads"
|
|
- "Creates a proper EquipmentService registered in DI, not inline data generation"
|
|
timeout: 600
|
|
|
|
|
|
- name: "Notifications page with live polling"
|
|
prompt: |
|
|
I have an existing Blazor Web App with Interactive Server (per-page).
|
|
|
|
I need an interactive /notifications page that:
|
|
- Loads an initial set of notifications from a NotificationService (create it with fake data)
|
|
- After the page becomes interactive, starts a background polling loop that
|
|
checks for new notifications every 5 seconds and updates the UI
|
|
- Shows a notification count badge and a list of notification messages
|
|
|
|
Important constraints:
|
|
- The initial notifications should appear in the fast server-rendered HTML
|
|
and NOT be fetched again when the page becomes interactive
|
|
- The polling loop must not run during the initial server render — only after
|
|
the page is live and interactive in the browser
|
|
- When the user navigates away, the polling should stop cleanly (no leaked tasks)
|
|
assertions:
|
|
- type: "file_exists"
|
|
path: "**/Notifications.razor"
|
|
- type: "file_contains"
|
|
path: "**/Notifications.razor"
|
|
value: "RendererInfo.IsInteractive"
|
|
- type: "file_contains"
|
|
path: "**/Notifications.razor"
|
|
value: "PersistentState"
|
|
- type: "file_contains"
|
|
path: "**/Notifications.razor"
|
|
value: "InteractiveServer"
|
|
rubric:
|
|
- "Guards the polling loop so it only runs when the component is interactive — not during prerendering"
|
|
- "Persists initial notification data across the prerender-to-interactive handoff so the service is not called twice"
|
|
- "Polling uses an async loop with CancellationTokenSource, cancelled in DisposeAsync — not System.Threading.Timer"
|
|
- "Component implements IAsyncDisposable and cancels the polling token in DisposeAsync to prevent resource leaks"
|
|
timeout: 600
|