You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .squad/agents/bishop/history.md
+15Lines changed: 15 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -117,3 +117,18 @@
117
117
- Added `System.Web.HttpUtility` compatibility methods (`UrlEncode`, `UrlDecode`, `HtmlEncode`, `HtmlDecode`) backed by `System.Net.WebUtility`. Tests had to use reflection because the test graph also references the legacy `System.Web.HttpUtility` package, which makes direct symbol references ambiguous.
118
118
- Added CLI `DataBindingAttributeTransform` (Order 615) and registered it in production/test pipelines so attribute values like `NavigateUrl='<%# Item.GetUrl() %>'` become `NavigateUrl='@(Item.GetUrl())'` after prefix stripping.
119
119
- Validation: `dotnet build src\BlazorWebFormsComponents\BlazorWebFormsComponents.csproj --nologo`, `dotnet test src\BlazorWebFormsComponents.Test --nologo` (2895 passing per target), and `dotnet test tests\BlazorWebFormsComponents.Cli.Tests --nologo` (552 passing).
120
+
121
+
### 2026-05-06T16:54:14-0400 : WingtipToys Migration Run 35 � Benchmark after gap fixes (Bishop)
122
+
- Executed fresh Run 35 benchmark on commit `a6fa2455bec610b01127ab852886263f80f4bb1e` from branch `feature/wingtip-next-features-review` using `migration-toolkit\scripts\bwfc-migrate.ps1`.
123
+
- Final result: build succeeded and **25/25 Wingtip acceptance tests passed**; screenshots captured under `dev-docs\migration-tests\wingtiptoys\run35\images\`.
124
+
- Gap #3 (string Width/Height) and Gap #4 (attribute databinding transform) helped immediately in fresh output; no new `Request.QueryString.Get(...)` compile blocker surfaced.
125
+
- Gap #10 (`System.Web.HttpUtility`) still needs follow-up for real migrated apps that also reference the legacy `System.Web.HttpUtility` package; `Logic\PayPalFunctions.cs` required manual `WebUtility` substitutions to avoid symbol ambiguity.
126
+
- Biggest remaining automation gaps were invalid Razor syntax in generated markup, unsupported master-page script/bundle constructs, EF6-style `ProductContext` constructor emission, and a long tail of unresolved account/admin/mobile compile-surface pages that had to be stubbed or simplified manually.
### 2026-05-06T17:30:00-04:00: Run 35 gap transforms G1/G3/G8/G10 (Bishop)
130
+
- Added CLI markup `DisplayExpressionTransform` (Order 490) so `<%#: expr %>`, `<%=: expr %>`, and broken `@(: expr)` output normalize to valid Razor `@(...)` before the broader expression pass.
131
+
- Added code-behind transforms `HttpUtilityRewriteTransform` (Order 104) and `EfContextConstructorTransform` (Order 106); they now rewrite `HttpUtility.*` calls to `WebUtility.*`, add `using System.Net`, modernize EF6 `DbContext` string constructors to EF Core `DbContextOptions<TContext>`, and are included in `SourceFileCopier` so copied Models/Logic files are fixed too.
132
+
- Extended `ServerShim` with `Transfer`, `GetLastError`, and `ClearError`, and updated `ServerShimTransform` guidance to treat those APIs as supported compatibility shims instead of dead-end TODOs.
133
+
- Added focused regression tests for the new transforms, source-file copying, and ServerShim behavior; updated CLI docs plus migration docs so HttpUtility guidance now points to inline `WebUtility` rewrites rather than relying on the legacy shim package.
134
+
- Validation: `dotnet build src\BlazorWebFormsComponents\BlazorWebFormsComponents.csproj --nologo`, `dotnet test src\BlazorWebFormsComponents.Test --nologo`, and `dotnet test tests\BlazorWebFormsComponents.Cli.Tests --nologo`.
Run 35 exposed four recurring Layer 1 gaps in migrated Wingtip output: invalid display-expression Razor, EF6 DbContext constructor emission, unsupported `Server.*` compatibility calls, and `HttpUtility` ambiguity when migrated apps still carry the legacy package.
5
+
6
+
## Decisions
7
+
8
+
1.**Normalize Web Forms display expressions before the main expression pass.**
9
+
- Added `DisplayExpressionTransform` at Order 490.
10
+
- It converts `<%#: expr %>`, `<%=: expr %>`, and broken `@(: expr)` into `@(...)` early so later markup transforms operate on valid Razor.
11
+
12
+
2.**Modernize EF6 DbContext constructors in Layer 1 instead of leaving them for manual repair.**
13
+
- Added `EfContextConstructorTransform` at Order 106.
14
+
- It rewrites `: base("name")` constructors on `DbContext` / `IdentityDbContext` types to EF Core `DbContextOptions<TContext>` constructors and ensures `using Microsoft.EntityFrameworkCore;` exists.
15
+
16
+
3.**Treat `Server.Transfer`, `Server.GetLastError`, and `Server.ClearError` as supported shim surface.**
17
+
- Extended `ServerShim` with compatibility implementations/stubs.
18
+
- Updated CLI guidance so these calls are no longer flagged as “NO SHIM” manual rewrites.
19
+
20
+
4.**Rewrite `HttpUtility` inline instead of depending on the compatibility shim.**
21
+
- Added `HttpUtilityRewriteTransform` at Order 104.
22
+
- The CLI now rewrites supported `HttpUtility` calls directly to `WebUtility`, adds `using System.Net`, and avoids relying on `System.Web.HttpUtility` in the generated app.
23
+
24
+
5.**Apply G3/G10 fixes to copied source files, not only page code-behind.**
25
+
- Updated `SourceFileCopier` to include the new transforms so `Models`, `Logic`, and similar copied files receive the same modernization pass.
26
+
27
+
6.**Guard generated projects against the legacy HttpUtility package.**
28
+
- Added an explicit `System.Web.HttpUtility` package-strip guard in `ProjectScaffolder` and a regression assertion in scaffolding tests.
@@ -314,7 +314,7 @@ BWFC provides a comprehensive shim layer that enables Web Forms API calls to com
314
314
|**RouteConfig**|`RouteTable.Routes.MapPageRoute()`, `Routes.Ignore()`| No-op compile shim — compiles but does nothing |
315
315
|**WebFormsForm**|`<form>` POST data capture | Blazor component — wraps forms to feed `FormShim`|
316
316
317
-
> **Key insight:** With `AddBlazorWebFormsComponents()` + `@inherits WebFormsPageBase`, code-behind files using `Response.Redirect`, `Session`, `Request`, `Request.QueryString.Get()`, `IsPostBack`, `Page.Title`, `Cache`, `Server.MapPath`, `HttpUtility`, or `ClientScript`**compile and run without modification**. This shifts ~20% of previously-manual Layer 2 work into automatic Layer 1 coverage.
317
+
> **Key insight:** With `AddBlazorWebFormsComponents()` + `@inherits WebFormsPageBase`, code-behind files using `Response.Redirect`, `Session`, `Request`, `Request.QueryString.Get()`, `IsPostBack`, `Page.Title`, `Cache`, `Server.*`, or `ClientScript`**compile and run without modification**. For `HttpUtility`, the CLI now rewrites calls inline to `WebUtility` during Layer 1 so the migrated app avoids legacy package collisions. This shifts ~20% of previously-manual Layer 2 work into automatic Layer 1 coverage.
318
318
319
319
### Migration Shims (15)
320
320
@@ -327,8 +327,8 @@ These drop-in shims allow Web Forms API calls to compile and function in Blazor.
|**HttpUtility rewrite**|`HttpUtility.UrlEncode()`, `HttpUtility.UrlDecode()`, `HttpUtility.HtmlEncode()`, `HttpUtility.HtmlDecode()`|Let the CLI rewrite calls to `WebUtility` during migration|
Your Web Forms code-behind compiles **unchanged**. No manual conversion needed.
116
+
Your Web Forms code-behind compiles with minimal manual conversion. Most preserved APIs stay unchanged, and `HttpUtility` calls are normalized automatically during Layer 1.
After this single call, all Web Forms APIs work AS-IS in your migrated code — no manual conversion required.
132
+
After this single call, most Web Forms APIs work AS-IS in your migrated code. `HttpUtility` is handled by the CLI through inline `WebUtility` rewrites during Layer 1.
132
133
133
134
**Layout (`MainLayout.razor`)** — add the Page render component:
134
135
```razor
@@ -166,7 +167,7 @@ Alternatively, point Copilot at the BWFC migration skill directly:
166
167
167
168
Open each migrated `.razor` file and work through the structural transforms that the script couldn't handle. These are the patterns Copilot handles well with the migration skill:
168
169
169
-
> 💡 **Many Web Forms API calls now compile unchanged thanks to BWFC shims.**`Response.Redirect`, `Session["key"]`, `IsPostBack`, `Page.Title`, `Request.QueryString`, `Cache`, and `Server.MapPath` all work AS-IS — no conversion needed. Focus Layer 2 effort on data binding, templates, and event handler signatures.
170
+
> 💡 **Many Web Forms API calls now compile unchanged thanks to BWFC shims.**`Response.Redirect`, `Session["key"]`, `IsPostBack`, `Page.Title`, `Request.QueryString`, `Cache`, and `Server.*` all work AS-IS. `HttpUtility` is rewritten automatically to `WebUtility` during Layer 1. Focus Layer 2 effort on data binding, templates, and event handler signatures.
Copy file name to clipboardExpand all lines: docs/UtilityFeatures/ServerShim.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Server & Path Resolution Shim
2
2
3
-
The `ServerShim` class provides compatibility with the ASP.NET Web Forms `Server` object (`HttpServerUtility`). It wraps ASP.NET Core's `IWebHostEnvironment`and `System.Net.WebUtility` so that migrated code-behind using `Server.MapPath()`, `Server.HtmlEncode()`, and `Server.UrlEncode()` compiles and works correctly. The `ResolveUrl()` and `ResolveClientUrl()` methods on `WebFormsPageBase` handle virtual path and `.aspx` extension stripping.
3
+
The `ServerShim` class provides compatibility with the ASP.NET Web Forms `Server` object (`HttpServerUtility`). It wraps ASP.NET Core's `IWebHostEnvironment`, `NavigationManager`, and `System.Net.WebUtility` so that migrated code-behind using `Server.MapPath()`, encoding helpers, `Server.Transfer()`, `Server.GetLastError()`, and `Server.ClearError()` compiles and works correctly. The `ResolveUrl()` and `ResolveClientUrl()` methods on `WebFormsPageBase` handle virtual path and `.aspx` extension stripping.
4
4
5
5
Original Microsoft implementation: https://docs.microsoft.com/en-us/dotnet/api/system.web.httpserverutility?view=netframework-4.8
6
6
@@ -25,6 +25,8 @@ In Blazor, these concerns are split across several APIs. The `ServerShim` bridge
25
25
1.**`MapPath("~/path")`** — Resolves `~/` to `IWebHostEnvironment.WebRootPath` (wwwroot) and other paths to `ContentRootPath`
26
26
2.**`HtmlEncode()` / `HtmlDecode()`** — Delegates to `System.Net.WebUtility`
27
27
3.**`UrlEncode()` / `UrlDecode()`** — Delegates to `System.Net.WebUtility`
28
+
4.**`Transfer(path)`** — Delegates to `NavigationManager.NavigateTo(path)`
29
+
5.**`GetLastError()` / `ClearError()`** — Compatibility stubs for Web Forms error-handling patterns
28
30
29
31
The `ResolveUrl()` and `ResolveClientUrl()` methods live on `WebFormsPageBase` and:
3.**Code-Behind** (25) — Using statements, HttpUtility/EF modernization, base classes, lifecycle, event handlers, markup-driven safety stubs
116
119
117
120
See **[Transform Reference](transforms.md)** for the flat transform list and **[Semantic Pattern Catalog](semantic-pattern-catalog.md)** for the bounded semantic pass that runs afterward.
0 commit comments