Fix can-mirror registration for mirrored dynamic elements#248
Merged
Conversation
commit: |
Deploying playhtml with
|
| Latest commit: |
611f08a
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://6447e178.playhtml.pages.dev |
| Branch Preview URL: | https://cx-fix-can-mirror-dynamic-el.playhtml.pages.dev |
Owner
Author
Code reviewNo issues found. Checked for bugs and project-instruction compliance. |
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.
Summary
can-mirrorapplies shared DOM state, so dynamically mirrored children become interactive without a delayedsetupPlayElementre-walk.can-mirrorcontainer receives a.chairchild withcan-spin,can-toggle, and a/red-stool.pngimage, then verifies the mirrored chair gets live handlers.can-mirror.can-duplicatemissing-template logs in the existing test so package test output stays clean.Root Cause
can-mirrorcorrectly applied the child DOM from shared state, but runtime element setup only happened during the top-level discovery pass or an explicitplayhtml.setupPlayElement(...)call. Descendants created bycan-mirrorduring load were inserted as plain DOM nodes, so their owncan-spin,can-toggle, or other capability attributes were not registered.Validation
bun run test -- src/__tests__/main.basic.test.tsbun run test -- src/__tests__/can-mirror.test.tsbun run testinpackages/playhtmlbun run buildinpackages/commonbun run buildinpackages/playhtmlbun run buildinapps/docs(passes with existing Vite/Astro warnings)bun run lintstill fails in unrelated extension/worker TypeScript surfaces after building@playhtml/extension-types: trail settings props, browser storage/data transfer types, worker runtime globals, page metadatacffetch typing, and WXT manifest typing.