Skip to content

Commit b8a06bd

Browse files
csharpfritzCopilot
andauthored
feat: ASCX and Custom WebControl migration support (FritzAndFriends#559)
* Removed wingtip message files * docs(ai-team): ASCX/custom-control review — decisions merged and archived Session: 2026-05-30-ascx-custom-control-review Requested by: Jeffrey T. Fritz Changes: - Archived 10 decisions from 2026-04-27 to 2026-05-16 (older than 7 days) - Merged 6 decisions from inbox: Executive Summary pattern, CLI code-behind fixes (Bishop x4), helper transforms, L1 quality, SSR form contract, MasterPage bridge contract - Updated cross-agent history for Beast, Bishop, Cyclops, Forge - Archived Beast and Bishop history files (exceeded 15KB each) - Created orchestration log and session log * docs(ai-team): Merge ASCX→.razor user directive + control-migration session Session: 2026-05-30-control-migration Requested by: Jeffrey T. Fritz Changes: - Merged user directive on ASCX user control conversion preference - Logged control-migration issue planning session - Updated Forge history with team decision - Documented ASCX→.razor.cs backing approach in team memory * docs(forge): ASCX/custom-control migration planning and roadmap - Create dev-docs/control-migration/ folder with comprehensive planning - Add README.md with work breakdown, priority matrix, and acceptance criteria - Add track documents for P0+P1 work: - track-webconfig-parser.md: Parse Web.config custom control registrations - track-ascx-analyzer.md: Extract properties/events from ASCX code-behind - track-contenttemplate.md: Unwrap template markup to Blazor equivalents - track-findcontrol.md: Rewrite FindControl calls to @ref references This unblocks the #1 CLI gap: ASCX and custom-control support. Implementation tracks P0 (foundation: parser + analyzer) → P1 (transforms) → P2 (scaffolding). GitHub issues created: FritzAndFriends#555-FritzAndFriends#558 (P0 foundation + P1 transforms) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * docs(ai-team): ASCX/Custom-Control Migration Planning completed Session: 2026-05-30-control-migration-completion Requested by: Copilot Changes: - Merged Forge's ASCX/custom-control migration roadmap to decisions.md - Created session log for control-migration planning completion - Appended team update to Forge's history tracking - No entries archived (all within 30-day window) - Processed 1 inbox file, 0 duplicates Team decision: 3-stream ASCX migration plan established (P0 infrastructure, P1 transforms, P2-P3 deferred tooling) * Advance ASCX/custom-control migration P1 coverage Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * feat(cli): add Bind(), DataBinder.Eval() support + lifecycle test coverage - ContentTemplateUnwrapperTransform now handles <%# Bind(...) %> expressions - ContentTemplateUnwrapperTransform now handles DataBinder.Eval(Container.DataItem, ...) - Added tests for Bind with format strings, DataBinder.Eval with/without format - Added PageLifecycleTransform tests for Page_Init and Page_PreRender conversions - Updated dev-docs to reflect lifecycle transforms are now complete - CLI tests: 869 → 875 (all passing) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * feat(runtime): promote FindControl to formal BWFC runtime contract - Harden BaseWebFormsComponent with dictionary-indexed child lookup (O(1)) - Add RegisterChildControl/UnregisterChildControl for lifecycle management - Unregister children on disposal to prevent stale references - Add OnControlTreeReadyAsync lifecycle hook for controls-ready phase - Remove FindControlComponentRefTransform from CLI pipeline (no more rewriting) - Replace rewrite tests with preservation tests (verify calls stay unchanged) - Add 7 bUnit tests: direct/nested/chained lookup, case-insensitive, casts FindControl is now a runtime feature — migrated code keeps its original FindControl syntax and it works without CLI code-behind rewriting. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * feat(samples): add FindControl live demo, Playwright tests, and doc update - Create /migration/findcontrol sample page with 4 live demos: direct child lookup, nested/recursive, chained, case-insensitive - Add Playwright integration tests (4 tests) in AfterBlazorServerSide.Tests - Register in ComponentCatalog under Migration Helpers - Update docs/Migration/FindControl-Migration.md: - Rename from 'Migrating Away' to 'FindControl in BWFC' - Lead with runtime support (zero code rewrites) - Document hardened runtime contract (O(1) index, lifecycle hook) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix(samples): rename Wizard.razor to WizardSample.razor to resolve naming conflict The page component type 'Wizard' in namespace AfterBlazorServerSide.Components.Pages.ControlSamples.Wizard collided with BlazorWebFormsComponents.Wizard, causing RZ9985 errors. Renaming the sample page to WizardSample.razor resolves the ambiguity while keeping the same @page route (/ControlSamples/Wizard). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix(samples): make FindControl demo interactive with code-beside-result layout - Each demo now shows code on the left and live result on the right - FindControl actually sets Text values (matching the code samples) - TextBoxes start empty and get populated by FindControl calls - Updated Playwright assertions to match new result text Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * docs: mark P1 complete — FindControl is runtime, ContentTemplate done Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix(cli): handle static methods and Server.MapPath ordering in HttpContextAccessorTransform - Skip HttpContext.Current.Server patterns (leave for ServerShimTransform at order 330) - Detect static method usage and emit static field + Configure() pattern instead of instance field + constructor injection - Early-exit when no accessor references remain after skip logic - Add 4 new tests: static method pattern, Server.MapPath skip, mixed patterns, and pipeline integration (ExceptionUtility end-to-end) Fixes the malformed _httpContextAccessor.HttpContext?.Path.Combine(...) output and the static-method-can't-access-instance-field compile error exposed by WingtipToys run93. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * feat(P2): add WebControl/UserControl/Control compat classes and lifecycle auto-wiring P2-A: Namespace remap instead of base-class swap - Add UserControl.cs and Control.cs compatibility classes - UsingStripTransform replaces System.Web.UI.* with BlazorWebFormsComponents.CustomControls - BaseClassStripTransform preserves WebControl/CompositeControl/UserControl/Control inheritance - Update L1 golden files (TC21, TC29, TC31) for new using statement P2-B: Lifecycle auto-wiring via virtual methods in BaseWebFormsComponent - Add virtual Page_Init, Page_Load, Page_PreRender, Page_Unload methods - Subclasses override directly — no reflection needed - Called at correct Blazor lifecycle points alongside EventCallback equivalents - Add 5 bUnit tests for lifecycle auto-wiring Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix(cli): only add CustomControls using for control-derived files Move 'using BlazorWebFormsComponents.CustomControls;' insertion from UsingStripTransform to BaseClassStripTransform so it is only added when the file actually inherits a CustomControls base class (WebControl, CompositeControl, UserControl, Control). This prevents ambiguous reference errors with Panel, PlaceHolder, and Literal which exist in both BlazorWebFormsComponents and BlazorWebFormsComponents.CustomControls. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * docs: add WTT run94 benchmark report (26/26 passing) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * feat(cli): inject @inherits directive for CustomControls base classes When a code-behind inherits WebControl, CompositeControl, UserControl, or Control, the transform now injects @inherits and @using directives into the .razor markup. This prevents CS0263 (partial class base class conflict) since the Razor compiler defaults to ComponentBase when no @inherits directive is present. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * feat: add WebControl RenderContents tests, sample page, and documentation - Add StatusBadge and InfoCard test components demonstrating the TagKey + RenderContents + AddAttributesToRender pattern - Add 15 bUnit tests covering rendering, attributes, styles, visibility - Add sample page at /ControlSamples/Migration/CustomWebControl - Add Playwright integration tests for the sample page - Add docs/Migration/CustomWebControl.md documentation - Register in ComponentCatalog and mkdocs.yml Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * docs: promote custom WebControl migration message to README Highlight the key tenet: change one using statement, keep your RenderContents/TagKey/AddAttributesToRender code unchanged. Reinforces the principle that developers rewrite as little code as possible. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * feat(toolkit): add ASCX and Custom WebControl migration skills - bwfc-ascx-migration: guides .ascx → .razor conversion, code-behind preservation, tag prefix resolution, property/event mapping - bwfc-custom-control-migration: guides RenderContents/HtmlTextWriter preservation, TagKey mapping, the one-using-change pattern - Updated migration-toolkit README with new skill references Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * feat(toolkit): wire ASCX and Custom WebControl skills into migration pipeline Connect the new skills to the migration workflow by adding them to: - wingtip-migration-test Phase 2 skill table + reference docs - contoso-migration-test Phase 2 skill table + description - migration-standards Layer 2 work items - copilot-instructions-template References section Skills are now automatically loaded during L2 repair when .ascx or custom WebControl files are encountered during benchmark runs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix(skills): benchmark skills reference migration-toolkit directly Benchmark workflow skills should simulate what end-users do: use the migration-toolkit as a whole, not enumerate individual skills. The toolkit itself knows which skills to apply based on what's encountered. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * docs: mark all ASCX/custom-control migration items complete Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * docs: add WTT run95 benchmark report (26/26 passing) Validates feature/ascx-custom-control-migration branch does not regress the WingtipToys migration. Same L2 repairs as run94 needed (ExceptionUtility DI, SQLite switch, seed data restore). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 2398866 commit b8a06bd

118 files changed

Lines changed: 5862 additions & 2828 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/skills/contoso-migration-test/SKILL.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: contoso-migration-test
3-
description: "**WORKFLOW SKILL** — Execute end-to-end ContosoUniversity migration benchmark: clear output folder, run L1 script + L2 Copilot transforms, build, run Playwright acceptance tests, and generate a numbered run report. WHEN: \"run contoso migration test\", \"test contoso university migration\", \"contoso migration benchmark\", \"run CU migration\". INVOKES: bwfc-migrate.ps1, bwfc-migration skill, bwfc-data-migration skill, bwfc-identity-migration skill, migration-standards skill, dotnet CLI, Playwright tests."
3+
description: "**WORKFLOW SKILL** — Execute end-to-end ContosoUniversity migration benchmark: clear output folder, run L1 script + L2 Copilot transforms, build, run Playwright acceptance tests, and generate a numbered run report. WHEN: \"run contoso migration test\", \"test contoso university migration\", \"contoso migration benchmark\", \"run CU migration\". INVOKES: migration-toolkit (scripts + skills), dotnet CLI, Playwright tests."
44
---
55

66
# ContosoUniversity Migration Test
@@ -51,14 +51,10 @@ End-to-end migration benchmark that converts the ContosoUniversity Web Forms sam
5151

5252
**Expected duration:** 20–30 minutes
5353

54-
Load and apply all four migration skills from `migration-toolkit/skills/`:
54+
Load and apply the migration toolkit from `migration-toolkit/`:
5555

56-
| Skill | Responsibility |
57-
|-------|---------------|
58-
| `migration-standards` | Target architecture (.NET 10, Server Interactive), page base class, render mode |
59-
| `bwfc-migration` | Control translation, data binding expressions, Master→Layout, code-behind lifecycle |
60-
| `bwfc-data-migration` | EF6→EF Core, Session→Scoped services, Global.asax→Program.cs, Web.config→appsettings |
61-
| `bwfc-identity-migration` | Identity/auth migration (if applicable to source) |
56+
- Read `migration-toolkit/README.md` for the overall approach and key principles
57+
- Read `migration-toolkit/skills/` — the toolkit contains all the skills needed for the repair phase; apply whichever skills are relevant to the errors and patterns encountered in the generated output
6258

6359
**Key transforms to execute:**
6460
- Convert code-behind lifecycle (`Page_Load``OnInitializedAsync`)

.github/skills/wingtip-migration-test/SKILL.md

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: wingtip-migration-test
3-
description: "**WORKFLOW SKILL** - Execute the end-to-end WingtipToys migration benchmark: clear samples\\AfterWingtipToys, run the migration-toolkit against samples\\WingtipToys, repair the generated app until Playwright acceptance tests pass, and write a numbered run report with embedded screenshots under dev-docs\\migration-tests\\wingtiptoys. WHEN: \"run Wingtip migration\", \"test WingtipToys migration\", \"Wingtip benchmark\", \"migrate WingtipToys\", \"rerun Wingtip migration\". INVOKES: migration-toolkit\\scripts\\bwfc-migrate.ps1, migration-toolkit\\skills\\migration-standards, bwfc-migration, bwfc-data-migration, bwfc-identity-migration, dotnet CLI, Playwright tests."
3+
description: "**WORKFLOW SKILL** - Execute the end-to-end WingtipToys migration benchmark: clear samples\\AfterWingtipToys, run the migration-toolkit against samples\\WingtipToys, repair the generated app until Playwright acceptance tests pass, and write a numbered run report with embedded screenshots under dev-docs\\migration-tests\\wingtiptoys. WHEN: \"run Wingtip migration\", \"test WingtipToys migration\", \"Wingtip benchmark\", \"migrate WingtipToys\", \"rerun Wingtip migration\". INVOKES: migration-toolkit (scripts + skills), dotnet CLI, Playwright tests."
44
---
55

66
# WingtipToys Migration Test
@@ -108,14 +108,10 @@ Record:
108108

109109
### Phase 2: Layer 2/3 - Skill-Guided Repair
110110

111-
Load and apply the migration toolkit skills from `migration-toolkit\skills\`:
111+
Load and apply the migration toolkit from `migration-toolkit\`:
112112

113-
| Skill | Responsibility |
114-
|-------|---------------|
115-
| `migration-standards` | Canonical migration rules, page base class, render mode, SelectMethod, shims |
116-
| `bwfc-migration` | Markup conversion, template cleanup, lifecycle conversion, master/layout migration |
117-
| `bwfc-data-migration` | EF/data-layer modernization, service registration, data access fixes |
118-
| `bwfc-identity-migration` | Authentication and account-page migration |
113+
- Read `migration-toolkit/README.md` for the overall approach and key principles
114+
- Read `migration-toolkit/skills/` — the toolkit contains all the skills needed for the repair phase; apply whichever skills are relevant to the errors and patterns encountered in the generated output
119115

120116
Repair the generated app **in place**. Do not replace it with a simplified rewrite or a fresh unrelated sample.
121117

@@ -249,11 +245,6 @@ dev-docs/
249245

250246
## Reference Documents
251247

252-
- `migration-toolkit/README.md`
253-
- `migration-toolkit/METHODOLOGY.md`
254-
- `migration-toolkit/skills/migration-standards/SKILL.md`
255-
- `migration-toolkit/skills/bwfc-migration/SKILL.md`
256-
- `migration-toolkit/skills/bwfc-data-migration/SKILL.md`
257-
- `migration-toolkit/skills/bwfc-identity-migration/SKILL.md`
248+
- `migration-toolkit/` — the full toolkit (README, METHODOLOGY, skills, scripts)
258249
- `src/WingtipToys.AcceptanceTests/TestConfiguration.cs`
259250
- `dev-docs/migration-tests/wingtiptoys/run25/report.md`

0 commit comments

Comments
 (0)