|
1 | | -# B044: Build Flow to Check @key on Blazor Loops |
2 | | - |
3 | | -## Description |
4 | | -Create a Flow (validation/analysis tool) to automatically detect Blazor loops that are missing the `@key` directive and ensure proper key usage for performance and correctness. |
5 | | - |
6 | | -## Background |
7 | | -Blazor loops without proper `@key` directives can cause rendering issues, performance problems, and incorrect component state management when the collection changes. |
8 | | - |
9 | | -## Acceptance Criteria |
10 | | -- [ ] Detect `@for`, `@foreach` loops in Blazor components |
11 | | -- [ ] Identify loops missing `@key` directive |
12 | | -- [ ] Validate that `@key` values are unique and stable |
13 | | -- [ ] Report locations of violations with line numbers |
14 | | -- [ ] Integrate with existing build/validation pipeline |
15 | | -- [ ] Provide clear error messages with remediation guidance |
16 | | - |
17 | | -## Technical Notes |
18 | | -- Should analyze `.razor` files |
19 | | -- Consider both server-side and WebAssembly scenarios |
20 | | -- May leverage Roslyn analyzers or custom parsing |
21 | | -- Should handle nested loops appropriately |
22 | | - |
23 | | -## Priority |
24 | | -Medium - Code quality and performance improvement |
25 | | - |
26 | | -## Labels |
27 | | -- flow |
28 | | -- blazor |
29 | | -- validation |
30 | | -- performance |
31 | | -- code-quality |
| 1 | +# B044: Build Flow to Check @key on Blazor Loops |
| 2 | + |
| 3 | +## Description |
| 4 | +Create a Flow (validation/analysis tool) to automatically detect Blazor loops that are missing the `@key` directive and ensure proper key usage for performance and correctness. |
| 5 | + |
| 6 | +## Background |
| 7 | +Blazor loops without proper `@key` directives can cause rendering issues, performance problems, and incorrect component state management when the collection changes. |
| 8 | + |
| 9 | +## Requirements |
| 10 | +- Detect `@for`, `@foreach` loops in Blazor components |
| 11 | +- Identify loops missing `@key` directive |
| 12 | +- Validate that `@key` values are unique and stable |
| 13 | +- Report locations of violations with line numbers |
| 14 | +- Integrate with existing build/validation pipeline |
| 15 | +- Provide clear error messages with remediation guidance |
| 16 | + |
| 17 | +## Checklist |
| 18 | + |
| 19 | +### Design |
| 20 | +- [ ] Design loop detection algorithm for .razor files |
| 21 | +- [ ] Define validation rules for @key usage |
| 22 | +- [ ] Plan integration with build pipeline |
| 23 | +- [ ] Design error reporting format |
| 24 | + |
| 25 | +### Implementation |
| 26 | +- [ ] Create Roslyn analyzer or custom parser |
| 27 | +- [ ] Implement loop detection logic |
| 28 | +- [ ] Add @key validation rules |
| 29 | +- [ ] Build error reporting system |
| 30 | +- [ ] Add build pipeline integration |
| 31 | + |
| 32 | +### Documentation |
| 33 | +- [ ] Create usage documentation |
| 34 | +- [ ] Document configuration options |
| 35 | +- [ ] Add troubleshooting guide |
| 36 | + |
| 37 | +## Notes |
| 38 | + |
| 39 | +Should analyze `.razor` files and consider both server-side and WebAssembly scenarios. May leverage Roslyn analyzers or custom parsing. Should handle nested loops appropriately. |
| 40 | + |
| 41 | +Priority: Medium - Code quality and performance improvement |
| 42 | + |
| 43 | +Labels: flow, blazor, validation, performance, code-quality |
0 commit comments