feat: ClientScript Phase 2 — PostBack + ScriptManager shims#116
Closed
csharpfritz wants to merge 7 commits intodevfrom
Closed
feat: ClientScript Phase 2 — PostBack + ScriptManager shims#116csharpfritz wants to merge 7 commits intodevfrom
csharpfritz wants to merge 7 commits intodevfrom
Conversation
- GetPostBackEventReference now documented as zero-rewrite (shim support) - ScriptManager.GetCurrent documented with ScriptManagerShim pattern - GetCallbackEventReference bridge pattern documented (new section 5) - Updated coverage summary to show full Phase 2 support - Updated BWFC022 analyzer to reference Phase 2 shim path - Updated BWFC024 analyzer to reference ScriptManager.GetCurrent() Phase 2 support - Renumbered sections 6-11 to accommodate new callback section Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…se 2) - GetPostBackEventReference calls now preserved (shim-compatible) - ScriptManager.GetCurrent(Page) ScriptManager.GetCurrent(this) - Removed TODO markers shims handle these patterns at runtime - Added/updated CLI test assertions for Phase 2 patterns Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- GetPostBackEventReference() returns working __doPostBack JS string - GetPostBackClientHyperlink() returns javascript: URL - GetCallbackEventReference() returns working JS callback bridge - Created bwfc-postback.js with __doPostBack and callback interop - PostBackEventArgs for event handling - ScriptManagerShim with GetCurrent() factory pattern - WebFormsPageBase postback target registration via JS interop - Registered ScriptManagerShim in DI Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- PostBack button trigger test - PostBack hyperlink click test - ScriptManager startup script registration test - CI-friendly timeouts (30s) learned from Phase 1 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- PostBackDemo/Index.razor with GetPostBackEventReference, hyperlink, and ScriptManager sections - Stable element IDs for Playwright integration testing (postback-button, postback-link, scriptmanager-target, etc.) - Added to ComponentCatalog.cs under Migration Helpers category - Added to ComponentList.razor under Migration Helpers section - Inherits WebFormsPageBase for PostBack event, ClientScript access, and ScriptManagerShim.GetCurrent(this) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- GetPostBackEventReference output format and escaping tests - GetPostBackClientHyperlink javascript: prefix tests - GetCallbackEventReference bridge string tests - ScriptManagerShim.GetCurrent factory + delegation tests - PostBackEventArgs construction tests Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
| await _jsRuntime.InvokeVoidAsync( | ||
| "__bwfc.unregisterPostBackTarget", _postBackTargetId); | ||
| } | ||
| catch (JSDisconnectedException) { } |
| "__bwfc.unregisterPostBackTarget", _postBackTargetId); | ||
| } | ||
| catch (JSDisconnectedException) { } | ||
| catch (ObjectDisposedException) { } |
| } | ||
| catch (JSDisconnectedException) { } | ||
| catch (ObjectDisposedException) { } | ||
| catch (InvalidOperationException) { } |
Owner
Author
|
Closing reopening against upstream (FritzAndFriends) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ClientScript Phase 2 — PostBack + ScriptManager Shims
Phase 1 (FritzAndFriends#530) delivered
RegisterStartupScript,RegisterClientScriptBlock, andRegisterClientScriptIncludeas zero-rewrite shims. Phase 2 extends the surface area to cover postback events and ScriptManager patterns.What's New
🔧 Runtime Shims
GetPostBackEventReference(control, arg)— returns working__doPostBack('id','arg')JS stringGetPostBackClientHyperlink(control, arg)— returnsjavascript:__doPostBack(...)URLGetCallbackEventReference(...)— returns JS callback bridge stringScriptManagerShimwithGetCurrent(page)static factoryPostBackEventArgs— event args for postback handlingbwfc-postback.js—__doPostBackJS bridge viaDotNetObjectReference🔧 CLI Transform Updates
GetPostBackEventReferencecalls preserved (shim-compatible, no more TODOs)ScriptManager.GetCurrent(Page)→ScriptManager.GetCurrent(this)📝 Documentation
🎆 Demo + Tests
Zero-Rewrite Example