Repository navigation
Preserve template hits when Alpine rebinds morphed attributes - #9
Merged
Merged
Conversation
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.
Alpine runs its attribute handlers again after morphdom restores the original
x-on:clickexpression. The coverage runtime previously instrumented only the initial tree walk. It now rewrites the attribute records Alpine is about to bind, so the rebind keeps its statement counter without adding another DOM mutation.The regression morphs the existing button from the same instrumented server response before its first click. With 2.1.2 the handler ran once and recorded zero hits. With this change it runs once and records a hit against the specific
x-on:clickstatement. The same markup remains interactive in a stock browser context. The served expression isincrementin both cases.Local validation passed 55 unit tests, 17 Playwright checks, 19 Cypress checks, TypeScript declarations, and
npm pack --dry-run. Browser validation used Chrome for Testing 158.0.8127.36. Version 2.1.3 is prepared for the release workflow.Addresses the collector finding in MageLens #104.